Class: Locations_api

Inherits:
Object show all
Defined in:
lib/locations_api.rb

Class Method Summary collapse

Class Method Details

.add_external_payment_to_ticket(location_id, ticket_id, api_key, body, opts = {}) ⇒ Object



622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
# File 'lib/locations_api.rb', line 622

def self.add_external_payment_to_ticket (location_id,ticket_id,api_key,body,opts={})
  query_param_keys = [:api_key]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "ticket_id is required" if ticket_id.nil?
  raise "api_key is required" if api_key.nil?
  raise "body is required" if body.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :ticket_id => ticket_id, :api_key => api_key, :body => body}.merge(opts)

  #resource path
  path = "/locations/{location_id}/tickets/{ticket_id}/payments/external".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  .sub('{' + 'ticket_id' + '}', escapeString(ticket_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  if body != nil
    if body.is_a?(Array)
      array = Array.new
      body.each do |item|
        if item.respond_to?("to_body".to_sym)
          array.push item.to_body
        else
          array.push item
        end
      end
      post_body = array

    else 
      if body.respond_to?("to_body".to_sym)
       post_body = body.to_body
     else
       post_body = body
     end
    end
  end
  response = Swagger::Request.new(:PUT, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  ExternalPaymentStatus.new(response)
end

.add_items_to_order(location_id, ticket_id, user_id, api_key, body, opts = {}) ⇒ Object



406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
# File 'lib/locations_api.rb', line 406

def self.add_items_to_order (location_id,ticket_id,user_id,api_key,body,opts={})
  query_param_keys = [:api_key]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "ticket_id is required" if ticket_id.nil?
  raise "user_id is required" if user_id.nil?
  raise "api_key is required" if api_key.nil?
  raise "body is required" if body.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :ticket_id => ticket_id, :user_id => user_id, :api_key => api_key, :body => body}.merge(opts)

  #resource path
  path = "/locations/{location_id}/tickets/{ticket_id}/users/{user_id}/order".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  .sub('{' + 'ticket_id' + '}', escapeString(ticket_id))
  .sub('{' + 'user_id' + '}', escapeString(user_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  if body != nil
    if body.is_a?(Array)
      array = Array.new
      body.each do |item|
        if item.respond_to?("to_body".to_sym)
          array.push item.to_body
        else
          array.push item
        end
      end
      post_body = array

    else 
      if body.respond_to?("to_body".to_sym)
       post_body = body.to_body
     else
       post_body = body
     end
    end
  end
  response = Swagger::Request.new(:PUT, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  Status.new(response)
end

.add_payment_to_ticket(location_id, ticket_id, api_key, body, opts = {}) ⇒ Object



575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
# File 'lib/locations_api.rb', line 575

def self.add_payment_to_ticket (location_id,ticket_id,api_key,body,opts={})
  query_param_keys = [:api_key]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "ticket_id is required" if ticket_id.nil?
  raise "api_key is required" if api_key.nil?
  raise "body is required" if body.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :ticket_id => ticket_id, :api_key => api_key, :body => body}.merge(opts)

  #resource path
  path = "/locations/{location_id}/tickets/{ticket_id}/payments".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  .sub('{' + 'ticket_id' + '}', escapeString(ticket_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  if body != nil
    if body.is_a?(Array)
      array = Array.new
      body.each do |item|
        if item.respond_to?("to_body".to_sym)
          array.push item.to_body
        else
          array.push item
        end
      end
      post_body = array

    else 
      if body.respond_to?("to_body".to_sym)
       post_body = body.to_body
     else
       post_body = body
     end
    end
  end
  response = Swagger::Request.new(:PUT, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  PaymentStatus.new(response)
end

.connect_user_to_ticket(location_id, ticket_id, api_key, body, opts = {}) ⇒ Object



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
# File 'lib/locations_api.rb', line 481

def self.connect_user_to_ticket (location_id,ticket_id,api_key,body,opts={})
  query_param_keys = [:api_key]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "ticket_id is required" if ticket_id.nil?
  raise "api_key is required" if api_key.nil?
  raise "body is required" if body.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :ticket_id => ticket_id, :api_key => api_key, :body => body}.merge(opts)

  #resource path
  path = "/locations/{location_id}/tickets/{ticket_id}/users".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  .sub('{' + 'ticket_id' + '}', escapeString(ticket_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  if body != nil
    if body.is_a?(Array)
      array = Array.new
      body.each do |item|
        if item.respond_to?("to_body".to_sym)
          array.push item.to_body
        else
          array.push item
        end
      end
      post_body = array

    else 
      if body.respond_to?("to_body".to_sym)
       post_body = body.to_body
     else
       post_body = body
     end
    end
  end
  response = Swagger::Request.new(:PUT, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  ConnectStatus.new(response)
end

.create_ticket(location_id, api_key, ticket_type, body, opts = {}) ⇒ Object



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/locations_api.rb', line 205

def self.create_ticket (location_id,api_key,ticket_type,body,opts={})
  query_param_keys = [:api_key,:ticket_type]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "api_key is required" if api_key.nil?
  raise "body is required" if body.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :api_key => api_key, :ticket_type => ticket_type, :body => body}.merge(opts)

  #resource path
  path = "/locations/{location_id}/tickets".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  if body != nil
    if body.is_a?(Array)
      array = Array.new
      body.each do |item|
        if item.respond_to?("to_body".to_sym)
          array.push item.to_body
        else
          array.push item
        end
      end
      post_body = array

    else 
      if body.respond_to?("to_body".to_sym)
       post_body = body.to_body
     else
       post_body = body
     end
    end
  end
  response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  TicketStatus.new(response)
end

.discount_ticket(location_id, ticket_id, api_key, body, opts = {}) ⇒ Object



528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
# File 'lib/locations_api.rb', line 528

def self.discount_ticket (location_id,ticket_id,api_key,body,opts={})
  query_param_keys = [:api_key]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "ticket_id is required" if ticket_id.nil?
  raise "api_key is required" if api_key.nil?
  raise "body is required" if body.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :ticket_id => ticket_id, :api_key => api_key, :body => body}.merge(opts)

  #resource path
  path = "/locations/{location_id}/tickets/{ticket_id}/discount".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  .sub('{' + 'ticket_id' + '}', escapeString(ticket_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  if body != nil
    if body.is_a?(Array)
      array = Array.new
      body.each do |item|
        if item.respond_to?("to_body".to_sym)
          array.push item.to_body
        else
          array.push item
        end
      end
      post_body = array

    else 
      if body.respond_to?("to_body".to_sym)
       post_body = body.to_body
     else
       post_body = body
     end
    end
  end
  response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  Status.new(response)
end

.escapeString(string) ⇒ Object

apiInvoker = APIInvoker



7
8
9
# File 'lib/locations_api.rb', line 7

def self.escapeString(string)
  URI.encode(string.to_s)
end

.get_all_locations(api_key, use_cache, opts = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/locations_api.rb', line 11

def self.get_all_locations (api_key,use_cache,opts={})
  query_param_keys = [:api_key,:use_cache]

  # verify existence of params
  raise "api_key is required" if api_key.nil?
  # set default values and merge with input
  options = { :api_key => api_key, :use_cache => use_cache}.merge(opts)

  #resource path
  path = "/locations".sub('{format}','json')
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  response.map {|response|Location.new(response)}
end

.get_location(location_id, api_key, use_cache, opts = {}) ⇒ Object



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/locations_api.rb', line 58

def self.get_location (location_id,api_key,use_cache,opts={})
  query_param_keys = [:api_key,:use_cache]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "api_key is required" if api_key.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :api_key => api_key, :use_cache => use_cache}.merge(opts)

  #resource path
  path = "/locations/{location_id}".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  Location.new(response)
end

.get_location_employees(location_id, api_key, manager_id, revenue_center_id, opts = {}) ⇒ Object



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/locations_api.rb', line 132

def self.get_location_employees (location_id,api_key,manager_id,revenue_center_id,opts={})
  query_param_keys = [:api_key,:manager_id,:revenue_center_id]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "api_key is required" if api_key.nil?
  raise "manager_id is required" if manager_id.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :api_key => api_key, :manager_id => manager_id, :revenue_center_id => revenue_center_id}.merge(opts)

  #resource path
  path = "/locations/{location_id}/employees".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  response.map {|response|Employee.new(response)}
end

.get_location_menu(location_id, api_key, use_cache, opts = {}) ⇒ Object



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/locations_api.rb', line 82

def self.get_location_menu (location_id,api_key,use_cache,opts={})
  query_param_keys = [:api_key,:use_cache]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "api_key is required" if api_key.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :api_key => api_key, :use_cache => use_cache}.merge(opts)

  #resource path
  path = "/locations/{location_id}/menu".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  response.map {|response|Category.new(response)}
end

.get_locations_near(api_key, use_cache, latitude, longitude, radius, opts = {}) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/locations_api.rb', line 33

def self.get_locations_near (api_key,use_cache,latitude,longitude,radius,opts={})
  query_param_keys = [:api_key,:use_cache,:latitude,:longitude,:radius]

  # verify existence of params
  raise "api_key is required" if api_key.nil?
  raise "latitude is required" if latitude.nil?
  raise "longitude is required" if longitude.nil?
  raise "radius is required" if radius.nil?
  # set default values and merge with input
  options = { :api_key => api_key, :use_cache => use_cache, :latitude => latitude, :longitude => longitude, :radius => radius}.merge(opts)

  #resource path
  path = "/locations/filter/near".sub('{format}','json')
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  response.map {|response|Location.new(response)}
end

.get_menu_item(location_id, item_id, api_key, use_cache, opts = {}) ⇒ Object



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/locations_api.rb', line 106

def self.get_menu_item (location_id,item_id,api_key,use_cache,opts={})
  query_param_keys = [:api_key,:use_cache]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "item_id is required" if item_id.nil?
  raise "api_key is required" if api_key.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :item_id => item_id, :api_key => api_key, :use_cache => use_cache}.merge(opts)

  #resource path
  path = "/locations/{location_id}/menu/items/{item_id}".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  .sub('{' + 'item_id' + '}', escapeString(item_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  MenuItem.new(response)
end

.get_table(location_id, table_id, api_key, opts = {}) ⇒ Object



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
# File 'lib/locations_api.rb', line 274

def self.get_table (location_id,table_id,api_key,opts={})
  query_param_keys = [:api_key]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "table_id is required" if table_id.nil?
  raise "api_key is required" if api_key.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :table_id => table_id, :api_key => api_key}.merge(opts)

  #resource path
  path = "/locations/{location_id}/tables/{table_id}".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  .sub('{' + 'table_id' + '}', escapeString(table_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  TableDetails.new(response)
end

.get_table_list(location_id, api_key, use_cache, opts = {}) ⇒ Object



157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/locations_api.rb', line 157

def self.get_table_list (location_id,api_key,use_cache,opts={})
  query_param_keys = [:api_key,:use_cache]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "api_key is required" if api_key.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :api_key => api_key, :use_cache => use_cache}.merge(opts)

  #resource path
  path = "/locations/{location_id}/tables".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  response.map {|response|TableMinimal.new(response)}
end

.get_tabs(location_id, api_key, opts = {}) ⇒ Object



250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/locations_api.rb', line 250

def self.get_tabs (location_id,api_key,opts={})
  query_param_keys = [:api_key]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "api_key is required" if api_key.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :api_key => api_key}.merge(opts)

  #resource path
  path = "/locations/{location_id}/tabs".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  response.map {|response|Tab.new(response)}
end

.get_ticket(location_id, ticket_id, api_key, user_id, opts = {}) ⇒ Object



300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# File 'lib/locations_api.rb', line 300

def self.get_ticket (location_id,ticket_id,api_key,user_id,opts={})
  query_param_keys = [:api_key,:user_id]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "ticket_id is required" if ticket_id.nil?
  raise "api_key is required" if api_key.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :ticket_id => ticket_id, :api_key => api_key, :user_id => user_id}.merge(opts)

  #resource path
  path = "/locations/{location_id}/tickets/{ticket_id}".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  .sub('{' + 'ticket_id' + '}', escapeString(ticket_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  Ticket.new(response)
end

.get_ticket_with_p_o_s__i_d(location_id, pos_ticket_id, api_key, user_id, opts = {}) ⇒ Object



352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
# File 'lib/locations_api.rb', line 352

def self.get_ticket_with_p_o_s__i_d (location_id,pos_ticket_id,api_key,user_id,opts={})
  query_param_keys = [:api_key,:user_id]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "pos_ticket_id is required" if pos_ticket_id.nil?
  raise "api_key is required" if api_key.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :pos_ticket_id => pos_ticket_id, :api_key => api_key, :user_id => user_id}.merge(opts)

  #resource path
  path = "/locations/{location_id}/tickets/pos/{pos_ticket_id}".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  .sub('{' + 'pos_ticket_id' + '}', escapeString(pos_ticket_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  Ticket.new(response)
end

.get_tickets(location_id, api_key, condensed, opts = {}) ⇒ Object



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/locations_api.rb', line 181

def self.get_tickets (location_id,api_key,condensed,opts={})
  query_param_keys = [:api_key,:condensed]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "api_key is required" if api_key.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :api_key => api_key, :condensed => condensed}.merge(opts)

  #resource path
  path = "/locations/{location_id}/tickets".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  response.map {|response|Ticket.new(response)}
end

.get_users_connected_to_ticket(location_id, ticket_id, api_key, opts = {}) ⇒ Object



455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
# File 'lib/locations_api.rb', line 455

def self.get_users_connected_to_ticket (location_id,ticket_id,api_key,opts={})
  query_param_keys = [:api_key]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "ticket_id is required" if ticket_id.nil?
  raise "api_key is required" if api_key.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :ticket_id => ticket_id, :api_key => api_key}.merge(opts)

  #resource path
  path = "/locations/{location_id}/tickets/{ticket_id}/users".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  .sub('{' + 'ticket_id' + '}', escapeString(ticket_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  response.map {|response|User.new(response)}
end

.submit_order(location_id, ticket_id, user_id, api_key, opts = {}) ⇒ Object



378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
# File 'lib/locations_api.rb', line 378

def self.submit_order (location_id,ticket_id,user_id,api_key,opts={})
  query_param_keys = [:api_key]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "ticket_id is required" if ticket_id.nil?
  raise "user_id is required" if user_id.nil?
  raise "api_key is required" if api_key.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :ticket_id => ticket_id, :user_id => user_id, :api_key => api_key}.merge(opts)

  #resource path
  path = "/locations/{location_id}/tickets/{ticket_id}/users/{user_id}/order".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  .sub('{' + 'ticket_id' + '}', escapeString(ticket_id))
  .sub('{' + 'user_id' + '}', escapeString(user_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  OrderResults.new(response)
end

.void_ticket(location_id, ticket_id, api_key, user_id, opts = {}) ⇒ Object



326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
# File 'lib/locations_api.rb', line 326

def self.void_ticket (location_id,ticket_id,api_key,user_id,opts={})
  query_param_keys = [:api_key,:user_id]

  # verify existence of params
  raise "location_id is required" if location_id.nil?
  raise "ticket_id is required" if ticket_id.nil?
  raise "api_key is required" if api_key.nil?
  # set default values and merge with input
  options = { :location_id => location_id, :ticket_id => ticket_id, :api_key => api_key, :user_id => user_id}.merge(opts)

  #resource path
  path = "/locations/{location_id}/tickets/{ticket_id}".sub('{format}','json').sub('{' + 'location_id' + '}', escapeString(location_id))
  .sub('{' + 'ticket_id' + '}', escapeString(ticket_id))
  
  
  # pull querystring keys from options
  queryopts = options.select do |key,value|
    query_param_keys.include? key
  end
  
  headers = nil
  post_body = nil
  response = Swagger::Request.new(:DELETE, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
  Status.new(response)
end