lingara 0.2.0.pre.alpha.4 → 0.2.0.pre.alpha.6

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 (139) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +90 -0
  3. data/lib/lingara/canvas.rb +101 -0
  4. data/lib/lingara/client.rb +8 -5
  5. data/lib/lingara/dialogue.rb +143 -0
  6. data/lib/lingara/models/activate_canvas_request.rb +313 -0
  7. data/lib/lingara/models/activate_dialogue_request.rb +237 -0
  8. data/lib/lingara/models/allowance_row.rb +1 -1
  9. data/lib/lingara/models/app_context_slice.rb +1 -1
  10. data/lib/lingara/models/app_disabled_data.rb +1 -1
  11. data/lib/lingara/models/app_enabled_data.rb +1 -1
  12. data/lib/lingara/models/app_installed_data.rb +1 -1
  13. data/lib/lingara/models/app_uninstalled_data.rb +1 -1
  14. data/lib/lingara/models/canvas.rb +339 -0
  15. data/lib/lingara/models/canvas_activation_outcome.rb +41 -0
  16. data/lib/lingara/models/canvas_active.rb +317 -0
  17. data/lib/lingara/models/canvas_definition.rb +323 -0
  18. data/lib/lingara/models/canvas_draft.rb +317 -0
  19. data/lib/lingara/models/canvas_dry_run.rb +265 -0
  20. data/lib/lingara/models/canvas_edge.rb +263 -0
  21. data/lib/lingara/models/canvas_made_object.rb +311 -0
  22. data/lib/lingara/models/canvas_node.rb +397 -0
  23. data/lib/lingara/models/canvas_node_kind.rb +43 -0
  24. data/lib/lingara/models/canvas_object_ref.rb +237 -0
  25. data/lib/lingara/models/canvas_page.rb +289 -0
  26. data/lib/lingara/models/canvas_param.rb +105 -0
  27. data/lib/lingara/models/canvas_plan.rb +248 -0
  28. data/lib/lingara/models/canvas_recipe.rb +43 -0
  29. data/lib/lingara/models/canvas_summary.rb +511 -0
  30. data/lib/lingara/models/canvas_verdict.rb +389 -0
  31. data/lib/lingara/models/canvas_verdict_kind.rb +42 -0
  32. data/lib/lingara/models/create_canvas_request.rb +279 -0
  33. data/lib/lingara/models/create_dialogue_request.rb +248 -0
  34. data/lib/lingara/models/create_lesson_plan_event_error.rb +1 -1
  35. data/lib/lingara/models/create_lesson_plan_event_phase.rb +1 -1
  36. data/lib/lingara/models/create_lesson_plan_event_result.rb +1 -1
  37. data/lib/lingara/models/create_lesson_plan_event_started.rb +1 -1
  38. data/lib/lingara/models/dialogue.rb +367 -0
  39. data/lib/lingara/models/dialogue_active.rb +290 -0
  40. data/lib/lingara/models/dialogue_draft.rb +290 -0
  41. data/lib/lingara/models/dialogue_entry.rb +1 -1
  42. data/lib/lingara/models/dialogue_npc.rb +326 -0
  43. data/lib/lingara/models/dialogue_page.rb +277 -0
  44. data/lib/lingara/models/dialogue_rule.rb +55 -0
  45. data/lib/lingara/models/dialogue_summary.rb +431 -0
  46. data/lib/lingara/models/dialogue_transition.rb +264 -0
  47. data/lib/lingara/models/dialogue_turn_request.rb +110 -6
  48. data/lib/lingara/models/dialogue_warning.rb +285 -0
  49. data/lib/lingara/models/dialogue_warning_code.rb +42 -0
  50. data/lib/lingara/models/embed_player_link.rb +1 -1
  51. data/lib/lingara/models/embed_token.rb +1 -1
  52. data/lib/lingara/models/embed_token_request.rb +1 -1
  53. data/lib/lingara/models/error_envelope.rb +2 -2
  54. data/lib/lingara/models/event_envelope.rb +1 -1
  55. data/lib/lingara/models/event_page.rb +1 -1
  56. data/lib/lingara/models/fact_value.rb +105 -0
  57. data/lib/lingara/models/generate_vocabulary_event_done.rb +1 -1
  58. data/lib/lingara/models/generate_vocabulary_event_error.rb +1 -1
  59. data/lib/lingara/models/generate_vocabulary_event_item.rb +1 -1
  60. data/lib/lingara/models/generate_vocabulary_event_started.rb +1 -1
  61. data/lib/lingara/models/graph_checkpoint.rb +322 -0
  62. data/lib/lingara/models/graph_edge.rb +329 -0
  63. data/lib/lingara/models/inbound_event_accepted.rb +1 -1
  64. data/lib/lingara/models/lesson_plan.rb +1 -1
  65. data/lib/lingara/models/lesson_plan_content.rb +1 -1
  66. data/lib/lingara/models/lesson_plan_create_request.rb +1 -1
  67. data/lib/lingara/models/lesson_plan_failed_data.rb +1 -1
  68. data/lib/lingara/models/lesson_plan_ready_data.rb +1 -1
  69. data/lib/lingara/models/link_status.rb +1 -1
  70. data/lib/lingara/models/notice.rb +1 -1
  71. data/lib/lingara/models/npc.rb +1 -1
  72. data/lib/lingara/models/npc_language.rb +345 -0
  73. data/lib/lingara/models/pedagogy.rb +41 -0
  74. data/lib/lingara/models/plan_fail_reason.rb +1 -1
  75. data/lib/lingara/models/plan_pending.rb +1 -1
  76. data/lib/lingara/models/plan_phase.rb +1 -1
  77. data/lib/lingara/models/plan_question.rb +1 -1
  78. data/lib/lingara/models/plan_ready_status.rb +1 -1
  79. data/lib/lingara/models/plan_result.rb +1 -1
  80. data/lib/lingara/models/plan_set.rb +1 -1
  81. data/lib/lingara/models/plan_started.rb +1 -1
  82. data/lib/lingara/models/plan_status.rb +1 -1
  83. data/lib/lingara/models/plan_word.rb +1 -1
  84. data/lib/lingara/models/practice_completed_data.rb +1 -1
  85. data/lib/lingara/models/practice_item.rb +1 -1
  86. data/lib/lingara/models/practice_outcome.rb +1 -1
  87. data/lib/lingara/models/reaction_report.rb +1 -1
  88. data/lib/lingara/models/reaction_status.rb +1 -1
  89. data/lib/lingara/models/rename_canvas_request.rb +237 -0
  90. data/lib/lingara/models/rename_dialogue_request.rb +237 -0
  91. data/lib/lingara/models/save_canvas_draft_request.rb +273 -0
  92. data/lib/lingara/models/save_dialogue_draft_request.rb +274 -0
  93. data/lib/lingara/models/send_dialogue_turn_event_delta.rb +1 -1
  94. data/lib/lingara/models/send_dialogue_turn_event_done.rb +1 -1
  95. data/lib/lingara/models/send_dialogue_turn_event_error.rb +1 -1
  96. data/lib/lingara/models/send_dialogue_turn_event_notice.rb +1 -1
  97. data/lib/lingara/models/send_dialogue_turn_event_transition.rb +287 -0
  98. data/lib/lingara/models/send_tutor_message_event_delta.rb +1 -1
  99. data/lib/lingara/models/send_tutor_message_event_done.rb +1 -1
  100. data/lib/lingara/models/send_tutor_message_event_error.rb +1 -1
  101. data/lib/lingara/models/send_tutor_message_event_notice.rb +1 -1
  102. data/lib/lingara/models/speaker.rb +1 -1
  103. data/lib/lingara/models/stream_error.rb +1 -1
  104. data/lib/lingara/models/stream_events_event_done.rb +1 -1
  105. data/lib/lingara/models/stream_events_event_error.rb +1 -1
  106. data/lib/lingara/models/stream_events_event_event.rb +1 -1
  107. data/lib/lingara/models/stream_lesson_plan_event_error.rb +1 -1
  108. data/lib/lingara/models/stream_lesson_plan_event_pending.rb +1 -1
  109. data/lib/lingara/models/stream_lesson_plan_event_phase.rb +1 -1
  110. data/lib/lingara/models/stream_lesson_plan_event_result.rb +1 -1
  111. data/lib/lingara/models/stream_lesson_plan_event_started.rb +1 -1
  112. data/lib/lingara/models/threshold_scope.rb +1 -1
  113. data/lib/lingara/models/turn_delta.rb +1 -1
  114. data/lib/lingara/models/turn_entry.rb +1 -1
  115. data/lib/lingara/models/turn_role.rb +1 -1
  116. data/lib/lingara/models/tutor_turn_request.rb +1 -1
  117. data/lib/lingara/models/usage.rb +1 -1
  118. data/lib/lingara/models/usage_ledger.rb +1 -1
  119. data/lib/lingara/models/usage_threshold_reached_data.rb +1 -1
  120. data/lib/lingara/models/version_detail.rb +1 -1
  121. data/lib/lingara/models/version_history_entry.rb +1 -1
  122. data/lib/lingara/models/version_list.rb +1 -1
  123. data/lib/lingara/models/version_spec.rb +1 -1
  124. data/lib/lingara/models/version_state.rb +1 -1
  125. data/lib/lingara/models/version_summary.rb +1 -1
  126. data/lib/lingara/models/vocab_example.rb +1 -1
  127. data/lib/lingara/models/vocab_item.rb +1 -1
  128. data/lib/lingara/models/vocab_meta.rb +1 -1
  129. data/lib/lingara/models/vocab_request.rb +1 -1
  130. data/lib/lingara/models/vocab_started.rb +1 -1
  131. data/lib/lingara/models/world_context_changed.rb +1 -1
  132. data/lib/lingara/models/world_practice_completed.rb +1 -1
  133. data/lib/lingara/models/world_practice_requested.rb +1 -1
  134. data/lib/lingara/operations.rb +127 -1
  135. data/lib/lingara/streams.rb +1 -0
  136. data/lib/lingara/version.rb +3 -3
  137. data/lib/lingara.rb +2 -0
  138. data/sig/lingara.rbs +50 -0
  139. metadata +46 -2
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate vocabulary lists and lesson plans, and hold tutor conversations, in the languages Lingara teaches. Each call is paid for by the client that makes it: an `allowance` client spends its owner's allowance, and a `metered` client is billed for its usage.
5
5
 
6
- The version of the OpenAPI document: 2026-10-virile-dragon
6
+ The version of the OpenAPI document: 2026-10-simple-tarpon
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -17,6 +17,9 @@ module Lingara
17
17
  class DialogueTurnRequest
18
18
  attr_accessor :npc
19
19
 
20
+ # `subtle` (the default) keeps the character's `target_lang` at or below the learner's `level`. `none` lets the character speak at its own level, as a native speaker when it has no `languages`, and ignores `level`.
21
+ attr_accessor :pedagogy
22
+
20
23
  attr_accessor :scene
21
24
 
22
25
  attr_accessor :source_lang
@@ -30,16 +33,50 @@ module Lingara
30
33
  # The conversation so far, oldest first, at most 12 lines. You keep the window: Lingara stores nothing between turns. Send each NPC reply back cut to its first 500 characters.
31
34
  attr_accessor :history
32
35
 
36
+ # Where the story stands: a goal the character steers toward, and the facts it may reveal. Needs `enable_npc_dialogue_graphs`.
37
+ attr_accessor :checkpoint
38
+
39
+ # The ways out of this checkpoint whose game conditions already hold, each with a plain-language condition. After the reply, at most one is chosen and sent as a `transition` event before `done`. Edges your game decides on its own are never sent.
40
+ attr_accessor :edges
41
+
42
+ attr_accessor :facts
43
+
44
+ class EnumAttributeValidator
45
+ attr_reader :datatype
46
+ attr_reader :allowable_values
47
+
48
+ def initialize(datatype, allowable_values)
49
+ @allowable_values = allowable_values.map do |value|
50
+ case datatype.to_s
51
+ when /Integer/i
52
+ value.to_i
53
+ when /Float/i
54
+ value.to_f
55
+ else
56
+ value
57
+ end
58
+ end
59
+ end
60
+
61
+ def valid?(value)
62
+ !value || allowable_values.include?(value)
63
+ end
64
+ end
65
+
33
66
  # Attribute mapping from ruby-style variable name to JSON key.
34
67
  def self.attribute_map
35
68
  {
36
69
  :'npc' => :'npc',
70
+ :'pedagogy' => :'pedagogy',
37
71
  :'scene' => :'scene',
38
72
  :'source_lang' => :'source_lang',
39
73
  :'target_lang' => :'target_lang',
40
74
  :'level' => :'level',
41
75
  :'line' => :'line',
42
- :'history' => :'history'
76
+ :'history' => :'history',
77
+ :'checkpoint' => :'checkpoint',
78
+ :'edges' => :'edges',
79
+ :'facts' => :'facts'
43
80
  }
44
81
  end
45
82
 
@@ -56,13 +93,17 @@ module Lingara
56
93
  # Attribute type mapping.
57
94
  def self.openapi_types
58
95
  {
59
- :'npc' => :'Npc',
96
+ :'npc' => :'DialogueNpc',
97
+ :'pedagogy' => :'Pedagogy',
60
98
  :'scene' => :'String',
61
99
  :'source_lang' => :'String',
62
100
  :'target_lang' => :'String',
63
101
  :'level' => :'Integer',
64
102
  :'line' => :'String',
65
- :'history' => :'Array<DialogueEntry>'
103
+ :'history' => :'Array<DialogueEntry>',
104
+ :'checkpoint' => :'GraphCheckpoint',
105
+ :'edges' => :'Array<GraphEdge>',
106
+ :'facts' => :'Hash<String, FactValue>'
66
107
  }
67
108
  end
68
109
 
@@ -70,6 +111,7 @@ module Lingara
70
111
  def self.openapi_nullable
71
112
  Set.new([
72
113
  :'scene',
114
+ :'checkpoint',
73
115
  ])
74
116
  end
75
117
 
@@ -95,6 +137,10 @@ module Lingara
95
137
  self.npc = nil
96
138
  end
97
139
 
140
+ if attributes.key?(:'pedagogy')
141
+ self.pedagogy = attributes[:'pedagogy']
142
+ end
143
+
98
144
  if attributes.key?(:'scene')
99
145
  self.scene = attributes[:'scene']
100
146
  end
@@ -128,6 +174,22 @@ module Lingara
128
174
  self.history = value
129
175
  end
130
176
  end
177
+
178
+ if attributes.key?(:'checkpoint')
179
+ self.checkpoint = attributes[:'checkpoint']
180
+ end
181
+
182
+ if attributes.key?(:'edges')
183
+ if (value = attributes[:'edges']).is_a?(Array)
184
+ self.edges = value
185
+ end
186
+ end
187
+
188
+ if attributes.key?(:'facts')
189
+ if (value = attributes[:'facts']).is_a?(Hash)
190
+ self.facts = value
191
+ end
192
+ end
131
193
  end
132
194
 
133
195
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -183,6 +245,14 @@ module Lingara
183
245
  invalid_properties.push('invalid value for "history", number of items must be less than or equal to 12.')
184
246
  end
185
247
 
248
+ if !@edges.nil? && @edges.length > 8
249
+ invalid_properties.push('invalid value for "edges", number of items must be less than or equal to 8.')
250
+ end
251
+
252
+ if !@facts.nil? && @facts.length > 16
253
+ invalid_properties.push('invalid value for "facts", number of items must be less than or equal to 16.')
254
+ end
255
+
186
256
  invalid_properties
187
257
  end
188
258
 
@@ -202,6 +272,8 @@ module Lingara
202
272
  return false if @line.to_s.length > 500
203
273
  return false if @line.to_s.length < 1
204
274
  return false if !@history.nil? && @history.length > 12
275
+ return false if !@edges.nil? && @edges.length > 8
276
+ return false if !@facts.nil? && @facts.length > 16
205
277
  true
206
278
  end
207
279
 
@@ -299,18 +371,50 @@ module Lingara
299
371
  @history = history
300
372
  end
301
373
 
374
+ # Custom attribute writer method with validation
375
+ # @param [Object] edges Value to be assigned
376
+ def edges=(edges)
377
+ if edges.nil?
378
+ fail ArgumentError, 'edges cannot be nil'
379
+ end
380
+
381
+ if edges.length > 8
382
+ fail ArgumentError, 'invalid value for "edges", number of items must be less than or equal to 8.'
383
+ end
384
+
385
+ @edges = edges
386
+ end
387
+
388
+ # Custom attribute writer method with validation
389
+ # @param [Object] facts Value to be assigned
390
+ def facts=(facts)
391
+ if facts.nil?
392
+ fail ArgumentError, 'facts cannot be nil'
393
+ end
394
+
395
+ if facts.length > 16
396
+ fail ArgumentError, 'invalid value for "facts", number of items must be less than or equal to 16.'
397
+ end
398
+
399
+ @facts = facts
400
+ end
401
+
302
402
  # Checks equality by comparing each attribute.
303
403
  # @param [Object] Object to be compared
304
404
  def ==(o)
305
405
  return true if self.equal?(o)
306
406
  self.class == o.class &&
307
407
  npc == o.npc &&
408
+ pedagogy == o.pedagogy &&
308
409
  scene == o.scene &&
309
410
  source_lang == o.source_lang &&
310
411
  target_lang == o.target_lang &&
311
412
  level == o.level &&
312
413
  line == o.line &&
313
- history == o.history
414
+ history == o.history &&
415
+ checkpoint == o.checkpoint &&
416
+ edges == o.edges &&
417
+ facts == o.facts
314
418
  end
315
419
 
316
420
  # @see the `==` method
@@ -322,7 +426,7 @@ module Lingara
322
426
  # Calculates hash code according to all attributes.
323
427
  # @return [Integer] Hash code
324
428
  def hash
325
- [npc, scene, source_lang, target_lang, level, line, history].hash
429
+ [npc, pedagogy, scene, source_lang, target_lang, level, line, history, checkpoint, edges, facts].hash
326
430
  end
327
431
 
328
432
  # Builds the object from hash
@@ -0,0 +1,285 @@
1
+ =begin
2
+ #Lingara API
3
+
4
+ #Generate vocabulary lists and lesson plans, and hold tutor conversations, in the languages Lingara teaches. Each call is paid for by the client that makes it: an `allowance` client spends its owner's allowance, and a `metered` client is billed for its usage.
5
+
6
+ The version of the OpenAPI document: 2026-10-simple-tarpon
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.14.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Lingara
17
+ class DialogueWarning
18
+ attr_accessor :code
19
+
20
+ attr_accessor :path
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
+ :'code' => :'code',
48
+ :'path' => :'path'
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
+ :'code' => :'DialogueWarningCode',
66
+ :'path' => :'String'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Lingara::DialogueWarning` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Lingara::DialogueWarning`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'code')
93
+ self.code = attributes[:'code']
94
+ else
95
+ self.code = nil
96
+ end
97
+
98
+ if attributes.key?(:'path')
99
+ self.path = attributes[:'path']
100
+ else
101
+ self.path = nil
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
109
+ invalid_properties = Array.new
110
+ if @code.nil?
111
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
112
+ end
113
+
114
+ if @path.nil?
115
+ invalid_properties.push('invalid value for "path", path cannot be nil.')
116
+ end
117
+
118
+ invalid_properties
119
+ end
120
+
121
+ # Check to see if the all the properties in the model are valid
122
+ # @return true if the model is valid
123
+ def valid?
124
+ warn '[DEPRECATED] the `valid?` method is obsolete'
125
+ return false if @code.nil?
126
+ return false if @path.nil?
127
+ true
128
+ end
129
+
130
+ # Custom attribute writer method with validation
131
+ # @param [Object] code Value to be assigned
132
+ def code=(code)
133
+ if code.nil?
134
+ fail ArgumentError, 'code cannot be nil'
135
+ end
136
+
137
+ @code = code
138
+ end
139
+
140
+ # Custom attribute writer method with validation
141
+ # @param [Object] path Value to be assigned
142
+ def path=(path)
143
+ if path.nil?
144
+ fail ArgumentError, 'path cannot be nil'
145
+ end
146
+
147
+ @path = path
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(o)
153
+ return true if self.equal?(o)
154
+ self.class == o.class &&
155
+ code == o.code &&
156
+ path == o.path
157
+ end
158
+
159
+ # @see the `==` method
160
+ # @param [Object] Object to be compared
161
+ def eql?(o)
162
+ self == o
163
+ end
164
+
165
+ # Calculates hash code according to all attributes.
166
+ # @return [Integer] Hash code
167
+ def hash
168
+ [code, path].hash
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def self.build_from_hash(attributes)
175
+ return nil unless attributes.is_a?(Hash)
176
+ attributes = attributes.transform_keys(&:to_sym)
177
+ transformed_hash = {}
178
+ openapi_types.each_pair do |key, type|
179
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
180
+ transformed_hash["#{key}"] = nil
181
+ elsif type =~ /\AArray<(.*)>/i
182
+ # check to ensure the input is an array given that the attribute
183
+ # is documented as an array but the input is not
184
+ if attributes[attribute_map[key]].is_a?(Array)
185
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
186
+ end
187
+ elsif !attributes[attribute_map[key]].nil?
188
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
189
+ end
190
+ end
191
+ new(transformed_hash)
192
+ end
193
+
194
+ # Deserializes the data based on type
195
+ # @param string type Data type
196
+ # @param string value Value to be deserialized
197
+ # @return [Object] Deserialized data
198
+ def self._deserialize(type, value)
199
+ case type.to_sym
200
+ when :Time
201
+ Time.parse(value)
202
+ when :Date
203
+ Date.parse(value)
204
+ when :String
205
+ value.to_s
206
+ when :Integer
207
+ value.to_i
208
+ when :Float
209
+ value.to_f
210
+ when :Boolean
211
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
212
+ true
213
+ else
214
+ false
215
+ end
216
+ when :Object
217
+ # generic object (usually a Hash), return directly
218
+ value
219
+ when /\AArray<(?<inner_type>.+)>\z/
220
+ inner_type = Regexp.last_match[:inner_type]
221
+ value.map { |v| _deserialize(inner_type, v) }
222
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
223
+ k_type = Regexp.last_match[:k_type]
224
+ v_type = Regexp.last_match[:v_type]
225
+ {}.tap do |hash|
226
+ value.each do |k, v|
227
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
+ end
229
+ end
230
+ else # model
231
+ # models (e.g. Pet) or oneOf
232
+ klass = Lingara.const_get(type)
233
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
234
+ end
235
+ end
236
+
237
+ # Returns the string representation of the object
238
+ # @return [String] String presentation of the object
239
+ def to_s
240
+ to_hash.to_s
241
+ end
242
+
243
+ # to_body is an alias to to_hash (backward compatibility)
244
+ # @return [Hash] Returns the object in the form of hash
245
+ def to_body
246
+ to_hash
247
+ end
248
+
249
+ # Returns the object in the form of hash
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_hash
252
+ hash = {}
253
+ self.class.attribute_map.each_pair do |attr, param|
254
+ value = self.send(attr)
255
+ if value.nil?
256
+ is_nullable = self.class.openapi_nullable.include?(attr)
257
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
258
+ end
259
+
260
+ hash[param] = _to_hash(value)
261
+ end
262
+ hash
263
+ end
264
+
265
+ # Outputs non-array value in the form of hash
266
+ # For object, use to_hash. Otherwise, just return the value
267
+ # @param [Object] value Any valid value
268
+ # @return [Hash] Returns the value in the form of hash
269
+ def _to_hash(value)
270
+ if value.is_a?(Array)
271
+ value.compact.map { |v| _to_hash(v) }
272
+ elsif value.is_a?(Hash)
273
+ {}.tap do |hash|
274
+ value.each { |k, v| hash[k] = _to_hash(v) }
275
+ end
276
+ elsif value.respond_to? :to_hash
277
+ value.to_hash
278
+ else
279
+ value
280
+ end
281
+ end
282
+
283
+ end
284
+
285
+ end
@@ -0,0 +1,42 @@
1
+ =begin
2
+ #Lingara API
3
+
4
+ #Generate vocabulary lists and lesson plans, and hold tutor conversations, in the languages Lingara teaches. Each call is paid for by the client that makes it: an `allowance` client spends its owner's allowance, and a `metered` client is billed for its usage.
5
+
6
+ The version of the OpenAPI document: 2026-10-simple-tarpon
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.14.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Lingara
17
+ class DialogueWarningCode
18
+ CHECKPOINT_UNREACHABLE = "checkpoint_unreachable".freeze
19
+ OUTCOME_UNREACHABLE = "outcome_unreachable".freeze
20
+ PREDICATE_UNCHECKED = "predicate_unchecked".freeze
21
+ UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze
22
+
23
+ def self.all_vars
24
+ @all_vars ||= [CHECKPOINT_UNREACHABLE, OUTCOME_UNREACHABLE, PREDICATE_UNCHECKED, UNKNOWN_DEFAULT_OPEN_API].freeze
25
+ end
26
+
27
+ # Builds the enum from string
28
+ # @param [String] The enum value in the form of the string
29
+ # @return [String] The enum value
30
+ def self.build_from_hash(value)
31
+ new.build_from_hash(value)
32
+ end
33
+
34
+ # Builds the enum from string
35
+ # @param [String] The enum value in the form of the string
36
+ # @return [String] The enum value
37
+ def build_from_hash(value)
38
+ return value if DialogueWarningCode.all_vars.include?(value)
39
+ raise "Invalid ENUM value #{value} for class #DialogueWarningCode"
40
+ end
41
+ end
42
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate vocabulary lists and lesson plans, and hold tutor conversations, in the languages Lingara teaches. Each call is paid for by the client that makes it: an `allowance` client spends its owner's allowance, and a `metered` client is billed for its usage.
5
5
 
6
- The version of the OpenAPI document: 2026-10-virile-dragon
6
+ The version of the OpenAPI document: 2026-10-simple-tarpon
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate vocabulary lists and lesson plans, and hold tutor conversations, in the languages Lingara teaches. Each call is paid for by the client that makes it: an `allowance` client spends its owner's allowance, and a `metered` client is billed for its usage.
5
5
 
6
- The version of the OpenAPI document: 2026-10-virile-dragon
6
+ The version of the OpenAPI document: 2026-10-simple-tarpon
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate vocabulary lists and lesson plans, and hold tutor conversations, in the languages Lingara teaches. Each call is paid for by the client that makes it: an `allowance` client spends its owner's allowance, and a `metered` client is billed for its usage.
5
5
 
6
- The version of the OpenAPI document: 2026-10-virile-dragon
6
+ The version of the OpenAPI document: 2026-10-simple-tarpon
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate vocabulary lists and lesson plans, and hold tutor conversations, in the languages Lingara teaches. Each call is paid for by the client that makes it: an `allowance` client spends its owner's allowance, and a `metered` client is billed for its usage.
5
5
 
6
- The version of the OpenAPI document: 2026-10-virile-dragon
6
+ The version of the OpenAPI document: 2026-10-simple-tarpon
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module Lingara
17
17
  class ErrorEnvelope
18
- # Why the request was refused, as a stable code to branch on: for example `insufficient_scope` (`403`), `rate_limited` (`429`) and, for a metered client, `spend_cap_reached` (`402`) and `metered_billing_inactive` (`402`).
18
+ # Why the request was refused, as a stable code to branch on: for example `insufficient_scope` (`403`), `rate_limited` (`429`), `api_allowance_exhausted` (`429`) and, for a metered client, `spend_cap_reached` (`402`) and `metered_billing_inactive` (`402`).
19
19
  attr_accessor :code
20
20
 
21
21
  attr_accessor :error
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate vocabulary lists and lesson plans, and hold tutor conversations, in the languages Lingara teaches. Each call is paid for by the client that makes it: an `allowance` client spends its owner's allowance, and a `metered` client is billed for its usage.
5
5
 
6
- The version of the OpenAPI document: 2026-10-virile-dragon
6
+ The version of the OpenAPI document: 2026-10-simple-tarpon
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Generate vocabulary lists and lesson plans, and hold tutor conversations, in the languages Lingara teaches. Each call is paid for by the client that makes it: an `allowance` client spends its owner's allowance, and a `metered` client is billed for its usage.
5
5
 
6
- The version of the OpenAPI document: 2026-10-virile-dragon
6
+ The version of the OpenAPI document: 2026-10-simple-tarpon
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0