Class: Supportify::SupportifyApi

Inherits:
Object
  • Object
show all
Defined in:
lib/supportify_client/api/supportify_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SupportifyApi



7
8
9
# File 'lib/supportify_client/api/supportify_api.rb', line 7

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



5
6
7
# File 'lib/supportify_client/api/supportify_api.rb', line 5

def api_client
  @api_client
end

Instance Method Details

#create_faq(answer, author, question, opts = {}) ⇒ nil

Create a new content entry and add it to the application.

Options Hash (opts):

  • :categories (Array<String>)

    The categories that the content entry belongs to.

  • :format (String)

    The format of the content that has been posted. Currently, the only accepted values are &#39;markdown&#39; and &#39;html&#39;.

  • :tags (Array<String>)

    The tags that the content entry belongs to.



230
231
232
233
# File 'lib/supportify_client/api/supportify_api.rb', line 230

def create_faq(answer, author, question, opts = {})
  create_faq_with_http_info(answer, author, question, opts)
  return nil
end

#create_faq_with_http_info(answer, author, question, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Create a new content entry and add it to the application.

Options Hash (opts):

  • :categories (Array<String>)

    The categories that the content entry belongs to.

  • :format (String)

    The format of the content that has been posted. Currently, the only accepted values are &#39;markdown&#39; and &#39;html&#39;.

  • :tags (Array<String>)

    The tags that the content entry belongs to.



245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
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
299
300
# File 'lib/supportify_client/api/supportify_api.rb', line 245

def create_faq_with_http_info(answer, author, question, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SupportifyApi#create_faq ..."
  end
  
  # verify the required parameter 'answer' is set
  fail "Missing the required parameter 'answer' when calling create_faq" if answer.nil?
  
  # verify the required parameter 'author' is set
  fail "Missing the required parameter 'author' when calling create_faq" if author.nil?
  
  # verify the required parameter 'question' is set
  fail "Missing the required parameter 'question' when calling create_faq" if question.nil?
  
  # resource path
  path = "/faqs".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}
  form_params["answer"] = answer
  form_params["author"] = author
  form_params["question"] = question
  form_params["categories"] = @api_client.build_collection_param(opts[:'categories'], :csv) if opts[:'categories']
  form_params["format"] = opts[:'format'] if opts[:'format']
  form_params["tags"] = @api_client.build_collection_param(opts[:'tags'], :csv) if opts[:'tags']

  # http body (model)
  post_body = nil
  

  auth_names = ['api_key', 'app_key']
  data, status_code, headers = @api_client.call_api(:POST, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SupportifyApi#create_faq\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_categories(opts = {}) ⇒ Array<Category>

Returns all categories from the application.

Options Hash (opts):

  • :categories (String)

    A string expression of the form \&quot;Category 1 AND (Category 2 OR Category 3)\&quot; that will filter for categories attached to content with these categories.

  • :limit (Integer)

    The maximum number of entries to return in the collection.

  • :skip (Integer)

    The number of entries to skip over when returning the results.

  • :sort_asc (BOOLEAN)

    A flag to indicate whether or not the results should be sorted in ascending order.

  • :sort_by (String)

    The property by which the results are sorted.

  • :tags (String)

    A string expression of the form \&quot;Tag 1 AND (Tag 2 OR Tag 3)\&quot; that will filter for categories attached to content with these tags.



21
22
23
24
# File 'lib/supportify_client/api/supportify_api.rb', line 21

def get_categories(opts = {})
  data, status_code, headers = get_categories_with_http_info(opts)
  return data
end

#get_categories_with_http_info(opts = {}) ⇒ Array<(Array<Category>, Fixnum, Hash)>

Returns all categories from the application.

Options Hash (opts):

  • :categories (String)

    A string expression of the form \&quot;Category 1 AND (Category 2 OR Category 3)\&quot; that will filter for categories attached to content with these categories.

  • :limit (Integer)

    The maximum number of entries to return in the collection.

  • :skip (Integer)

    The number of entries to skip over when returning the results.

  • :sort_asc (BOOLEAN)

    A flag to indicate whether or not the results should be sorted in ascending order.

  • :sort_by (String)

    The property by which the results are sorted.

  • :tags (String)

    A string expression of the form \&quot;Tag 1 AND (Tag 2 OR Tag 3)\&quot; that will filter for categories attached to content with these tags.



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/supportify_client/api/supportify_api.rb', line 36

def get_categories_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SupportifyApi#get_categories ..."
  end
  
  # resource path
  path = "/categories".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'categories'] = opts[:'categories'] if opts[:'categories']
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'skip'] = opts[:'skip'] if opts[:'skip']
  query_params[:'sort_asc'] = opts[:'sort_asc'] if opts[:'sort_asc']
  query_params[:'sort_by'] = opts[:'sort_by'] if opts[:'sort_by']
  query_params[:'tags'] = opts[:'tags'] if opts[:'tags']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['api_key', 'app_key']
  data, status_code, headers = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<Category>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SupportifyApi#get_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_category_by_id(id, opts = {}) ⇒ Category

Returns a category based on a single ID.



90
91
92
93
# File 'lib/supportify_client/api/supportify_api.rb', line 90

def get_category_by_id(id, opts = {})
  data, status_code, headers = get_category_by_id_with_http_info(id, opts)
  return data
end

#get_category_by_id_with_http_info(id, opts = {}) ⇒ Array<(Category, Fixnum, Hash)>

Returns a category based on a single ID.



100
101
102
103
104
105
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/supportify_client/api/supportify_api.rb', line 100

def get_category_by_id_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SupportifyApi#get_category_by_id ..."
  end
  
  # verify the required parameter 'id' is set
  fail "Missing the required parameter 'id' when calling get_category_by_id" if id.nil?
  
  # resource path
  path = "/categories/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['api_key', 'app_key']
  data, status_code, headers = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Category')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SupportifyApi#get_category_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_faq_by_id(id, opts = {}) ⇒ Faq

Returns a content entry based on a single ID.



307
308
309
310
# File 'lib/supportify_client/api/supportify_api.rb', line 307

def get_faq_by_id(id, opts = {})
  data, status_code, headers = get_faq_by_id_with_http_info(id, opts)
  return data
end

#get_faq_by_id_with_http_info(id, opts = {}) ⇒ Array<(Faq, Fixnum, Hash)>

Returns a content entry based on a single ID.



317
318
319
320
321
322
323
324
325
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
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/supportify_client/api/supportify_api.rb', line 317

def get_faq_by_id_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SupportifyApi#get_faq_by_id ..."
  end
  
  # verify the required parameter 'id' is set
  fail "Missing the required parameter 'id' when calling get_faq_by_id" if id.nil?
  
  # resource path
  path = "/faqs/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['api_key', 'app_key']
  data, status_code, headers = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Faq')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SupportifyApi#get_faq_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_faqs(opts = {}) ⇒ Array<Faq>

Returns all content entries from the application.

Options Hash (opts):

  • :categories (String)

    A string expression of the form \&quot;Category 1 AND (Category 2 OR Category 3)\&quot; that will filter for content with these categories.

  • :limit (Integer)

    The maximum number of entries to return in the collection.

  • :skip (Integer)

    The number of entries to skip over when returning the results.

  • :sort_asc (BOOLEAN)

    A flag to indicate whether or not the results should be sorted in ascending order.

  • :sort_by (String)

    The property by which the results are sorted.

  • :tags (String)

    A string expression of the form \&quot;Tag 1 AND (Tag 2 OR Tag 3)\&quot; that will filter for content with these tags.



156
157
158
159
# File 'lib/supportify_client/api/supportify_api.rb', line 156

def get_faqs(opts = {})
  data, status_code, headers = get_faqs_with_http_info(opts)
  return data
end

#get_faqs_with_http_info(opts = {}) ⇒ Array<(Array<Faq>, Fixnum, Hash)>

Returns all content entries from the application.

Options Hash (opts):

  • :categories (String)

    A string expression of the form \&quot;Category 1 AND (Category 2 OR Category 3)\&quot; that will filter for content with these categories.

  • :limit (Integer)

    The maximum number of entries to return in the collection.

  • :skip (Integer)

    The number of entries to skip over when returning the results.

  • :sort_asc (BOOLEAN)

    A flag to indicate whether or not the results should be sorted in ascending order.

  • :sort_by (String)

    The property by which the results are sorted.

  • :tags (String)

    A string expression of the form \&quot;Tag 1 AND (Tag 2 OR Tag 3)\&quot; that will filter for content with these tags.



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/supportify_client/api/supportify_api.rb', line 171

def get_faqs_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SupportifyApi#get_faqs ..."
  end
  
  # resource path
  path = "/faqs".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'categories'] = opts[:'categories'] if opts[:'categories']
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'skip'] = opts[:'skip'] if opts[:'skip']
  query_params[:'sort_asc'] = opts[:'sort_asc'] if opts[:'sort_asc']
  query_params[:'sort_by'] = opts[:'sort_by'] if opts[:'sort_by']
  query_params[:'tags'] = opts[:'tags'] if opts[:'tags']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['api_key', 'app_key']
  data, status_code, headers = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<Faq>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SupportifyApi#get_faqs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_info(opts = {}) ⇒ Info

The Info endpoint returns an information object containing details of the application being accessed.nnThis endpoint is mostly used for diagnostic purposes.



433
434
435
436
# File 'lib/supportify_client/api/supportify_api.rb', line 433

def get_info(opts = {})
  data, status_code, headers = get_info_with_http_info(opts)
  return data
end

#get_info_with_http_info(opts = {}) ⇒ Array<(Info, Fixnum, Hash)>

The Info endpoint returns an information object containing details of the application being accessed.nnThis endpoint is mostly used for diagnostic purposes.



442
443
444
445
446
447
448
449
450
451
452
453
454
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
480
481
482
483
# File 'lib/supportify_client/api/supportify_api.rb', line 442

def get_info_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SupportifyApi#get_info ..."
  end
  
  # resource path
  path = "/info".sub('{format}','json')

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['api_key', 'app_key']
  data, status_code, headers = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Info')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SupportifyApi#get_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_tag_by_id(id, opts = {}) ⇒ Tag

Returns a tag based on a single ID.



638
639
640
641
# File 'lib/supportify_client/api/supportify_api.rb', line 638

def get_tag_by_id(id, opts = {})
  data, status_code, headers = get_tag_by_id_with_http_info(id, opts)
  return data
end

#get_tag_by_id_with_http_info(id, opts = {}) ⇒ Array<(Tag, Fixnum, Hash)>

Returns a tag based on a single ID.



648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
# File 'lib/supportify_client/api/supportify_api.rb', line 648

def get_tag_by_id_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SupportifyApi#get_tag_by_id ..."
  end
  
  # verify the required parameter 'id' is set
  fail "Missing the required parameter 'id' when calling get_tag_by_id" if id.nil?
  
  # resource path
  path = "/tags/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['api_key', 'app_key']
  data, status_code, headers = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Tag')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SupportifyApi#get_tag_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_tags(opts = {}) ⇒ Array<Tag>

Returns all tags from the application.

Options Hash (opts):

  • :categories (String)

    A string expression of the form \&quot;Category 1 AND (Category 2 OR Category 3)\&quot; that will filter for tags attached to content with these categories.

  • :limit (Integer)

    The maximum number of entries to return in the collection.

  • :skip (Integer)

    The number of entries to skip over when returning the results.

  • :sort_asc (BOOLEAN)

    A flag to indicate whether or not the results should be sorted in ascending order.

  • :sort_by (String)

    The property by which the results are sorted.

  • :tags (String)

    A string expression of the form \&quot;Tag 1 AND (Tag 2 OR Tag 3)\&quot; that will filter for tags attached to content with these tags.



569
570
571
572
# File 'lib/supportify_client/api/supportify_api.rb', line 569

def get_tags(opts = {})
  data, status_code, headers = get_tags_with_http_info(opts)
  return data
end

#get_tags_with_http_info(opts = {}) ⇒ Array<(Array<Tag>, Fixnum, Hash)>

Returns all tags from the application.

Options Hash (opts):

  • :categories (String)

    A string expression of the form \&quot;Category 1 AND (Category 2 OR Category 3)\&quot; that will filter for tags attached to content with these categories.

  • :limit (Integer)

    The maximum number of entries to return in the collection.

  • :skip (Integer)

    The number of entries to skip over when returning the results.

  • :sort_asc (BOOLEAN)

    A flag to indicate whether or not the results should be sorted in ascending order.

  • :sort_by (String)

    The property by which the results are sorted.

  • :tags (String)

    A string expression of the form \&quot;Tag 1 AND (Tag 2 OR Tag 3)\&quot; that will filter for tags attached to content with these tags.



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
621
622
623
624
625
626
627
628
629
630
631
# File 'lib/supportify_client/api/supportify_api.rb', line 584

def get_tags_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SupportifyApi#get_tags ..."
  end
  
  # resource path
  path = "/tags".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'categories'] = opts[:'categories'] if opts[:'categories']
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'skip'] = opts[:'skip'] if opts[:'skip']
  query_params[:'sort_asc'] = opts[:'sort_asc'] if opts[:'sort_asc']
  query_params[:'sort_by'] = opts[:'sort_by'] if opts[:'sort_by']
  query_params[:'tags'] = opts[:'tags'] if opts[:'tags']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['api_key', 'app_key']
  data, status_code, headers = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<Tag>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SupportifyApi#get_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#search(query, opts = {}) ⇒ Array<Faq>

Search for a collection of content entries that match the supplied query.

Options Hash (opts):

  • :categories (String)

    A string expression of the form \&quot;Category 1 AND (Category 2 OR Category 3)\&quot; that will filter for content with these categories.

  • :limit (Integer)

    The maximum number of entries to return in the collection.

  • :skip (Integer)

    The number of entries to skip over when returning the results.

  • :tags (String)

    A string expression of the form \&quot;Tag 1 AND (Tag 2 OR Tag 3)\&quot; that will filter for content with these tags.



494
495
496
497
# File 'lib/supportify_client/api/supportify_api.rb', line 494

def search(query, opts = {})
  data, status_code, headers = search_with_http_info(query, opts)
  return data
end

#search_with_http_info(query, opts = {}) ⇒ Array<(Array<Faq>, Fixnum, Hash)>

Search for a collection of content entries that match the supplied query.

Options Hash (opts):

  • :categories (String)

    A string expression of the form \&quot;Category 1 AND (Category 2 OR Category 3)\&quot; that will filter for content with these categories.

  • :limit (Integer)

    The maximum number of entries to return in the collection.

  • :skip (Integer)

    The number of entries to skip over when returning the results.

  • :tags (String)

    A string expression of the form \&quot;Tag 1 AND (Tag 2 OR Tag 3)\&quot; that will filter for content with these tags.



508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
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
# File 'lib/supportify_client/api/supportify_api.rb', line 508

def search_with_http_info(query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SupportifyApi#search ..."
  end
  
  # verify the required parameter 'query' is set
  fail "Missing the required parameter 'query' when calling search" if query.nil?
  
  # resource path
  path = "/search".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'query'] = query
  query_params[:'categories'] = opts[:'categories'] if opts[:'categories']
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'skip'] = opts[:'skip'] if opts[:'skip']
  query_params[:'tags'] = opts[:'tags'] if opts[:'tags']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  

  auth_names = ['api_key', 'app_key']
  data, status_code, headers = @api_client.call_api(:GET, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Array<Faq>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SupportifyApi#search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#vote_on_faq(id, vote, opts = {}) ⇒ nil

Record a vote for a content entry.



369
370
371
372
# File 'lib/supportify_client/api/supportify_api.rb', line 369

def vote_on_faq(id, vote, opts = {})
  vote_on_faq_with_http_info(id, vote, opts)
  return nil
end

#vote_on_faq_with_http_info(id, vote, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Record a vote for a content entry.



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
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
# File 'lib/supportify_client/api/supportify_api.rb', line 380

def vote_on_faq_with_http_info(id, vote, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SupportifyApi#vote_on_faq ..."
  end
  
  # verify the required parameter 'id' is set
  fail "Missing the required parameter 'id' when calling vote_on_faq" if id.nil?
  
  # verify the required parameter 'vote' is set
  fail "Missing the required parameter 'vote' when calling vote_on_faq" if vote.nil?
  
  # resource path
  path = "/faqs/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}
  form_params["vote"] = vote

  # http body (model)
  post_body = nil
  

  auth_names = ['api_key', 'app_key']
  data, status_code, headers = @api_client.call_api(:POST, path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SupportifyApi#vote_on_faq\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end