subtledata 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/general_api.rb +56 -0
- data/lib/locations_api.rb +644 -0
- data/lib/monkey.rb +90 -0
- data/lib/swagger/configuration.rb +19 -0
- data/lib/swagger/request.rb +186 -0
- data/lib/swagger/response.rb +70 -0
- data/lib/swagger/version.rb +5 -0
- data/lib/swagger.rb +84 -0
- data/lib/users_api.rb +265 -0
- metadata +56 -0
data/lib/general_api.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
require "uri"
|
2
|
+
|
3
|
+
class General_api
|
4
|
+
basePath = "https://api.subtledata.com/v1"
|
5
|
+
# apiInvoker = APIInvoker
|
6
|
+
|
7
|
+
def self.escapeString(string)
|
8
|
+
URI.encode(string.to_s)
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.get_all_countries (api_key,use_cache,opts={})
|
12
|
+
query_param_keys = [:api_key,:use_cache]
|
13
|
+
|
14
|
+
# verify existence of params
|
15
|
+
raise "api_key is required" if api_key.nil?
|
16
|
+
# set default values and merge with input
|
17
|
+
options = { :api_key => api_key, :use_cache => use_cache}.merge(opts)
|
18
|
+
|
19
|
+
#resource path
|
20
|
+
path = "/general/countries".sub('{format}','json')
|
21
|
+
|
22
|
+
# pull querystring keys from options
|
23
|
+
queryopts = options.select do |key,value|
|
24
|
+
query_param_keys.include? key
|
25
|
+
end
|
26
|
+
|
27
|
+
headers = nil
|
28
|
+
post_body = nil
|
29
|
+
response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
30
|
+
response.map {|response|Country.new(response)}
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.get_all_states (api_key,use_cache,opts={})
|
34
|
+
query_param_keys = [:api_key,:use_cache]
|
35
|
+
|
36
|
+
# verify existence of params
|
37
|
+
raise "api_key is required" if api_key.nil?
|
38
|
+
# set default values and merge with input
|
39
|
+
options = { :api_key => api_key, :use_cache => use_cache}.merge(opts)
|
40
|
+
|
41
|
+
#resource path
|
42
|
+
path = "/general/states".sub('{format}','json')
|
43
|
+
|
44
|
+
# pull querystring keys from options
|
45
|
+
queryopts = options.select do |key,value|
|
46
|
+
query_param_keys.include? key
|
47
|
+
end
|
48
|
+
|
49
|
+
headers = nil
|
50
|
+
post_body = nil
|
51
|
+
response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
52
|
+
response.map {|response|State.new(response)}
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
|
@@ -0,0 +1,644 @@
|
|
1
|
+
require "uri"
|
2
|
+
|
3
|
+
class Locations_api
|
4
|
+
basePath = "https://api.subtledata.com/v1"
|
5
|
+
# apiInvoker = APIInvoker
|
6
|
+
|
7
|
+
def self.escapeString(string)
|
8
|
+
URI.encode(string.to_s)
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.get_all_locations (api_key,use_cache,opts={})
|
12
|
+
query_param_keys = [:api_key,:use_cache]
|
13
|
+
|
14
|
+
# verify existence of params
|
15
|
+
raise "api_key is required" if api_key.nil?
|
16
|
+
# set default values and merge with input
|
17
|
+
options = { :api_key => api_key, :use_cache => use_cache}.merge(opts)
|
18
|
+
|
19
|
+
#resource path
|
20
|
+
path = "/locations".sub('{format}','json')
|
21
|
+
|
22
|
+
# pull querystring keys from options
|
23
|
+
queryopts = options.select do |key,value|
|
24
|
+
query_param_keys.include? key
|
25
|
+
end
|
26
|
+
|
27
|
+
headers = nil
|
28
|
+
post_body = nil
|
29
|
+
response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
30
|
+
response.map {|response|Location.new(response)}
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.get_locations_near (api_key,use_cache,latitude,longitude,radius,opts={})
|
34
|
+
query_param_keys = [:api_key,:use_cache,:latitude,:longitude,:radius]
|
35
|
+
|
36
|
+
# verify existence of params
|
37
|
+
raise "api_key is required" if api_key.nil?
|
38
|
+
raise "latitude is required" if latitude.nil?
|
39
|
+
raise "longitude is required" if longitude.nil?
|
40
|
+
raise "radius is required" if radius.nil?
|
41
|
+
# set default values and merge with input
|
42
|
+
options = { :api_key => api_key, :use_cache => use_cache, :latitude => latitude, :longitude => longitude, :radius => radius}.merge(opts)
|
43
|
+
|
44
|
+
#resource path
|
45
|
+
path = "/locations/filter/near".sub('{format}','json')
|
46
|
+
|
47
|
+
# pull querystring keys from options
|
48
|
+
queryopts = options.select do |key,value|
|
49
|
+
query_param_keys.include? key
|
50
|
+
end
|
51
|
+
|
52
|
+
headers = nil
|
53
|
+
post_body = nil
|
54
|
+
response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
55
|
+
response.map {|response|Location.new(response)}
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.get_location (location_id,api_key,use_cache,opts={})
|
59
|
+
query_param_keys = [:api_key,:use_cache]
|
60
|
+
|
61
|
+
# verify existence of params
|
62
|
+
raise "location_id is required" if location_id.nil?
|
63
|
+
raise "api_key is required" if api_key.nil?
|
64
|
+
# set default values and merge with input
|
65
|
+
options = { :location_id => location_id, :api_key => api_key, :use_cache => use_cache}.merge(opts)
|
66
|
+
|
67
|
+
#resource path
|
68
|
+
path = "/locations/{location_id}".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
|
69
|
+
|
70
|
+
|
71
|
+
# pull querystring keys from options
|
72
|
+
queryopts = options.select do |key,value|
|
73
|
+
query_param_keys.include? key
|
74
|
+
end
|
75
|
+
|
76
|
+
headers = nil
|
77
|
+
post_body = nil
|
78
|
+
response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
79
|
+
Location.new(response)
|
80
|
+
end
|
81
|
+
|
82
|
+
def self.get_location_menu (location_id,api_key,use_cache,opts={})
|
83
|
+
query_param_keys = [:api_key,:use_cache]
|
84
|
+
|
85
|
+
# verify existence of params
|
86
|
+
raise "location_id is required" if location_id.nil?
|
87
|
+
raise "api_key is required" if api_key.nil?
|
88
|
+
# set default values and merge with input
|
89
|
+
options = { :location_id => location_id, :api_key => api_key, :use_cache => use_cache}.merge(opts)
|
90
|
+
|
91
|
+
#resource path
|
92
|
+
path = "/locations/{location_id}/menu".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
|
93
|
+
|
94
|
+
|
95
|
+
# pull querystring keys from options
|
96
|
+
queryopts = options.select do |key,value|
|
97
|
+
query_param_keys.include? key
|
98
|
+
end
|
99
|
+
|
100
|
+
headers = nil
|
101
|
+
post_body = nil
|
102
|
+
response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
103
|
+
response.map {|response|Category.new(response)}
|
104
|
+
end
|
105
|
+
|
106
|
+
def self.get_location_employees (location_id,api_key,manager_id,revenue_center_id,opts={})
|
107
|
+
query_param_keys = [:api_key,:manager_id,:revenue_center_id]
|
108
|
+
|
109
|
+
# verify existence of params
|
110
|
+
raise "location_id is required" if location_id.nil?
|
111
|
+
raise "api_key is required" if api_key.nil?
|
112
|
+
raise "manager_id is required" if manager_id.nil?
|
113
|
+
# set default values and merge with input
|
114
|
+
options = { :location_id => location_id, :api_key => api_key, :manager_id => manager_id, :revenue_center_id => revenue_center_id}.merge(opts)
|
115
|
+
|
116
|
+
#resource path
|
117
|
+
path = "/locations/{location_id}/employees".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
|
118
|
+
|
119
|
+
|
120
|
+
# pull querystring keys from options
|
121
|
+
queryopts = options.select do |key,value|
|
122
|
+
query_param_keys.include? key
|
123
|
+
end
|
124
|
+
|
125
|
+
headers = nil
|
126
|
+
post_body = nil
|
127
|
+
response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
128
|
+
response.map {|response|Employee.new(response)}
|
129
|
+
end
|
130
|
+
|
131
|
+
def self.get_table_list (location_id,api_key,use_cache,opts={})
|
132
|
+
query_param_keys = [:api_key,:use_cache]
|
133
|
+
|
134
|
+
# verify existence of params
|
135
|
+
raise "location_id is required" if location_id.nil?
|
136
|
+
raise "api_key is required" if api_key.nil?
|
137
|
+
# set default values and merge with input
|
138
|
+
options = { :location_id => location_id, :api_key => api_key, :use_cache => use_cache}.merge(opts)
|
139
|
+
|
140
|
+
#resource path
|
141
|
+
path = "/locations/{location_id}/tables".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
|
142
|
+
|
143
|
+
|
144
|
+
# pull querystring keys from options
|
145
|
+
queryopts = options.select do |key,value|
|
146
|
+
query_param_keys.include? key
|
147
|
+
end
|
148
|
+
|
149
|
+
headers = nil
|
150
|
+
post_body = nil
|
151
|
+
response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
152
|
+
response.map {|response|TableMinimal.new(response)}
|
153
|
+
end
|
154
|
+
|
155
|
+
def self.get_tickets (location_id,api_key,condensed,opts={})
|
156
|
+
query_param_keys = [:api_key,:condensed]
|
157
|
+
|
158
|
+
# verify existence of params
|
159
|
+
raise "location_id is required" if location_id.nil?
|
160
|
+
raise "api_key is required" if api_key.nil?
|
161
|
+
# set default values and merge with input
|
162
|
+
options = { :location_id => location_id, :api_key => api_key, :condensed => condensed}.merge(opts)
|
163
|
+
|
164
|
+
#resource path
|
165
|
+
path = "/locations/{location_id}/tickets".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
|
166
|
+
|
167
|
+
|
168
|
+
# pull querystring keys from options
|
169
|
+
queryopts = options.select do |key,value|
|
170
|
+
query_param_keys.include? key
|
171
|
+
end
|
172
|
+
|
173
|
+
headers = nil
|
174
|
+
post_body = nil
|
175
|
+
response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
176
|
+
response.map {|response|Ticket.new(response)}
|
177
|
+
end
|
178
|
+
|
179
|
+
def self.create_ticket (location_id,api_key,ticket_type,body,opts={})
|
180
|
+
query_param_keys = [:api_key,:ticket_type]
|
181
|
+
|
182
|
+
# verify existence of params
|
183
|
+
raise "location_id is required" if location_id.nil?
|
184
|
+
raise "api_key is required" if api_key.nil?
|
185
|
+
raise "body is required" if body.nil?
|
186
|
+
# set default values and merge with input
|
187
|
+
options = { :location_id => location_id, :api_key => api_key, :ticket_type => ticket_type, :body => body}.merge(opts)
|
188
|
+
|
189
|
+
#resource path
|
190
|
+
path = "/locations/{location_id}/tickets".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
|
191
|
+
|
192
|
+
|
193
|
+
# pull querystring keys from options
|
194
|
+
queryopts = options.select do |key,value|
|
195
|
+
query_param_keys.include? key
|
196
|
+
end
|
197
|
+
|
198
|
+
headers = nil
|
199
|
+
post_body = nil
|
200
|
+
if body != nil
|
201
|
+
if body.is_a?(Array)
|
202
|
+
array = Array.new
|
203
|
+
body.each do |item|
|
204
|
+
if item.respond_to?("to_body".to_sym)
|
205
|
+
array.push item.to_body
|
206
|
+
else
|
207
|
+
array.push item
|
208
|
+
end
|
209
|
+
end
|
210
|
+
post_body = array
|
211
|
+
|
212
|
+
else
|
213
|
+
if body.respond_to?("to_body".to_sym)
|
214
|
+
post_body = body.to_body
|
215
|
+
else
|
216
|
+
post_body = body
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
221
|
+
TicketStatus.new(response)
|
222
|
+
end
|
223
|
+
|
224
|
+
def self.get_tabs (location_id,api_key,opts={})
|
225
|
+
query_param_keys = [:api_key]
|
226
|
+
|
227
|
+
# verify existence of params
|
228
|
+
raise "location_id is required" if location_id.nil?
|
229
|
+
raise "api_key is required" if api_key.nil?
|
230
|
+
# set default values and merge with input
|
231
|
+
options = { :location_id => location_id, :api_key => api_key}.merge(opts)
|
232
|
+
|
233
|
+
#resource path
|
234
|
+
path = "/locations/{location_id}/tabs".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
|
235
|
+
|
236
|
+
|
237
|
+
# pull querystring keys from options
|
238
|
+
queryopts = options.select do |key,value|
|
239
|
+
query_param_keys.include? key
|
240
|
+
end
|
241
|
+
|
242
|
+
headers = nil
|
243
|
+
post_body = nil
|
244
|
+
response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
245
|
+
response.map {|response|Tab.new(response)}
|
246
|
+
end
|
247
|
+
|
248
|
+
def self.get_table (location_id,table_id,api_key,opts={})
|
249
|
+
query_param_keys = [:api_key]
|
250
|
+
|
251
|
+
# verify existence of params
|
252
|
+
raise "location_id is required" if location_id.nil?
|
253
|
+
raise "table_id is required" if table_id.nil?
|
254
|
+
raise "api_key is required" if api_key.nil?
|
255
|
+
# set default values and merge with input
|
256
|
+
options = { :location_id => location_id, :table_id => table_id, :api_key => api_key}.merge(opts)
|
257
|
+
|
258
|
+
#resource path
|
259
|
+
path = "/locations/{location_id}/tables/{table_id}".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
|
260
|
+
.sub('{' + 'table_id' + '}', escapeString(table_id))
|
261
|
+
|
262
|
+
|
263
|
+
# pull querystring keys from options
|
264
|
+
queryopts = options.select do |key,value|
|
265
|
+
query_param_keys.include? key
|
266
|
+
end
|
267
|
+
|
268
|
+
headers = nil
|
269
|
+
post_body = nil
|
270
|
+
response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
271
|
+
TableDetails.new(response)
|
272
|
+
end
|
273
|
+
|
274
|
+
def self.get_ticket (location_id,ticket_id,api_key,user_id,opts={})
|
275
|
+
query_param_keys = [:api_key,:user_id]
|
276
|
+
|
277
|
+
# verify existence of params
|
278
|
+
raise "location_id is required" if location_id.nil?
|
279
|
+
raise "ticket_id is required" if ticket_id.nil?
|
280
|
+
raise "api_key is required" if api_key.nil?
|
281
|
+
# set default values and merge with input
|
282
|
+
options = { :location_id => location_id, :ticket_id => ticket_id, :api_key => api_key, :user_id => user_id}.merge(opts)
|
283
|
+
|
284
|
+
#resource path
|
285
|
+
path = "/locations/{location_id}/tickets/{ticket_id}".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
|
286
|
+
.sub('{' + 'ticket_id' + '}', escapeString(ticket_id))
|
287
|
+
|
288
|
+
|
289
|
+
# pull querystring keys from options
|
290
|
+
queryopts = options.select do |key,value|
|
291
|
+
query_param_keys.include? key
|
292
|
+
end
|
293
|
+
|
294
|
+
headers = nil
|
295
|
+
post_body = nil
|
296
|
+
response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
297
|
+
Ticket.new(response)
|
298
|
+
end
|
299
|
+
|
300
|
+
def self.void_ticket (location_id,ticket_id,api_key,user_id,opts={})
|
301
|
+
query_param_keys = [:api_key,:user_id]
|
302
|
+
|
303
|
+
# verify existence of params
|
304
|
+
raise "location_id is required" if location_id.nil?
|
305
|
+
raise "ticket_id is required" if ticket_id.nil?
|
306
|
+
raise "api_key is required" if api_key.nil?
|
307
|
+
# set default values and merge with input
|
308
|
+
options = { :location_id => location_id, :ticket_id => ticket_id, :api_key => api_key, :user_id => user_id}.merge(opts)
|
309
|
+
|
310
|
+
#resource path
|
311
|
+
path = "/locations/{location_id}/tickets/{ticket_id}".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
|
312
|
+
.sub('{' + 'ticket_id' + '}', escapeString(ticket_id))
|
313
|
+
|
314
|
+
|
315
|
+
# pull querystring keys from options
|
316
|
+
queryopts = options.select do |key,value|
|
317
|
+
query_param_keys.include? key
|
318
|
+
end
|
319
|
+
|
320
|
+
headers = nil
|
321
|
+
post_body = nil
|
322
|
+
response = Swagger::Request.new(:DELETE, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
323
|
+
Status.new(response)
|
324
|
+
end
|
325
|
+
|
326
|
+
def self.get_ticket_with_p_o_s__i_d (location_id,pos_ticket_id,api_key,user_id,opts={})
|
327
|
+
query_param_keys = [:api_key,:user_id]
|
328
|
+
|
329
|
+
# verify existence of params
|
330
|
+
raise "location_id is required" if location_id.nil?
|
331
|
+
raise "pos_ticket_id is required" if pos_ticket_id.nil?
|
332
|
+
raise "api_key is required" if api_key.nil?
|
333
|
+
# set default values and merge with input
|
334
|
+
options = { :location_id => location_id, :pos_ticket_id => pos_ticket_id, :api_key => api_key, :user_id => user_id}.merge(opts)
|
335
|
+
|
336
|
+
#resource path
|
337
|
+
path = "/locations/{location_id}/tickets/pos/{pos_ticket_id}".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
|
338
|
+
.sub('{' + 'pos_ticket_id' + '}', escapeString(pos_ticket_id))
|
339
|
+
|
340
|
+
|
341
|
+
# pull querystring keys from options
|
342
|
+
queryopts = options.select do |key,value|
|
343
|
+
query_param_keys.include? key
|
344
|
+
end
|
345
|
+
|
346
|
+
headers = nil
|
347
|
+
post_body = nil
|
348
|
+
response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
349
|
+
Ticket.new(response)
|
350
|
+
end
|
351
|
+
|
352
|
+
def self.submit_order (location_id,ticket_id,user_id,api_key,opts={})
|
353
|
+
query_param_keys = [:api_key]
|
354
|
+
|
355
|
+
# verify existence of params
|
356
|
+
raise "location_id is required" if location_id.nil?
|
357
|
+
raise "ticket_id is required" if ticket_id.nil?
|
358
|
+
raise "user_id is required" if user_id.nil?
|
359
|
+
raise "api_key is required" if api_key.nil?
|
360
|
+
# set default values and merge with input
|
361
|
+
options = { :location_id => location_id, :ticket_id => ticket_id, :user_id => user_id, :api_key => api_key}.merge(opts)
|
362
|
+
|
363
|
+
#resource path
|
364
|
+
path = "/locations/{location_id}/tickets/{ticket_id}/users/{user_id}/order".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
|
365
|
+
.sub('{' + 'ticket_id' + '}', escapeString(ticket_id))
|
366
|
+
.sub('{' + 'user_id' + '}', escapeString(user_id))
|
367
|
+
|
368
|
+
|
369
|
+
# pull querystring keys from options
|
370
|
+
queryopts = options.select do |key,value|
|
371
|
+
query_param_keys.include? key
|
372
|
+
end
|
373
|
+
|
374
|
+
headers = nil
|
375
|
+
post_body = nil
|
376
|
+
response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
377
|
+
OrderResults.new(response)
|
378
|
+
end
|
379
|
+
|
380
|
+
def self.add_items_to_order (location_id,ticket_id,user_id,api_key,body,opts={})
|
381
|
+
query_param_keys = [:api_key]
|
382
|
+
|
383
|
+
# verify existence of params
|
384
|
+
raise "location_id is required" if location_id.nil?
|
385
|
+
raise "ticket_id is required" if ticket_id.nil?
|
386
|
+
raise "user_id is required" if user_id.nil?
|
387
|
+
raise "api_key is required" if api_key.nil?
|
388
|
+
raise "body is required" if body.nil?
|
389
|
+
# set default values and merge with input
|
390
|
+
options = { :location_id => location_id, :ticket_id => ticket_id, :user_id => user_id, :api_key => api_key, :body => body}.merge(opts)
|
391
|
+
|
392
|
+
#resource path
|
393
|
+
path = "/locations/{location_id}/tickets/{ticket_id}/users/{user_id}/order".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
|
394
|
+
.sub('{' + 'ticket_id' + '}', escapeString(ticket_id))
|
395
|
+
.sub('{' + 'user_id' + '}', escapeString(user_id))
|
396
|
+
|
397
|
+
|
398
|
+
# pull querystring keys from options
|
399
|
+
queryopts = options.select do |key,value|
|
400
|
+
query_param_keys.include? key
|
401
|
+
end
|
402
|
+
|
403
|
+
headers = nil
|
404
|
+
post_body = nil
|
405
|
+
if body != nil
|
406
|
+
if body.is_a?(Array)
|
407
|
+
array = Array.new
|
408
|
+
body.each do |item|
|
409
|
+
if item.respond_to?("to_body".to_sym)
|
410
|
+
array.push item.to_body
|
411
|
+
else
|
412
|
+
array.push item
|
413
|
+
end
|
414
|
+
end
|
415
|
+
post_body = array
|
416
|
+
|
417
|
+
else
|
418
|
+
if body.respond_to?("to_body".to_sym)
|
419
|
+
post_body = body.to_body
|
420
|
+
else
|
421
|
+
post_body = body
|
422
|
+
end
|
423
|
+
end
|
424
|
+
end
|
425
|
+
response = Swagger::Request.new(:PUT, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
426
|
+
Status.new(response)
|
427
|
+
end
|
428
|
+
|
429
|
+
def self.get_users_connected_to_ticket (location_id,ticket_id,api_key,opts={})
|
430
|
+
query_param_keys = [:api_key]
|
431
|
+
|
432
|
+
# verify existence of params
|
433
|
+
raise "location_id is required" if location_id.nil?
|
434
|
+
raise "ticket_id is required" if ticket_id.nil?
|
435
|
+
raise "api_key is required" if api_key.nil?
|
436
|
+
# set default values and merge with input
|
437
|
+
options = { :location_id => location_id, :ticket_id => ticket_id, :api_key => api_key}.merge(opts)
|
438
|
+
|
439
|
+
#resource path
|
440
|
+
path = "/locations/{location_id}/tickets/{ticket_id}/users".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
|
441
|
+
.sub('{' + 'ticket_id' + '}', escapeString(ticket_id))
|
442
|
+
|
443
|
+
|
444
|
+
# pull querystring keys from options
|
445
|
+
queryopts = options.select do |key,value|
|
446
|
+
query_param_keys.include? key
|
447
|
+
end
|
448
|
+
|
449
|
+
headers = nil
|
450
|
+
post_body = nil
|
451
|
+
response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
452
|
+
response.map {|response|User.new(response)}
|
453
|
+
end
|
454
|
+
|
455
|
+
def self.connect_user_to_ticket (location_id,ticket_id,api_key,body,opts={})
|
456
|
+
query_param_keys = [:api_key]
|
457
|
+
|
458
|
+
# verify existence of params
|
459
|
+
raise "location_id is required" if location_id.nil?
|
460
|
+
raise "ticket_id is required" if ticket_id.nil?
|
461
|
+
raise "api_key is required" if api_key.nil?
|
462
|
+
raise "body is required" if body.nil?
|
463
|
+
# set default values and merge with input
|
464
|
+
options = { :location_id => location_id, :ticket_id => ticket_id, :api_key => api_key, :body => body}.merge(opts)
|
465
|
+
|
466
|
+
#resource path
|
467
|
+
path = "/locations/{location_id}/tickets/{ticket_id}/users".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
|
468
|
+
.sub('{' + 'ticket_id' + '}', escapeString(ticket_id))
|
469
|
+
|
470
|
+
|
471
|
+
# pull querystring keys from options
|
472
|
+
queryopts = options.select do |key,value|
|
473
|
+
query_param_keys.include? key
|
474
|
+
end
|
475
|
+
|
476
|
+
headers = nil
|
477
|
+
post_body = nil
|
478
|
+
if body != nil
|
479
|
+
if body.is_a?(Array)
|
480
|
+
array = Array.new
|
481
|
+
body.each do |item|
|
482
|
+
if item.respond_to?("to_body".to_sym)
|
483
|
+
array.push item.to_body
|
484
|
+
else
|
485
|
+
array.push item
|
486
|
+
end
|
487
|
+
end
|
488
|
+
post_body = array
|
489
|
+
|
490
|
+
else
|
491
|
+
if body.respond_to?("to_body".to_sym)
|
492
|
+
post_body = body.to_body
|
493
|
+
else
|
494
|
+
post_body = body
|
495
|
+
end
|
496
|
+
end
|
497
|
+
end
|
498
|
+
response = Swagger::Request.new(:PUT, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
499
|
+
ConnectStatus.new(response)
|
500
|
+
end
|
501
|
+
|
502
|
+
def self.discount_ticket (location_id,ticket_id,api_key,body,opts={})
|
503
|
+
query_param_keys = [:api_key]
|
504
|
+
|
505
|
+
# verify existence of params
|
506
|
+
raise "location_id is required" if location_id.nil?
|
507
|
+
raise "ticket_id is required" if ticket_id.nil?
|
508
|
+
raise "api_key is required" if api_key.nil?
|
509
|
+
raise "body is required" if body.nil?
|
510
|
+
# set default values and merge with input
|
511
|
+
options = { :location_id => location_id, :ticket_id => ticket_id, :api_key => api_key, :body => body}.merge(opts)
|
512
|
+
|
513
|
+
#resource path
|
514
|
+
path = "/locations/{location_id}/tickets/{ticket_id}/discount".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
|
515
|
+
.sub('{' + 'ticket_id' + '}', escapeString(ticket_id))
|
516
|
+
|
517
|
+
|
518
|
+
# pull querystring keys from options
|
519
|
+
queryopts = options.select do |key,value|
|
520
|
+
query_param_keys.include? key
|
521
|
+
end
|
522
|
+
|
523
|
+
headers = nil
|
524
|
+
post_body = nil
|
525
|
+
if body != nil
|
526
|
+
if body.is_a?(Array)
|
527
|
+
array = Array.new
|
528
|
+
body.each do |item|
|
529
|
+
if item.respond_to?("to_body".to_sym)
|
530
|
+
array.push item.to_body
|
531
|
+
else
|
532
|
+
array.push item
|
533
|
+
end
|
534
|
+
end
|
535
|
+
post_body = array
|
536
|
+
|
537
|
+
else
|
538
|
+
if body.respond_to?("to_body".to_sym)
|
539
|
+
post_body = body.to_body
|
540
|
+
else
|
541
|
+
post_body = body
|
542
|
+
end
|
543
|
+
end
|
544
|
+
end
|
545
|
+
response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
546
|
+
Status.new(response)
|
547
|
+
end
|
548
|
+
|
549
|
+
def self.add_payment_to_ticket (location_id,ticket_id,api_key,body,opts={})
|
550
|
+
query_param_keys = [:api_key]
|
551
|
+
|
552
|
+
# verify existence of params
|
553
|
+
raise "location_id is required" if location_id.nil?
|
554
|
+
raise "ticket_id is required" if ticket_id.nil?
|
555
|
+
raise "api_key is required" if api_key.nil?
|
556
|
+
raise "body is required" if body.nil?
|
557
|
+
# set default values and merge with input
|
558
|
+
options = { :location_id => location_id, :ticket_id => ticket_id, :api_key => api_key, :body => body}.merge(opts)
|
559
|
+
|
560
|
+
#resource path
|
561
|
+
path = "/locations/{location_id}/tickets/{ticket_id}/payments".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
|
562
|
+
.sub('{' + 'ticket_id' + '}', escapeString(ticket_id))
|
563
|
+
|
564
|
+
|
565
|
+
# pull querystring keys from options
|
566
|
+
queryopts = options.select do |key,value|
|
567
|
+
query_param_keys.include? key
|
568
|
+
end
|
569
|
+
|
570
|
+
headers = nil
|
571
|
+
post_body = nil
|
572
|
+
if body != nil
|
573
|
+
if body.is_a?(Array)
|
574
|
+
array = Array.new
|
575
|
+
body.each do |item|
|
576
|
+
if item.respond_to?("to_body".to_sym)
|
577
|
+
array.push item.to_body
|
578
|
+
else
|
579
|
+
array.push item
|
580
|
+
end
|
581
|
+
end
|
582
|
+
post_body = array
|
583
|
+
|
584
|
+
else
|
585
|
+
if body.respond_to?("to_body".to_sym)
|
586
|
+
post_body = body.to_body
|
587
|
+
else
|
588
|
+
post_body = body
|
589
|
+
end
|
590
|
+
end
|
591
|
+
end
|
592
|
+
response = Swagger::Request.new(:PUT, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
593
|
+
PaymentStatus.new(response)
|
594
|
+
end
|
595
|
+
|
596
|
+
def self.add_external_payment_to_ticket (location_id,ticket_id,api_key,body,opts={})
|
597
|
+
query_param_keys = [:api_key]
|
598
|
+
|
599
|
+
# verify existence of params
|
600
|
+
raise "location_id is required" if location_id.nil?
|
601
|
+
raise "ticket_id is required" if ticket_id.nil?
|
602
|
+
raise "api_key is required" if api_key.nil?
|
603
|
+
raise "body is required" if body.nil?
|
604
|
+
# set default values and merge with input
|
605
|
+
options = { :location_id => location_id, :ticket_id => ticket_id, :api_key => api_key, :body => body}.merge(opts)
|
606
|
+
|
607
|
+
#resource path
|
608
|
+
path = "/locations/{location_id}/tickets/{ticket_id}/payments/external".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
|
609
|
+
.sub('{' + 'ticket_id' + '}', escapeString(ticket_id))
|
610
|
+
|
611
|
+
|
612
|
+
# pull querystring keys from options
|
613
|
+
queryopts = options.select do |key,value|
|
614
|
+
query_param_keys.include? key
|
615
|
+
end
|
616
|
+
|
617
|
+
headers = nil
|
618
|
+
post_body = nil
|
619
|
+
if body != nil
|
620
|
+
if body.is_a?(Array)
|
621
|
+
array = Array.new
|
622
|
+
body.each do |item|
|
623
|
+
if item.respond_to?("to_body".to_sym)
|
624
|
+
array.push item.to_body
|
625
|
+
else
|
626
|
+
array.push item
|
627
|
+
end
|
628
|
+
end
|
629
|
+
post_body = array
|
630
|
+
|
631
|
+
else
|
632
|
+
if body.respond_to?("to_body".to_sym)
|
633
|
+
post_body = body.to_body
|
634
|
+
else
|
635
|
+
post_body = body
|
636
|
+
end
|
637
|
+
end
|
638
|
+
end
|
639
|
+
response = Swagger::Request.new(:PUT, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
640
|
+
ExternalPaymentStatus.new(response)
|
641
|
+
end
|
642
|
+
|
643
|
+
end
|
644
|
+
|