ragie_ruby_sdk 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -4
  3. data/docs/AgentHoppsModelsModelsUsage.md +18 -0
  4. data/docs/Answer.md +20 -0
  5. data/docs/AnswerStep.md +26 -0
  6. data/docs/CodeInterpreterEvidence.md +26 -0
  7. data/docs/CodeStep.md +28 -0
  8. data/docs/EvaluatedAnswerStep.md +30 -0
  9. data/docs/FinalAnswer.md +24 -0
  10. data/docs/FinalAnswerEvidenceInner.md +40 -0
  11. data/docs/FinalAnswerStepsInner.md +42 -0
  12. data/docs/InputTokenDetails.md +18 -0
  13. data/docs/IntercomData.md +3 -1
  14. data/docs/ModelUsage.md +22 -0
  15. data/docs/OutputTokenDetails.md +18 -0
  16. data/docs/PlanStep.md +24 -0
  17. data/docs/RagieApiSchemaResponseUsage.md +26 -0
  18. data/docs/RagieEvidence.md +34 -0
  19. data/docs/Reasoning.md +20 -0
  20. data/docs/Request.md +28 -0
  21. data/docs/Response.md +62 -0
  22. data/docs/ResponseContent.md +22 -0
  23. data/docs/ResponseOutput.md +24 -0
  24. data/docs/ResponsesApi.md +147 -0
  25. data/docs/Search.md +18 -0
  26. data/docs/SearchResultLink.md +20 -0
  27. data/docs/SearchStep.md +24 -0
  28. data/docs/SurrenderStep.md +24 -0
  29. data/docs/Tool.md +20 -0
  30. data/lib/ragie_ruby_sdk/api/responses_api.rb +153 -0
  31. data/lib/ragie_ruby_sdk/models/agent_hopps_models_models_usage.rb +222 -0
  32. data/lib/ragie_ruby_sdk/models/answer.rb +265 -0
  33. data/lib/ragie_ruby_sdk/models/answer_step.rb +346 -0
  34. data/lib/ragie_ruby_sdk/models/code_interpreter_evidence.rb +360 -0
  35. data/lib/ragie_ruby_sdk/models/code_step.rb +359 -0
  36. data/lib/ragie_ruby_sdk/models/evaluated_answer_step.rb +398 -0
  37. data/lib/ragie_ruby_sdk/models/final_answer.rb +319 -0
  38. data/lib/ragie_ruby_sdk/models/final_answer_evidence_inner.rb +103 -0
  39. data/lib/ragie_ruby_sdk/models/final_answer_steps_inner.rb +107 -0
  40. data/lib/ragie_ruby_sdk/models/input_token_details.rb +222 -0
  41. data/lib/ragie_ruby_sdk/models/intercom_data.rb +14 -4
  42. data/lib/ragie_ruby_sdk/models/model_usage.rb +289 -0
  43. data/lib/ragie_ruby_sdk/models/output_token_details.rb +222 -0
  44. data/lib/ragie_ruby_sdk/models/plan_step.rb +336 -0
  45. data/lib/ragie_ruby_sdk/models/ragie_api_schema_response_usage.rb +307 -0
  46. data/lib/ragie_ruby_sdk/models/ragie_evidence.rb +419 -0
  47. data/lib/ragie_ruby_sdk/models/reasoning.rb +271 -0
  48. data/lib/ragie_ruby_sdk/models/request.rb +328 -0
  49. data/lib/ragie_ruby_sdk/models/response.rb +638 -0
  50. data/lib/ragie_ruby_sdk/models/response_content.rb +293 -0
  51. data/lib/ragie_ruby_sdk/models/response_output.rb +333 -0
  52. data/lib/ragie_ruby_sdk/models/search.rb +239 -0
  53. data/lib/ragie_ruby_sdk/models/search_result_link.rb +263 -0
  54. data/lib/ragie_ruby_sdk/models/search_step.rb +334 -0
  55. data/lib/ragie_ruby_sdk/models/surrender_step.rb +334 -0
  56. data/lib/ragie_ruby_sdk/models/tool.rb +289 -0
  57. data/lib/ragie_ruby_sdk/version.rb +1 -1
  58. data/lib/ragie_ruby_sdk.rb +26 -0
  59. data/spec/api/responses_api_spec.rb +59 -0
  60. data/spec/models/access_token_credentials_spec.rb +1 -1
  61. data/spec/models/agent_hopps_models_models_usage_spec.rb +36 -0
  62. data/spec/models/answer_spec.rb +42 -0
  63. data/spec/models/answer_step_spec.rb +64 -0
  64. data/spec/models/async_document_metadata_update_spec.rb +1 -1
  65. data/spec/models/audio_modality_data_spec.rb +1 -1
  66. data/spec/models/authenticator_confluence_connection_spec.rb +1 -1
  67. data/spec/models/authenticator_dropbox_connection_spec.rb +1 -1
  68. data/spec/models/authenticator_gmail_connection_spec.rb +1 -1
  69. data/spec/models/authenticator_google_drive_connection_spec.rb +1 -1
  70. data/spec/models/authenticator_hubspot_connection_spec.rb +1 -1
  71. data/spec/models/authenticator_jira_connection_spec.rb +1 -1
  72. data/spec/models/authenticator_list_spec.rb +1 -1
  73. data/spec/models/authenticator_notion_connection_spec.rb +1 -1
  74. data/spec/models/authenticator_onedrive_connection_spec.rb +1 -1
  75. data/spec/models/authenticator_salesforce_connection_spec.rb +1 -1
  76. data/spec/models/authenticator_sharepoint_connection_spec.rb +1 -1
  77. data/spec/models/authenticator_slack_connection_spec.rb +1 -1
  78. data/spec/models/backblaze_credentials_spec.rb +1 -1
  79. data/spec/models/base_get_authenticator_spec.rb +1 -1
  80. data/spec/models/body_create_document_spec.rb +1 -1
  81. data/spec/models/body_update_document_file_spec.rb +1 -1
  82. data/spec/models/bucket_data_spec.rb +1 -1
  83. data/spec/models/code_interpreter_evidence_spec.rb +64 -0
  84. data/spec/models/code_step_spec.rb +70 -0
  85. data/spec/models/confluence_data_spec.rb +1 -1
  86. data/spec/models/connection_base_spec.rb +1 -1
  87. data/spec/models/connection_limit_exceeded_webhook_payload_spec.rb +1 -1
  88. data/spec/models/connection_limit_exceeded_webhook_spec.rb +1 -1
  89. data/spec/models/connection_limit_params_spec.rb +1 -1
  90. data/spec/models/connection_list_spec.rb +1 -1
  91. data/spec/models/connection_spec.rb +1 -1
  92. data/spec/models/connection_stats_spec.rb +1 -1
  93. data/spec/models/connection_sync_finished_webhook_payload_spec.rb +1 -1
  94. data/spec/models/connection_sync_finished_webhook_spec.rb +1 -1
  95. data/spec/models/connection_sync_progress_webhook_payload_spec.rb +1 -1
  96. data/spec/models/connection_sync_progress_webhook_spec.rb +1 -1
  97. data/spec/models/connection_sync_started_webhook_payload_spec.rb +1 -1
  98. data/spec/models/connection_sync_started_webhook_spec.rb +1 -1
  99. data/spec/models/connector_source_spec.rb +1 -1
  100. data/spec/models/connector_source_type_info_spec.rb +1 -1
  101. data/spec/models/create_authenticator_connection_spec.rb +1 -1
  102. data/spec/models/create_document_from_url_params_spec.rb +1 -1
  103. data/spec/models/create_document_raw_params_spec.rb +1 -1
  104. data/spec/models/create_google_authenticator_spec.rb +1 -1
  105. data/spec/models/create_instruction_params_spec.rb +1 -1
  106. data/spec/models/create_partition_params_spec.rb +1 -1
  107. data/spec/models/delete_connection_payload_spec.rb +1 -1
  108. data/spec/models/document_chunk_detail_spec.rb +1 -1
  109. data/spec/models/document_chunk_list_spec.rb +1 -1
  110. data/spec/models/document_chunk_spec.rb +1 -1
  111. data/spec/models/document_delete_spec.rb +1 -1
  112. data/spec/models/document_delete_webhook_payload_spec.rb +1 -1
  113. data/spec/models/document_delete_webhook_spec.rb +1 -1
  114. data/spec/models/document_file_update_spec.rb +1 -1
  115. data/spec/models/document_get_spec.rb +1 -1
  116. data/spec/models/document_list_spec.rb +1 -1
  117. data/spec/models/document_metadata_update_spec.rb +1 -1
  118. data/spec/models/document_raw_update_spec.rb +1 -1
  119. data/spec/models/document_spec.rb +1 -1
  120. data/spec/models/document_summary_spec.rb +1 -1
  121. data/spec/models/document_update_webhook_payload_spec.rb +1 -1
  122. data/spec/models/document_update_webhook_spec.rb +1 -1
  123. data/spec/models/document_url_update_spec.rb +1 -1
  124. data/spec/models/document_with_content_spec.rb +1 -1
  125. data/spec/models/entity_extracted_webhook_payload_spec.rb +1 -1
  126. data/spec/models/entity_extracted_webhook_spec.rb +1 -1
  127. data/spec/models/entity_list_spec.rb +1 -1
  128. data/spec/models/entity_spec.rb +1 -1
  129. data/spec/models/error_message_spec.rb +1 -1
  130. data/spec/models/evaluated_answer_step_spec.rb +76 -0
  131. data/spec/models/final_answer_evidence_inner_spec.rb +21 -0
  132. data/spec/models/final_answer_spec.rb +54 -0
  133. data/spec/models/final_answer_steps_inner_spec.rb +21 -0
  134. data/spec/models/folder_data_spec.rb +1 -1
  135. data/spec/models/freshdesk_credentials_spec.rb +1 -1
  136. data/spec/models/freshdesk_data_spec.rb +1 -1
  137. data/spec/models/gmail_data_spec.rb +1 -1
  138. data/spec/models/google_folder_data_spec.rb +1 -1
  139. data/spec/models/http_validation_error_spec.rb +1 -1
  140. data/spec/models/hubspot_data_spec.rb +1 -1
  141. data/spec/models/input_token_details_spec.rb +36 -0
  142. data/spec/models/instruction_spec.rb +1 -1
  143. data/spec/models/intercom_credentials_spec.rb +1 -1
  144. data/spec/models/intercom_data_spec.rb +7 -1
  145. data/spec/models/link_spec.rb +1 -1
  146. data/spec/models/list_connector_source_type_info_spec.rb +1 -1
  147. data/spec/models/media_mode_param_spec.rb +1 -1
  148. data/spec/models/mode2_one_of_spec.rb +1 -1
  149. data/spec/models/model_usage_spec.rb +48 -0
  150. data/spec/models/o_auth_credentials_spec.rb +1 -1
  151. data/spec/models/o_auth_refresh_token_credentials_spec.rb +1 -1
  152. data/spec/models/o_auth_url_create_spec.rb +1 -1
  153. data/spec/models/o_auth_url_response_spec.rb +1 -1
  154. data/spec/models/onedrive_data_spec.rb +1 -1
  155. data/spec/models/output_token_details_spec.rb +36 -0
  156. data/spec/models/pagination_spec.rb +1 -1
  157. data/spec/models/partition_detail_spec.rb +1 -1
  158. data/spec/models/partition_limit_exceeded_webhook_payload_spec.rb +1 -1
  159. data/spec/models/partition_limit_exceeded_webhook_spec.rb +1 -1
  160. data/spec/models/partition_limit_params_spec.rb +1 -1
  161. data/spec/models/partition_limit_reset_webhook_payload_spec.rb +1 -1
  162. data/spec/models/partition_limit_reset_webhook_spec.rb +1 -1
  163. data/spec/models/partition_limits_spec.rb +1 -1
  164. data/spec/models/partition_list_spec.rb +1 -1
  165. data/spec/models/partition_spec.rb +1 -1
  166. data/spec/models/partition_stats_spec.rb +1 -1
  167. data/spec/models/patch_document_metadata_params_spec.rb +1 -1
  168. data/spec/models/plan_step_spec.rb +58 -0
  169. data/spec/models/public_backblaze_connection_spec.rb +1 -1
  170. data/spec/models/public_create_connection_spec.rb +1 -1
  171. data/spec/models/public_freshdesk_connection_spec.rb +1 -1
  172. data/spec/models/public_gcs_connection_spec.rb +1 -1
  173. data/spec/models/public_intercom_connection_spec.rb +1 -1
  174. data/spec/models/public_s3_compatible_connection_spec.rb +1 -1
  175. data/spec/models/public_zendesk_connection_spec.rb +1 -1
  176. data/spec/models/ragie_api_schema_response_usage_spec.rb +60 -0
  177. data/spec/models/ragie_evidence_spec.rb +88 -0
  178. data/spec/models/reasoning_spec.rb +46 -0
  179. data/spec/models/request_spec.rb +70 -0
  180. data/spec/models/response_content_spec.rb +52 -0
  181. data/spec/models/response_ok_spec.rb +1 -1
  182. data/spec/models/response_output_spec.rb +62 -0
  183. data/spec/models/response_spec.rb +188 -0
  184. data/spec/models/retrieval_spec.rb +1 -1
  185. data/spec/models/retrieve_params_spec.rb +1 -1
  186. data/spec/models/s3_compatible_credentials_spec.rb +1 -1
  187. data/spec/models/scored_chunk_spec.rb +1 -1
  188. data/spec/models/search_result_link_spec.rb +42 -0
  189. data/spec/models/search_spec.rb +36 -0
  190. data/spec/models/search_step_spec.rb +58 -0
  191. data/spec/models/set_connection_enabled_payload_spec.rb +1 -1
  192. data/spec/models/sharepoint_data_spec.rb +1 -1
  193. data/spec/models/sharepoint_file_data_spec.rb +1 -1
  194. data/spec/models/sharepoint_site_data_spec.rb +1 -1
  195. data/spec/models/slack_data_spec.rb +1 -1
  196. data/spec/models/surrender_step_spec.rb +58 -0
  197. data/spec/models/tool_spec.rb +46 -0
  198. data/spec/models/update_document_from_url_params_spec.rb +1 -1
  199. data/spec/models/update_document_raw_params_spec.rb +1 -1
  200. data/spec/models/update_instruction_params_spec.rb +1 -1
  201. data/spec/models/validation_error_spec.rb +1 -1
  202. data/spec/models/video_modality_data_spec.rb +1 -1
  203. data/spec/models/word_timestamp_spec.rb +1 -1
  204. data/spec/models/zendesk_credentials_spec.rb +1 -1
  205. data/spec/models/zendesk_data_spec.rb +1 -1
  206. metadata +105 -1
@@ -0,0 +1,419 @@
1
+ =begin
2
+ #Ragie API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.16.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module RagieRubySdk
17
+ class RagieEvidence
18
+ attr_accessor :type
19
+
20
+ attr_accessor :text
21
+
22
+ attr_accessor :id
23
+
24
+ attr_accessor :index
25
+
26
+ attr_accessor :document_id
27
+
28
+ attr_accessor :document_name
29
+
30
+ attr_accessor :metadata
31
+
32
+ attr_accessor :document_metadata
33
+
34
+ attr_accessor :links
35
+
36
+ class EnumAttributeValidator
37
+ attr_reader :datatype
38
+ attr_reader :allowable_values
39
+
40
+ def initialize(datatype, allowable_values)
41
+ @allowable_values = allowable_values.map do |value|
42
+ case datatype.to_s
43
+ when /Integer/i
44
+ value.to_i
45
+ when /Float/i
46
+ value.to_f
47
+ else
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ def valid?(value)
54
+ !value || allowable_values.include?(value)
55
+ end
56
+ end
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'type' => :'type',
62
+ :'text' => :'text',
63
+ :'id' => :'id',
64
+ :'index' => :'index',
65
+ :'document_id' => :'document_id',
66
+ :'document_name' => :'document_name',
67
+ :'metadata' => :'metadata',
68
+ :'document_metadata' => :'document_metadata',
69
+ :'links' => :'links'
70
+ }
71
+ end
72
+
73
+ # Returns attribute mapping this model knows about
74
+ def self.acceptable_attribute_map
75
+ attribute_map
76
+ end
77
+
78
+ # Returns all the JSON keys this model knows about
79
+ def self.acceptable_attributes
80
+ acceptable_attribute_map.values
81
+ end
82
+
83
+ # Attribute type mapping.
84
+ def self.openapi_types
85
+ {
86
+ :'type' => :'String',
87
+ :'text' => :'String',
88
+ :'id' => :'String',
89
+ :'index' => :'Integer',
90
+ :'document_id' => :'String',
91
+ :'document_name' => :'String',
92
+ :'metadata' => :'Hash<String, Object>',
93
+ :'document_metadata' => :'Hash<String, Object>',
94
+ :'links' => :'Hash<String, SearchResultLink>'
95
+ }
96
+ end
97
+
98
+ # List of attributes with nullable: true
99
+ def self.openapi_nullable
100
+ Set.new([
101
+ ])
102
+ end
103
+
104
+ # Initializes the object
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ def initialize(attributes = {})
107
+ if (!attributes.is_a?(Hash))
108
+ fail ArgumentError, "The input argument (attributes) must be a hash in `RagieRubySdk::RagieEvidence` initialize method"
109
+ end
110
+
111
+ # check to see if the attribute exists and convert string to symbol for hash key
112
+ acceptable_attribute_map = self.class.acceptable_attribute_map
113
+ attributes = attributes.each_with_object({}) { |(k, v), h|
114
+ if (!acceptable_attribute_map.key?(k.to_sym))
115
+ fail ArgumentError, "`#{k}` is not a valid attribute in `RagieRubySdk::RagieEvidence`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
116
+ end
117
+ h[k.to_sym] = v
118
+ }
119
+
120
+ if attributes.key?(:'type')
121
+ self.type = attributes[:'type']
122
+ else
123
+ self.type = 'ragie'
124
+ end
125
+
126
+ if attributes.key?(:'text')
127
+ self.text = attributes[:'text']
128
+ else
129
+ self.text = nil
130
+ end
131
+
132
+ if attributes.key?(:'id')
133
+ self.id = attributes[:'id']
134
+ else
135
+ self.id = nil
136
+ end
137
+
138
+ if attributes.key?(:'index')
139
+ self.index = attributes[:'index']
140
+ else
141
+ self.index = nil
142
+ end
143
+
144
+ if attributes.key?(:'document_id')
145
+ self.document_id = attributes[:'document_id']
146
+ else
147
+ self.document_id = nil
148
+ end
149
+
150
+ if attributes.key?(:'document_name')
151
+ self.document_name = attributes[:'document_name']
152
+ else
153
+ self.document_name = nil
154
+ end
155
+
156
+ if attributes.key?(:'metadata')
157
+ if (value = attributes[:'metadata']).is_a?(Hash)
158
+ self.metadata = value
159
+ end
160
+ end
161
+
162
+ if attributes.key?(:'document_metadata')
163
+ if (value = attributes[:'document_metadata']).is_a?(Hash)
164
+ self.document_metadata = value
165
+ end
166
+ end
167
+
168
+ if attributes.key?(:'links')
169
+ if (value = attributes[:'links']).is_a?(Hash)
170
+ self.links = value
171
+ end
172
+ end
173
+ end
174
+
175
+ # Show invalid properties with the reasons. Usually used together with valid?
176
+ # @return Array for valid properties with the reasons
177
+ def list_invalid_properties
178
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
179
+ invalid_properties = Array.new
180
+ if @text.nil?
181
+ invalid_properties.push('invalid value for "text", text cannot be nil.')
182
+ end
183
+
184
+ if @id.nil?
185
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
186
+ end
187
+
188
+ if @index.nil?
189
+ invalid_properties.push('invalid value for "index", index cannot be nil.')
190
+ end
191
+
192
+ if @document_id.nil?
193
+ invalid_properties.push('invalid value for "document_id", document_id cannot be nil.')
194
+ end
195
+
196
+ if @document_name.nil?
197
+ invalid_properties.push('invalid value for "document_name", document_name cannot be nil.')
198
+ end
199
+
200
+ invalid_properties
201
+ end
202
+
203
+ # Check to see if the all the properties in the model are valid
204
+ # @return true if the model is valid
205
+ def valid?
206
+ warn '[DEPRECATED] the `valid?` method is obsolete'
207
+ type_validator = EnumAttributeValidator.new('String', ["ragie"])
208
+ return false unless type_validator.valid?(@type)
209
+ return false if @text.nil?
210
+ return false if @id.nil?
211
+ return false if @index.nil?
212
+ return false if @document_id.nil?
213
+ return false if @document_name.nil?
214
+ true
215
+ end
216
+
217
+ # Custom attribute writer method checking allowed values (enum).
218
+ # @param [Object] type Object to be assigned
219
+ def type=(type)
220
+ validator = EnumAttributeValidator.new('String', ["ragie"])
221
+ unless validator.valid?(type)
222
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
223
+ end
224
+ @type = type
225
+ end
226
+
227
+ # Custom attribute writer method with validation
228
+ # @param [Object] text Value to be assigned
229
+ def text=(text)
230
+ if text.nil?
231
+ fail ArgumentError, 'text cannot be nil'
232
+ end
233
+
234
+ @text = text
235
+ end
236
+
237
+ # Custom attribute writer method with validation
238
+ # @param [Object] id Value to be assigned
239
+ def id=(id)
240
+ if id.nil?
241
+ fail ArgumentError, 'id cannot be nil'
242
+ end
243
+
244
+ @id = id
245
+ end
246
+
247
+ # Custom attribute writer method with validation
248
+ # @param [Object] index Value to be assigned
249
+ def index=(index)
250
+ if index.nil?
251
+ fail ArgumentError, 'index cannot be nil'
252
+ end
253
+
254
+ @index = index
255
+ end
256
+
257
+ # Custom attribute writer method with validation
258
+ # @param [Object] document_id Value to be assigned
259
+ def document_id=(document_id)
260
+ if document_id.nil?
261
+ fail ArgumentError, 'document_id cannot be nil'
262
+ end
263
+
264
+ @document_id = document_id
265
+ end
266
+
267
+ # Custom attribute writer method with validation
268
+ # @param [Object] document_name Value to be assigned
269
+ def document_name=(document_name)
270
+ if document_name.nil?
271
+ fail ArgumentError, 'document_name cannot be nil'
272
+ end
273
+
274
+ @document_name = document_name
275
+ end
276
+
277
+ # Checks equality by comparing each attribute.
278
+ # @param [Object] Object to be compared
279
+ def ==(o)
280
+ return true if self.equal?(o)
281
+ self.class == o.class &&
282
+ type == o.type &&
283
+ text == o.text &&
284
+ id == o.id &&
285
+ index == o.index &&
286
+ document_id == o.document_id &&
287
+ document_name == o.document_name &&
288
+ metadata == o.metadata &&
289
+ document_metadata == o.document_metadata &&
290
+ links == o.links
291
+ end
292
+
293
+ # @see the `==` method
294
+ # @param [Object] Object to be compared
295
+ def eql?(o)
296
+ self == o
297
+ end
298
+
299
+ # Calculates hash code according to all attributes.
300
+ # @return [Integer] Hash code
301
+ def hash
302
+ [type, text, id, index, document_id, document_name, metadata, document_metadata, links].hash
303
+ end
304
+
305
+ # Builds the object from hash
306
+ # @param [Hash] attributes Model attributes in the form of hash
307
+ # @return [Object] Returns the model itself
308
+ def self.build_from_hash(attributes)
309
+ return nil unless attributes.is_a?(Hash)
310
+ attributes = attributes.transform_keys(&:to_sym)
311
+ transformed_hash = {}
312
+ openapi_types.each_pair do |key, type|
313
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
314
+ transformed_hash["#{key}"] = nil
315
+ elsif type =~ /\AArray<(.*)>/i
316
+ # check to ensure the input is an array given that the attribute
317
+ # is documented as an array but the input is not
318
+ if attributes[attribute_map[key]].is_a?(Array)
319
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
320
+ end
321
+ elsif !attributes[attribute_map[key]].nil?
322
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
323
+ end
324
+ end
325
+ new(transformed_hash)
326
+ end
327
+
328
+ # Deserializes the data based on type
329
+ # @param string type Data type
330
+ # @param string value Value to be deserialized
331
+ # @return [Object] Deserialized data
332
+ def self._deserialize(type, value)
333
+ case type.to_sym
334
+ when :Time
335
+ Time.parse(value)
336
+ when :Date
337
+ Date.parse(value)
338
+ when :String
339
+ value.to_s
340
+ when :Integer
341
+ value.to_i
342
+ when :Float
343
+ value.to_f
344
+ when :Boolean
345
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
346
+ true
347
+ else
348
+ false
349
+ end
350
+ when :Object
351
+ # generic object (usually a Hash), return directly
352
+ value
353
+ when /\AArray<(?<inner_type>.+)>\z/
354
+ inner_type = Regexp.last_match[:inner_type]
355
+ value.map { |v| _deserialize(inner_type, v) }
356
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
357
+ k_type = Regexp.last_match[:k_type]
358
+ v_type = Regexp.last_match[:v_type]
359
+ {}.tap do |hash|
360
+ value.each do |k, v|
361
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
362
+ end
363
+ end
364
+ else # model
365
+ # models (e.g. Pet) or oneOf
366
+ klass = RagieRubySdk.const_get(type)
367
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
368
+ end
369
+ end
370
+
371
+ # Returns the string representation of the object
372
+ # @return [String] String presentation of the object
373
+ def to_s
374
+ to_hash.to_s
375
+ end
376
+
377
+ # to_body is an alias to to_hash (backward compatibility)
378
+ # @return [Hash] Returns the object in the form of hash
379
+ def to_body
380
+ to_hash
381
+ end
382
+
383
+ # Returns the object in the form of hash
384
+ # @return [Hash] Returns the object in the form of hash
385
+ def to_hash
386
+ hash = {}
387
+ self.class.attribute_map.each_pair do |attr, param|
388
+ value = self.send(attr)
389
+ if value.nil?
390
+ is_nullable = self.class.openapi_nullable.include?(attr)
391
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
392
+ end
393
+
394
+ hash[param] = _to_hash(value)
395
+ end
396
+ hash
397
+ end
398
+
399
+ # Outputs non-array value in the form of hash
400
+ # For object, use to_hash. Otherwise, just return the value
401
+ # @param [Object] value Any valid value
402
+ # @return [Hash] Returns the value in the form of hash
403
+ def _to_hash(value)
404
+ if value.is_a?(Array)
405
+ value.compact.map { |v| _to_hash(v) }
406
+ elsif value.is_a?(Hash)
407
+ {}.tap do |hash|
408
+ value.each { |k, v| hash[k] = _to_hash(v) }
409
+ end
410
+ elsif value.respond_to? :to_hash
411
+ value.to_hash
412
+ else
413
+ value
414
+ end
415
+ end
416
+
417
+ end
418
+
419
+ end
@@ -0,0 +1,271 @@
1
+ =begin
2
+ #Ragie API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.16.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module RagieRubySdk
17
+ class Reasoning
18
+ attr_accessor :effort
19
+
20
+ attr_accessor :summary
21
+
22
+ class EnumAttributeValidator
23
+ attr_reader :datatype
24
+ attr_reader :allowable_values
25
+
26
+ def initialize(datatype, allowable_values)
27
+ @allowable_values = allowable_values.map do |value|
28
+ case datatype.to_s
29
+ when /Integer/i
30
+ value.to_i
31
+ when /Float/i
32
+ value.to_f
33
+ else
34
+ value
35
+ end
36
+ end
37
+ end
38
+
39
+ def valid?(value)
40
+ !value || allowable_values.include?(value)
41
+ end
42
+ end
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'effort' => :'effort',
48
+ :'summary' => :'summary'
49
+ }
50
+ end
51
+
52
+ # Returns attribute mapping this model knows about
53
+ def self.acceptable_attribute_map
54
+ attribute_map
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ acceptable_attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'effort' => :'String',
66
+ :'summary' => :'Object'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ :'summary'
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `RagieRubySdk::Reasoning` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `RagieRubySdk::Reasoning`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'effort')
94
+ self.effort = attributes[:'effort']
95
+ else
96
+ self.effort = nil
97
+ end
98
+
99
+ if attributes.key?(:'summary')
100
+ self.summary = attributes[:'summary']
101
+ end
102
+ end
103
+
104
+ # Show invalid properties with the reasons. Usually used together with valid?
105
+ # @return Array for valid properties with the reasons
106
+ def list_invalid_properties
107
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
108
+ invalid_properties = Array.new
109
+ if @effort.nil?
110
+ invalid_properties.push('invalid value for "effort", effort cannot be nil.')
111
+ end
112
+
113
+ invalid_properties
114
+ end
115
+
116
+ # Check to see if the all the properties in the model are valid
117
+ # @return true if the model is valid
118
+ def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
120
+ return false if @effort.nil?
121
+ effort_validator = EnumAttributeValidator.new('String', ["low", "medium", "high"])
122
+ return false unless effort_validator.valid?(@effort)
123
+ true
124
+ end
125
+
126
+ # Custom attribute writer method checking allowed values (enum).
127
+ # @param [Object] effort Object to be assigned
128
+ def effort=(effort)
129
+ validator = EnumAttributeValidator.new('String', ["low", "medium", "high"])
130
+ unless validator.valid?(effort)
131
+ fail ArgumentError, "invalid value for \"effort\", must be one of #{validator.allowable_values}."
132
+ end
133
+ @effort = effort
134
+ end
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] Object to be compared
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ effort == o.effort &&
142
+ summary == o.summary
143
+ end
144
+
145
+ # @see the `==` method
146
+ # @param [Object] Object to be compared
147
+ def eql?(o)
148
+ self == o
149
+ end
150
+
151
+ # Calculates hash code according to all attributes.
152
+ # @return [Integer] Hash code
153
+ def hash
154
+ [effort, summary].hash
155
+ end
156
+
157
+ # Builds the object from hash
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ # @return [Object] Returns the model itself
160
+ def self.build_from_hash(attributes)
161
+ return nil unless attributes.is_a?(Hash)
162
+ attributes = attributes.transform_keys(&:to_sym)
163
+ transformed_hash = {}
164
+ openapi_types.each_pair do |key, type|
165
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = nil
167
+ elsif type =~ /\AArray<(.*)>/i
168
+ # check to ensure the input is an array given that the attribute
169
+ # is documented as an array but the input is not
170
+ if attributes[attribute_map[key]].is_a?(Array)
171
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
172
+ end
173
+ elsif !attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
175
+ end
176
+ end
177
+ new(transformed_hash)
178
+ end
179
+
180
+ # Deserializes the data based on type
181
+ # @param string type Data type
182
+ # @param string value Value to be deserialized
183
+ # @return [Object] Deserialized data
184
+ def self._deserialize(type, value)
185
+ case type.to_sym
186
+ when :Time
187
+ Time.parse(value)
188
+ when :Date
189
+ Date.parse(value)
190
+ when :String
191
+ value.to_s
192
+ when :Integer
193
+ value.to_i
194
+ when :Float
195
+ value.to_f
196
+ when :Boolean
197
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
198
+ true
199
+ else
200
+ false
201
+ end
202
+ when :Object
203
+ # generic object (usually a Hash), return directly
204
+ value
205
+ when /\AArray<(?<inner_type>.+)>\z/
206
+ inner_type = Regexp.last_match[:inner_type]
207
+ value.map { |v| _deserialize(inner_type, v) }
208
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
209
+ k_type = Regexp.last_match[:k_type]
210
+ v_type = Regexp.last_match[:v_type]
211
+ {}.tap do |hash|
212
+ value.each do |k, v|
213
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
214
+ end
215
+ end
216
+ else # model
217
+ # models (e.g. Pet) or oneOf
218
+ klass = RagieRubySdk.const_get(type)
219
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
220
+ end
221
+ end
222
+
223
+ # Returns the string representation of the object
224
+ # @return [String] String presentation of the object
225
+ def to_s
226
+ to_hash.to_s
227
+ end
228
+
229
+ # to_body is an alias to to_hash (backward compatibility)
230
+ # @return [Hash] Returns the object in the form of hash
231
+ def to_body
232
+ to_hash
233
+ end
234
+
235
+ # Returns the object in the form of hash
236
+ # @return [Hash] Returns the object in the form of hash
237
+ def to_hash
238
+ hash = {}
239
+ self.class.attribute_map.each_pair do |attr, param|
240
+ value = self.send(attr)
241
+ if value.nil?
242
+ is_nullable = self.class.openapi_nullable.include?(attr)
243
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
244
+ end
245
+
246
+ hash[param] = _to_hash(value)
247
+ end
248
+ hash
249
+ end
250
+
251
+ # Outputs non-array value in the form of hash
252
+ # For object, use to_hash. Otherwise, just return the value
253
+ # @param [Object] value Any valid value
254
+ # @return [Hash] Returns the value in the form of hash
255
+ def _to_hash(value)
256
+ if value.is_a?(Array)
257
+ value.compact.map { |v| _to_hash(v) }
258
+ elsif value.is_a?(Hash)
259
+ {}.tap do |hash|
260
+ value.each { |k, v| hash[k] = _to_hash(v) }
261
+ end
262
+ elsif value.respond_to? :to_hash
263
+ value.to_hash
264
+ else
265
+ value
266
+ end
267
+ end
268
+
269
+ end
270
+
271
+ end