freeclimb 4.7.0 → 4.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/Gemfile.lock +21 -21
  4. data/README.md +7 -4
  5. data/docs/CompletionRequest.md +18 -0
  6. data/docs/CompletionResult.md +20 -0
  7. data/docs/DefaultApi.md +76 -0
  8. data/docs/SMSTenDLCCampaign.md +1 -1
  9. data/lib/freeclimb/api/default_api.rb +69 -0
  10. data/lib/freeclimb/models/completion_request.rb +246 -0
  11. data/lib/freeclimb/models/completion_result.rb +274 -0
  12. data/lib/freeclimb/version.rb +1 -1
  13. data/lib/freeclimb.rb +2 -0
  14. data/openapi.json +76 -6
  15. data/package.json +3 -1
  16. data/spec/api/default_api_spec.rb +29 -0
  17. data/spec/models/account_request_spec.rb +2 -1
  18. data/spec/models/account_result_spec.rb +2 -1
  19. data/spec/models/add_to_conference_spec.rb +2 -7
  20. data/spec/models/application_list_spec.rb +2 -1
  21. data/spec/models/application_request_spec.rb +2 -1
  22. data/spec/models/application_result_spec.rb +2 -1
  23. data/spec/models/available_number_list_spec.rb +2 -1
  24. data/spec/models/available_number_spec.rb +2 -3
  25. data/spec/models/buy_incoming_number_request_spec.rb +2 -3
  26. data/spec/models/call_list_spec.rb +2 -1
  27. data/spec/models/call_result_spec.rb +2 -1
  28. data/spec/models/capabilities_spec.rb +2 -16
  29. data/spec/models/completion_request_spec.rb +165 -0
  30. data/spec/models/completion_result_spec.rb +203 -0
  31. data/spec/models/conference_list_spec.rb +2 -1
  32. data/spec/models/conference_participant_list_spec.rb +2 -1
  33. data/spec/models/conference_participant_result_spec.rb +2 -4
  34. data/spec/models/conference_result_spec.rb +2 -2
  35. data/spec/models/create_conference_request_spec.rb +2 -2
  36. data/spec/models/create_conference_spec.rb +2 -5
  37. data/spec/models/create_web_rtc_token_spec.rb +2 -5
  38. data/spec/models/enqueue_spec.rb +2 -7
  39. data/spec/models/filter_logs_request_spec.rb +2 -3
  40. data/spec/models/get_digits_spec.rb +2 -5
  41. data/spec/models/get_speech_spec.rb +2 -7
  42. data/spec/models/hangup_spec.rb +2 -1
  43. data/spec/models/incoming_number_list_spec.rb +2 -1
  44. data/spec/models/incoming_number_request_spec.rb +2 -1
  45. data/spec/models/incoming_number_result_spec.rb +2 -4
  46. data/spec/models/log_list_spec.rb +2 -1
  47. data/spec/models/log_result_spec.rb +2 -1
  48. data/spec/models/make_call_request_spec.rb +2 -6
  49. data/spec/models/message_request_spec.rb +2 -7
  50. data/spec/models/message_result_spec.rb +2 -1
  51. data/spec/models/messages_list_spec.rb +2 -1
  52. data/spec/models/mutable_resource_model_spec.rb +2 -1
  53. data/spec/models/out_dial_spec.rb +2 -10
  54. data/spec/models/pagination_model_spec.rb +2 -1
  55. data/spec/models/park_spec.rb +2 -5
  56. data/spec/models/pause_spec.rb +2 -3
  57. data/spec/models/percl_command_spec.rb +2 -1
  58. data/spec/models/percl_script_spec.rb +2 -1
  59. data/spec/models/play_early_media_spec.rb +2 -3
  60. data/spec/models/play_spec.rb +2 -4
  61. data/spec/models/queue_list_spec.rb +2 -1
  62. data/spec/models/queue_member_list_spec.rb +2 -1
  63. data/spec/models/queue_member_spec.rb +2 -1
  64. data/spec/models/queue_request_spec.rb +2 -1
  65. data/spec/models/queue_result_spec.rb +2 -1
  66. data/spec/models/record_utterance_spec.rb +2 -6
  67. data/spec/models/recording_list_spec.rb +2 -1
  68. data/spec/models/recording_result_spec.rb +2 -1
  69. data/spec/models/redirect_spec.rb +2 -3
  70. data/spec/models/reject_spec.rb +2 -1
  71. data/spec/models/say_spec.rb +2 -4
  72. data/spec/models/send_digits_spec.rb +2 -4
  73. data/spec/models/set_listen_spec.rb +2 -2
  74. data/spec/models/set_talk_spec.rb +2 -2
  75. data/spec/models/sms_spec.rb +2 -7
  76. data/spec/models/sms_ten_dlc_brand_spec.rb +132 -103
  77. data/spec/models/sms_ten_dlc_brands_list_result_spec.rb +2 -1
  78. data/spec/models/sms_ten_dlc_campaign_spec.rb +21 -53
  79. data/spec/models/sms_ten_dlc_campaigns_list_result_spec.rb +2 -1
  80. data/spec/models/sms_ten_dlc_partner_campaign_brand_spec.rb +2 -8
  81. data/spec/models/sms_ten_dlc_partner_campaign_spec.rb +21 -43
  82. data/spec/models/sms_ten_dlc_partner_campaigns_list_result_spec.rb +2 -1
  83. data/spec/models/sms_toll_free_campaign_spec.rb +24 -29
  84. data/spec/models/sms_toll_free_campaigns_list_result_spec.rb +2 -1
  85. data/spec/models/tfn_spec.rb +2 -3
  86. data/spec/models/transcribe_utterance_all_of_record_spec.rb +2 -6
  87. data/spec/models/transcribe_utterance_spec.rb +2 -6
  88. data/spec/models/update_call_request_spec.rb +2 -3
  89. data/spec/models/update_conference_participant_request_spec.rb +2 -3
  90. data/spec/models/update_conference_request_spec.rb +2 -1
  91. data/yarn.lock +27 -8
  92. metadata +89 -81
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad359c65ec1da2cff52f44bab57f5f01fe852e4e9ac09c65fdecf724566349ff
4
- data.tar.gz: dac1dae63f315c7e7ac52c1c7717875b8b5f4227e33d16723992e76189926090
3
+ metadata.gz: 1ad32fa62459bb0e4d1887a289ba7ad5b77aa6fca78d4a1db3bf29881275e130
4
+ data.tar.gz: 89fd14f2c7d3329a56806f29ae46b44a3106e74b5639fd596894851fef36c845
5
5
  SHA512:
6
- metadata.gz: a71b0e3b0eb8b3ed799f69e929ea690509df38780a07ef5db5895e8b713b0a00518732953e595e0f433dabf27dce064d1edab0640775f477d20977c29685c2c2
7
- data.tar.gz: 4cb9c899de0346d5b3427d3760b66ed16e3d937f425ccf8c44ee7b0cf05577435bc8942f5af80769ea729c3f0de5f3c0eca6747c9b61fe55e9800ea0e6f364bb
6
+ metadata.gz: 15225dd8b0ed975eea0e66b92e55b25891d6792b1bbc163ad64264cfba758239343cf809801276e95dd32c48aa05b11069aff28cb94a39963867d6585c894402
7
+ data.tar.gz: df9ca5026bf77fc5b681158ca5d87255047f54a147d2af040a630a0c8a8a17fa210e614b92e3c4f3e26aecf27ebc650bdee4dbaa6e17d3807faabff4df66a3b3
data/CHANGELOG.md CHANGED
@@ -9,6 +9,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
9
9
 
10
10
  None
11
11
 
12
+ <a name="4.8.0"></a>
13
+
14
+ ## [4.8.0] - 2024-10-08
15
+
16
+ ### Added
17
+
18
+ - Add KnowledgeBase API to SDK
19
+
12
20
  <a name="4.7.0"></a>
13
21
 
14
22
  ## [4.7.0] - 2024-09-12
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- freeclimb (4.7.0)
4
+ freeclimb (4.8.0)
5
5
  typhoeus (~> 1.0, >= 1.0.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (7.1.3.2)
10
+ activesupport (7.1.4.1)
11
11
  base64
12
12
  bigdecimal
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -17,14 +17,14 @@ GEM
17
17
  minitest (>= 5.1)
18
18
  mutex_m
19
19
  tzinfo (~> 2.0)
20
- addressable (2.8.6)
21
- public_suffix (>= 2.0.2, < 6.0)
20
+ addressable (2.8.7)
21
+ public_suffix (>= 2.0.2, < 7.0)
22
22
  ast (2.4.2)
23
23
  base64 (0.2.0)
24
- bigdecimal (3.1.7)
24
+ bigdecimal (3.1.8)
25
25
  byebug (11.1.3)
26
26
  coderay (1.1.3)
27
- concurrent-ruby (1.2.3)
27
+ concurrent-ruby (1.3.4)
28
28
  connection_pool (2.4.1)
29
29
  crack (1.0.0)
30
30
  bigdecimal
@@ -34,18 +34,18 @@ GEM
34
34
  ethon (0.16.0)
35
35
  ffi (>= 1.15.0)
36
36
  facets (3.1.0)
37
- factory_bot (6.4.6)
37
+ factory_bot (6.5.0)
38
38
  activesupport (>= 5.0.0)
39
39
  ffi (1.17.0)
40
- hashdiff (1.1.0)
41
- i18n (1.14.4)
40
+ hashdiff (1.1.1)
41
+ i18n (1.14.6)
42
42
  concurrent-ruby (~> 1.0)
43
43
  jaro_winkler (1.5.6)
44
- method_source (1.0.0)
45
- minitest (5.22.3)
44
+ method_source (1.1.0)
45
+ minitest (5.25.1)
46
46
  mutex_m (0.2.0)
47
- parallel (1.24.0)
48
- parser (3.3.0.5)
47
+ parallel (1.26.3)
48
+ parser (3.3.5.0)
49
49
  ast (~> 2.4.1)
50
50
  racc
51
51
  pry (0.14.2)
@@ -56,21 +56,21 @@ GEM
56
56
  pry (>= 0.13, < 0.15)
57
57
  psych (5.1.2)
58
58
  stringio
59
- public_suffix (5.0.5)
60
- racc (1.7.3)
59
+ public_suffix (6.0.1)
60
+ racc (1.8.1)
61
61
  rainbow (3.1.1)
62
62
  rake (13.0.6)
63
- rexml (3.2.6)
63
+ rexml (3.3.8)
64
64
  rspec (3.13.0)
65
65
  rspec-core (~> 3.13.0)
66
66
  rspec-expectations (~> 3.13.0)
67
67
  rspec-mocks (~> 3.13.0)
68
- rspec-core (3.13.0)
68
+ rspec-core (3.13.1)
69
69
  rspec-support (~> 3.13.0)
70
- rspec-expectations (3.13.0)
70
+ rspec-expectations (3.13.3)
71
71
  diff-lcs (>= 1.2.0, < 2.0)
72
72
  rspec-support (~> 3.13.0)
73
- rspec-mocks (3.13.0)
73
+ rspec-mocks (3.13.2)
74
74
  diff-lcs (>= 1.2.0, < 2.0)
75
75
  rspec-support (~> 3.13.0)
76
76
  rspec-support (3.13.1)
@@ -83,13 +83,13 @@ GEM
83
83
  ruby-progressbar (~> 1.7)
84
84
  unicode-display_width (>= 1.4.0, < 1.6)
85
85
  ruby-progressbar (1.13.0)
86
- stringio (3.1.0)
86
+ stringio (3.1.1)
87
87
  typhoeus (1.4.1)
88
88
  ethon (>= 0.9.0)
89
89
  tzinfo (2.0.6)
90
90
  concurrent-ruby (~> 1.0)
91
91
  unicode-display_width (1.5.0)
92
- webmock (3.23.0)
92
+ webmock (3.24.0)
93
93
  addressable (>= 2.8.0)
94
94
  crack (>= 0.3.2)
95
95
  hashdiff (>= 0.4.0, < 2.0.0)
data/README.md CHANGED
@@ -7,7 +7,7 @@ FreeClimb is a cloud-based application programming interface (API) that puts the
7
7
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
8
 
9
9
  - API version: 1.0.0
10
- - Package version: 4.7.0
10
+ - Package version: 4.8.0
11
11
  - Build package: org.openapitools.codegen.languages.RubyClientCodegen
12
12
  For more information, please visit [https://www.freeclimb.com/support/](https://www.freeclimb.com/support/)
13
13
 
@@ -15,7 +15,7 @@ For more information, please visit [https://www.freeclimb.com/support/](https://
15
15
 
16
16
  Add this to the Gemfile:
17
17
 
18
- gem 'freeclimb', '~> 4.7.0'
18
+ gem 'freeclimb', '~> 4.8.0'
19
19
 
20
20
  and run from your terminal
21
21
 
@@ -44,9 +44,9 @@ gem build freeclimb.gemspec
44
44
  Then either install the gem locally:
45
45
 
46
46
  ```shell
47
- gem install ./freeclimb-4.7.0.gem
47
+ gem install ./freeclimb-4.8.0.gem
48
48
  ```
49
- (for development, run `gem install --dev ./freeclimb-4.7.0.gem` to install the development dependencies)
49
+ (for development, run `gem install --dev ./freeclimb-4.8.0.gem` to install the development dependencies)
50
50
 
51
51
  ## Getting Started
52
52
 
@@ -103,6 +103,7 @@ Class | Method | HTTP request | Description
103
103
  *Freeclimb::DefaultApi* | [**create_a_conference**](docs/DefaultApi.md#create_a_conference) | **POST** /Accounts/{accountId}/Conferences | Create a Conference
104
104
  *Freeclimb::DefaultApi* | [**create_a_queue**](docs/DefaultApi.md#create_a_queue) | **POST** /Accounts/{accountId}/Queues | Create a Queue
105
105
  *Freeclimb::DefaultApi* | [**create_an_application**](docs/DefaultApi.md#create_an_application) | **POST** /Accounts/{accountId}/Applications | Create an application
106
+ *Freeclimb::DefaultApi* | [**create_knowledge_base_completion**](docs/DefaultApi.md#create_knowledge_base_completion) | **POST** /Accounts/{accountId}/KnowledgeBases/{knowledgeBaseId}/Completion | Query the knowledge base
106
107
  *Freeclimb::DefaultApi* | [**delete_a_recording**](docs/DefaultApi.md#delete_a_recording) | **DELETE** /Accounts/{accountId}/Recordings/{recordingId} | Delete a Recording
107
108
  *Freeclimb::DefaultApi* | [**delete_an_application**](docs/DefaultApi.md#delete_an_application) | **DELETE** /Accounts/{accountId}/Applications/{applicationId} | Delete an application
108
109
  *Freeclimb::DefaultApi* | [**delete_an_incoming_number**](docs/DefaultApi.md#delete_an_incoming_number) | **DELETE** /Accounts/{accountId}/IncomingPhoneNumbers/{phoneNumberId} | Delete an Incoming Number
@@ -183,6 +184,8 @@ Class | Method | HTTP request | Description
183
184
  - [Freeclimb::CallResultAllOf](docs/CallResultAllOf.md)
184
185
  - [Freeclimb::CallStatus](docs/CallStatus.md)
185
186
  - [Freeclimb::Capabilities](docs/Capabilities.md)
187
+ - [Freeclimb::CompletionRequest](docs/CompletionRequest.md)
188
+ - [Freeclimb::CompletionResult](docs/CompletionResult.md)
186
189
  - [Freeclimb::ConferenceList](docs/ConferenceList.md)
187
190
  - [Freeclimb::ConferenceListAllOf](docs/ConferenceListAllOf.md)
188
191
  - [Freeclimb::ConferenceParticipantList](docs/ConferenceParticipantList.md)
@@ -0,0 +1,18 @@
1
+ # Freeclimb::CompletionRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **query** | **String** | Question to ask the Knowledge Base | |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'freeclimb'
13
+
14
+ instance = Freeclimb::CompletionRequest.new(
15
+ query: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,20 @@
1
+ # Freeclimb::CompletionResult
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **response** | **String** | The generative response from the KnowledgeBase | |
8
+ | **status** | **String** | Completion result status. Possible values: success, no_context | |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'freeclimb'
14
+
15
+ instance = Freeclimb::CompletionResult.new(
16
+ response: null,
17
+ status: null
18
+ )
19
+ ```
20
+
data/docs/DefaultApi.md CHANGED
@@ -12,6 +12,8 @@ All URIs are relative to *https://www.freeclimb.com/apiserver*
12
12
  | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource |
13
13
  | [**create_an_application**](DefaultApi.md#create_an_application) | **POST** /Accounts/{accountId}/Applications | Create an application |
14
14
  | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource |
15
+ | [**create_knowledge_base_completion**](DefaultApi.md#create_knowledge_base_completion) | **POST** /Accounts/{accountId}/KnowledgeBases/{knowledgeBaseId}/Completion | Query the knowledge base |
16
+ | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource |
15
17
  | [**delete_a_recording**](DefaultApi.md#delete_a_recording) | **DELETE** /Accounts/{accountId}/Recordings/{recordingId} | Delete a Recording |
16
18
  | [**get_next_page**](DefaultApi.md#get_next_page) | **GET** | Get next page of paginated resource |
17
19
  | [**delete_an_application**](DefaultApi.md#delete_an_application) | **DELETE** /Accounts/{accountId}/Applications/{applicationId} | Delete an application |
@@ -401,6 +403,80 @@ end
401
403
  - **Accept**: application/json
402
404
 
403
405
 
406
+ ## create_knowledge_base_completion
407
+
408
+ Query the knowledge base
409
+
410
+ ### Examples
411
+
412
+ ```ruby
413
+ require 'time'
414
+ require 'freeclimb'
415
+ # setup authorization
416
+ Freeclimb.configure do |config|
417
+ # Configure HTTP basic authorization: fc
418
+ config.username = 'ACCOUNT_ID'
419
+ config.password = 'API_KEY'
420
+ end
421
+
422
+ api_instance = Freeclimb::DefaultApi.new
423
+
424
+ knowledge_base_id = 'knowledge_base_id_example' # String | A string that uniquely identifies the KnowledgeBase resource.
425
+
426
+ opts = {
427
+ completion_request: Freeclimb::CompletionRequest.new({query: 'query_example'}) # CompletionRequest | Completion request details
428
+ }
429
+
430
+ begin
431
+
432
+ # Query the knowledge base
433
+ result = api_instance.create_knowledge_base_completion(knowledge_base_id, opts)
434
+ p result
435
+ rescue Freeclimb::ApiError => e
436
+ puts "Error when calling DefaultApi->create_knowledge_base_completion: #{e}"
437
+ end
438
+ ```
439
+
440
+ #### Using the create_knowledge_base_completion_with_http_info variant
441
+
442
+ This returns an Array which contains the response data, status code and headers.
443
+
444
+ > <Array(<CompletionResult>, Integer, Hash)> create_knowledge_base_completion_with_http_info(account_id, knowledge_base_id, opts)
445
+
446
+ ```ruby
447
+ begin
448
+ # Query the knowledge base
449
+ data, status_code, headers = api_instance.create_knowledge_base_completion_with_http_info(knowledge_base_id, opts)
450
+ p status_code # => 2xx
451
+ p headers # => { ... }
452
+ p data # => <CompletionResult>
453
+ rescue Freeclimb::ApiError => e
454
+ puts "Error when calling DefaultApi->create_knowledge_base_completion_with_http_info: #{e}"
455
+ end
456
+ ```
457
+
458
+ ### Parameters
459
+
460
+ | Name | Type | Description | Notes |
461
+ | ---- | ---- | ----------- | ----- |
462
+ | **knowledge_base_id** | **String** | A string that uniquely identifies the KnowledgeBase resource. | |
463
+ | **completion_request** | [**CompletionRequest**](CompletionRequest.md) | Completion request details | [optional] |
464
+
465
+
466
+ ### Return type
467
+
468
+ [**CompletionResult**](CompletionResult.md)
469
+
470
+ ### Authorization
471
+
472
+ [fc](../README.md#fc)
473
+
474
+ ### HTTP request headers
475
+
476
+ - **Content-Type**: application/json
477
+ - **Accept**: application/json
478
+
479
+
404
480
  ## delete_a_recording
405
481
 
406
482
  Delete a Recording
@@ -82,7 +82,7 @@ instance = Freeclimb::SMSTenDLCCampaign.new(
82
82
  optout_message: null,
83
83
  reference_id: null,
84
84
  mock: null,
85
- next_renewal_or_expiration_date: Fri Dec 31 18:00:00 CST 1999
85
+ next_renewal_or_expiration_date: Fri Dec 31 19:00:00 EST 1999
86
86
  )
87
87
  ```
88
88
 
@@ -277,6 +277,75 @@ module Freeclimb
277
277
  return data, status_code, headers
278
278
  end
279
279
 
280
+ # Query the knowledge base
281
+ # @param knowledge_base_id [String] A string that uniquely identifies the KnowledgeBase resource.
282
+ # @param [Hash] opts the optional parameters
283
+ # @option opts [CompletionRequest] :completion_request Completion request details
284
+ # @return [CompletionResult]
285
+ def create_knowledge_base_completion(knowledge_base_id, opts = {})
286
+ data, _status_code, _headers = create_knowledge_base_completion_with_http_info(knowledge_base_id, opts)
287
+ data
288
+ end
289
+
290
+ # Query the knowledge base
291
+ # @param knowledge_base_id [String] A string that uniquely identifies the KnowledgeBase resource.
292
+ # @param [Hash] opts the optional parameters
293
+ # @option opts [CompletionRequest] :completion_request Completion request details
294
+ # @return [Array<(CompletionResult, Integer, Hash)>] CompletionResult data, response status code and response headers
295
+ def create_knowledge_base_completion_with_http_info(knowledge_base_id, opts = {})
296
+ if @api_client.config.debugging
297
+ @api_client.config.logger.debug 'Calling API: DefaultApi.create_knowledge_base_completion ...'
298
+ end
299
+
300
+ # verify the required parameter 'knowledge_base_id' is set
301
+ if @api_client.config.client_side_validation && knowledge_base_id.nil?
302
+ fail ArgumentError, "Missing the required parameter 'knowledge_base_id' when calling DefaultApi.create_knowledge_base_completion"
303
+ end
304
+ # resource path
305
+ local_var_path = '/Accounts/{accountId}/KnowledgeBases/{knowledgeBaseId}/Completion'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'knowledgeBaseId' + '}', CGI.escape(knowledge_base_id.to_s))
306
+
307
+ # query parameters
308
+ query_params = opts[:query_params] || {}
309
+
310
+ # header parameters
311
+ header_params = opts[:header_params] || {}
312
+ # HTTP header 'Accept' (if needed)
313
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
314
+ # HTTP header 'Content-Type'
315
+ content_type = @api_client.select_header_content_type(['application/json'])
316
+ if !content_type.nil?
317
+ header_params['Content-Type'] = content_type
318
+ end
319
+
320
+ # form parameters
321
+ form_params = opts[:form_params] || {}
322
+
323
+ # http body (model)
324
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'completion_request'])
325
+
326
+ # return_type
327
+ return_type = opts[:debug_return_type] || 'CompletionResult'
328
+
329
+ # auth_names
330
+ auth_names = opts[:debug_auth_names] || ['fc']
331
+
332
+ new_options = opts.merge(
333
+ :operation => :"DefaultApi.create_knowledge_base_completion",
334
+ :header_params => header_params,
335
+ :query_params => query_params,
336
+ :form_params => form_params,
337
+ :body => post_body,
338
+ :auth_names => auth_names,
339
+ :return_type => return_type
340
+ )
341
+
342
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
343
+ if @api_client.config.debugging
344
+ @api_client.config.logger.debug "API called: DefaultApi#create_knowledge_base_completion\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
345
+ end
346
+ return data, status_code, headers
347
+ end
348
+
280
349
  # Delete a Recording
281
350
  # @param recording_id [String] String that uniquely identifies this recording resource.
282
351
  # @param [Hash] opts the optional parameters
@@ -0,0 +1,246 @@
1
+ =begin
2
+ #FreeClimb API
3
+
4
+ #FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@freeclimb.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Freeclimb
17
+ class CompletionRequest
18
+ # Question to ask the Knowledge Base
19
+ attr_accessor :query
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'query' => :'query'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'query' => :'String'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::CompletionRequest` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::CompletionRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'query')
62
+ self.query = attributes[:'query']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ if @query.nil?
71
+ invalid_properties.push('invalid value for "query", query cannot be nil.')
72
+ end
73
+
74
+ if @query.to_s.length > 2000
75
+ invalid_properties.push('invalid value for "query", the character length must be smaller than or equal to 2000.')
76
+ end
77
+
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+
85
+ if @query.nil?
86
+ false
87
+ else
88
+ list_invalid_properties.length() == 0
89
+ end
90
+ end
91
+
92
+ # Custom attribute writer method with validation
93
+ # @param [Object] query Value to be assigned
94
+ def query=(query)
95
+ if query.nil?
96
+ fail ArgumentError, 'query cannot be nil'
97
+ end
98
+
99
+ if query.to_s.length > 2000
100
+ fail ArgumentError, 'invalid value for "query", the character length must be smaller than or equal to 2000.'
101
+ end
102
+
103
+ @query = query
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ query == o.query
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [query].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ new.build_from_hash(attributes)
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.openapi_types.each_pair do |key, type|
139
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
140
+ self.send("#{key}=", nil)
141
+ elsif type =~ /\AArray<(.*)>/i
142
+ # check to ensure the input is an array given that the attribute
143
+ # is documented as an array but the input is not
144
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
145
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
146
+ end
147
+ elsif !attributes[self.class.attribute_map[key]].nil?
148
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
149
+ end
150
+ end
151
+
152
+ self
153
+ end
154
+
155
+ # Deserializes the data based on type
156
+ # @param string type Data type
157
+ # @param string value Value to be deserialized
158
+ # @return [Object] Deserialized data
159
+ def _deserialize(type, value)
160
+ case type.to_sym
161
+ when :Time
162
+ Time.parse(value)
163
+ when :Date
164
+ Date.parse(value)
165
+ when :String
166
+ value.to_s
167
+ when :Integer
168
+ value.to_i
169
+ when :Float
170
+ value.to_f
171
+ when :Boolean
172
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
173
+ true
174
+ else
175
+ false
176
+ end
177
+ when :Object
178
+ # generic object (usually a Hash), return directly
179
+ value
180
+ when /\AArray<(?<inner_type>.+)>\z/
181
+ inner_type = Regexp.last_match[:inner_type]
182
+ value.map { |v| _deserialize(inner_type, v) }
183
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
184
+ k_type = Regexp.last_match[:k_type]
185
+ v_type = Regexp.last_match[:v_type]
186
+ {}.tap do |hash|
187
+ value.each do |k, v|
188
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
189
+ end
190
+ end
191
+ else # model
192
+ # models (e.g. Pet) or oneOf
193
+ klass = Freeclimb.const_get(type)
194
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
195
+ end
196
+ end
197
+
198
+ # Returns the string representation of the object
199
+ # @return [String] String presentation of the object
200
+ def to_s
201
+ to_hash.to_s
202
+ end
203
+
204
+ # to_body is an alias to to_hash (backward compatibility)
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_body
207
+ to_hash
208
+ end
209
+
210
+ # Returns the object in the form of hash
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_hash
213
+ hash = {}
214
+ self.class.attribute_map.each_pair do |attr, param|
215
+ value = self.send(attr)
216
+ if value.nil?
217
+ is_nullable = self.class.openapi_nullable.include?(attr)
218
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
219
+ end
220
+
221
+ hash[param] = _to_hash(value)
222
+ end
223
+ hash
224
+ end
225
+
226
+ # Outputs non-array value in the form of hash
227
+ # For object, use to_hash. Otherwise, just return the value
228
+ # @param [Object] value Any valid value
229
+ # @return [Hash] Returns the value in the form of hash
230
+ def _to_hash(value)
231
+ if value.is_a?(Array)
232
+ value.compact.map { |v| _to_hash(v) }
233
+ elsif value.is_a?(Hash)
234
+ {}.tap do |hash|
235
+ value.each { |k, v| hash[k] = _to_hash(v) }
236
+ end
237
+ elsif value.respond_to? :to_hash
238
+ value.to_hash
239
+ else
240
+ value
241
+ end
242
+ end
243
+
244
+ end
245
+
246
+ end