Skip to content

Commit 089936f

Browse files
author
Attila Laszlo
committed
Statistics Api mod
1 parent 912518a commit 089936f

File tree

5 files changed

+202
-5
lines changed

5 files changed

+202
-5
lines changed

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from setuptools import setup, find_packages
55

66
NAME = "slamby_sdk"
7-
VERSION = "1.2.0"
7+
VERSION = "1.5.1"
88

99

1010

slamby_sdk/api_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def __init__(self, host=None, header_name=None, header_value=None, cookie=None):
8181
self.host = host
8282
self.cookie = cookie
8383
# Set default User-Agent.
84-
self.user_agent = 'Swagger-Codegen/1.5.0/python'
84+
self.user_agent = 'Swagger-Codegen/1.5.1/python'
8585

8686
@property
8787
def user_agent(self):

slamby_sdk/apis/statistics_api.py

+197
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,206 @@ def get_statistics(self, **kwargs):
8686

8787

8888

89+
resource_path = '/api/Statistics'.replace('{format}', 'json')
90+
path_params = {}
91+
92+
93+
query_params = {}
94+
95+
96+
header_params = {}
97+
98+
99+
form_params = []
100+
local_var_files = {}
101+
102+
103+
body_params = None
104+
105+
106+
# HTTP header `Accept`
107+
header_params['Accept'] = self.api_client.\
108+
select_header_accept([])
109+
if not header_params['Accept']:
110+
del header_params['Accept']
111+
112+
# HTTP header `Content-Type`
113+
header_params['Content-Type'] = self.api_client.\
114+
select_header_content_type([])
115+
116+
# Authentication setting
117+
auth_settings = []
118+
119+
response = self.api_client.call_api(resource_path, 'GET',
120+
path_params,
121+
query_params,
122+
header_params,
123+
body=body_params,
124+
post_params=form_params,
125+
files=local_var_files,
126+
response_type='StatisticsWrapper',
127+
auth_settings=auth_settings,
128+
callback=params.get('callback'))
129+
return response
130+
131+
132+
def get_statistics_0(self, year, **kwargs):
133+
"""
134+
135+
136+
137+
This method makes a synchronous HTTP request by default. To make an
138+
asynchronous HTTP request, please define a `callback` function
139+
to be invoked when receiving the response.
140+
>>> def callback_function(response):
141+
>>> pprint(response)
142+
>>>
143+
144+
>>> thread = api.get_statistics_0(year, callback=callback_function)
145+
146+
147+
148+
:param callback function: The callback function
149+
for asynchronous request. (optional)
150+
151+
:param int year: (required)
152+
153+
:return: StatisticsWrapper
154+
If the method is called asynchronously,
155+
returns the request thread.
156+
"""
157+
158+
all_params = ['year']
159+
all_params.append('callback')
160+
161+
params = locals()
162+
for key, val in iteritems(params['kwargs']):
163+
if key not in all_params:
164+
raise TypeError(
165+
"Got an unexpected keyword argument '%s'"
166+
" to method get_statistics_0" % key
167+
)
168+
params[key] = val
169+
del params['kwargs']
170+
171+
172+
173+
# verify the required parameter 'year' is set
174+
if ('year' not in params) or (params['year'] is None):
175+
raise ValueError("Missing the required parameter `year` when calling `get_statistics_0`")
176+
177+
178+
179+
resource_path = '/api/Statistics/{year}'.replace('{format}', 'json')
180+
path_params = {}
181+
182+
if 'year' in params:
183+
path_params['year'] = params['year']
184+
185+
186+
query_params = {}
187+
188+
189+
header_params = {}
190+
191+
192+
form_params = []
193+
local_var_files = {}
194+
195+
196+
body_params = None
197+
198+
199+
# HTTP header `Accept`
200+
header_params['Accept'] = self.api_client.\
201+
select_header_accept([])
202+
if not header_params['Accept']:
203+
del header_params['Accept']
204+
205+
# HTTP header `Content-Type`
206+
header_params['Content-Type'] = self.api_client.\
207+
select_header_content_type([])
208+
209+
# Authentication setting
210+
auth_settings = []
211+
212+
response = self.api_client.call_api(resource_path, 'GET',
213+
path_params,
214+
query_params,
215+
header_params,
216+
body=body_params,
217+
post_params=form_params,
218+
files=local_var_files,
219+
response_type='StatisticsWrapper',
220+
auth_settings=auth_settings,
221+
callback=params.get('callback'))
222+
return response
223+
224+
225+
def get_statistics_1(self, year, month, **kwargs):
226+
"""
227+
228+
229+
230+
This method makes a synchronous HTTP request by default. To make an
231+
asynchronous HTTP request, please define a `callback` function
232+
to be invoked when receiving the response.
233+
>>> def callback_function(response):
234+
>>> pprint(response)
235+
>>>
236+
237+
>>> thread = api.get_statistics_1(year, month, callback=callback_function)
238+
239+
240+
241+
:param callback function: The callback function
242+
for asynchronous request. (optional)
243+
244+
:param int year: (required)
245+
246+
:param int month: (required)
247+
248+
:return: StatisticsWrapper
249+
If the method is called asynchronously,
250+
returns the request thread.
251+
"""
252+
253+
all_params = ['year', 'month']
254+
all_params.append('callback')
255+
256+
params = locals()
257+
for key, val in iteritems(params['kwargs']):
258+
if key not in all_params:
259+
raise TypeError(
260+
"Got an unexpected keyword argument '%s'"
261+
" to method get_statistics_1" % key
262+
)
263+
params[key] = val
264+
del params['kwargs']
265+
266+
267+
268+
# verify the required parameter 'year' is set
269+
if ('year' not in params) or (params['year'] is None):
270+
raise ValueError("Missing the required parameter `year` when calling `get_statistics_1`")
271+
272+
273+
274+
# verify the required parameter 'month' is set
275+
if ('month' not in params) or (params['month'] is None):
276+
raise ValueError("Missing the required parameter `month` when calling `get_statistics_1`")
277+
278+
279+
89280
resource_path = '/api/Statistics/{year}/{month}'.replace('{format}', 'json')
90281
path_params = {}
91282

283+
if 'year' in params:
284+
path_params['year'] = params['year']
285+
286+
if 'month' in params:
287+
path_params['month'] = params['month']
288+
92289

93290
query_params = {}
94291

slamby_sdk/configuration.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,5 +227,5 @@ def to_debug_report(self):
227227
"OS: {env}\n"\
228228
"Python Version: {pyversion}\n"\
229229
"Version of the API: 1.5.0\n"\
230-
"SDK Package Version: 1.5.0".\
230+
"SDK Package Version: 1.5.1".\
231231
format(env=sys.platform, pyversion=sys.version)

slamby_sdk/models/search_settings.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def cut_off_frequency(self, cut_off_frequency):
289289
def fuzziness(self):
290290
"""
291291
Gets the fuzziness of this SearchSettings.
292-
Interpreted as a Levenshtein Edit Distance\u00E2\u20AC\u2030\u00E2\u20AC\u201D\u00E2\u20AC\u2030the number of one character changes that need to be made to one string to make it the same as another string. Can be specified as: -1 (generates an edit distance based on the length of the term) or 0, 1, 2 (the maximum allowed Levenshtein Edit Distance)
292+
Interpreted as a Levenshtein Edit Distance\u2009\u2014\u2009the number of one character changes that need to be made to one string to make it the same as another string. Can be specified as: -1 (generates an edit distance based on the length of the term) or 0, 1, 2 (the maximum allowed Levenshtein Edit Distance)
293293
294294
:return: The fuzziness of this SearchSettings.
295295
:rtype: int
@@ -300,7 +300,7 @@ def fuzziness(self):
300300
def fuzziness(self, fuzziness):
301301
"""
302302
Sets the fuzziness of this SearchSettings.
303-
Interpreted as a Levenshtein Edit Distance\u00E2\u20AC\u2030\u00E2\u20AC\u201D\u00E2\u20AC\u2030the number of one character changes that need to be made to one string to make it the same as another string. Can be specified as: -1 (generates an edit distance based on the length of the term) or 0, 1, 2 (the maximum allowed Levenshtein Edit Distance)
303+
Interpreted as a Levenshtein Edit Distance\u2009\u2014\u2009the number of one character changes that need to be made to one string to make it the same as another string. Can be specified as: -1 (generates an edit distance based on the length of the term) or 0, 1, 2 (the maximum allowed Levenshtein Edit Distance)
304304
305305
:param fuzziness: The fuzziness of this SearchSettings.
306306
:type: int

0 commit comments

Comments
 (0)