lingara 0.2.0.pre.alpha.7 → 0.3.0.pre.alpha.1

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 (149) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -0
  3. data/lib/lingara/client.rb +17 -2
  4. data/lib/lingara/models/activate_canvas_request.rb +1 -1
  5. data/lib/lingara/models/activate_dialogue_request.rb +1 -1
  6. data/lib/lingara/models/allowance_row.rb +1 -1
  7. data/lib/lingara/models/app_context_slice.rb +1 -1
  8. data/lib/lingara/models/app_disabled_data.rb +1 -1
  9. data/lib/lingara/models/app_enabled_data.rb +1 -1
  10. data/lib/lingara/models/app_installed_data.rb +1 -1
  11. data/lib/lingara/models/app_uninstalled_data.rb +1 -1
  12. data/lib/lingara/models/atom_kind.rb +44 -0
  13. data/lib/lingara/models/beat.rb +389 -0
  14. data/lib/lingara/models/canvas.rb +1 -1
  15. data/lib/lingara/models/canvas_activation_outcome.rb +1 -1
  16. data/lib/lingara/models/canvas_active.rb +1 -1
  17. data/lib/lingara/models/canvas_definition.rb +1 -1
  18. data/lib/lingara/models/canvas_draft.rb +1 -1
  19. data/lib/lingara/models/canvas_dry_run.rb +1 -1
  20. data/lib/lingara/models/canvas_edge.rb +1 -1
  21. data/lib/lingara/models/canvas_made_object.rb +1 -1
  22. data/lib/lingara/models/canvas_node.rb +1 -1
  23. data/lib/lingara/models/canvas_node_kind.rb +1 -1
  24. data/lib/lingara/models/canvas_object_ref.rb +1 -1
  25. data/lib/lingara/models/canvas_page.rb +1 -1
  26. data/lib/lingara/models/canvas_param.rb +1 -1
  27. data/lib/lingara/models/canvas_plan.rb +1 -1
  28. data/lib/lingara/models/canvas_recipe.rb +1 -1
  29. data/lib/lingara/models/canvas_summary.rb +1 -1
  30. data/lib/lingara/models/canvas_verdict.rb +1 -1
  31. data/lib/lingara/models/canvas_verdict_kind.rb +1 -1
  32. data/lib/lingara/models/create_canvas_request.rb +1 -1
  33. data/lib/lingara/models/create_dialogue_request.rb +2 -2
  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 +1 -1
  39. data/lib/lingara/models/dialogue_active.rb +2 -2
  40. data/lib/lingara/models/dialogue_draft.rb +2 -2
  41. data/lib/lingara/models/dialogue_entry.rb +1 -1
  42. data/lib/lingara/models/dialogue_npc.rb +17 -6
  43. data/lib/lingara/models/dialogue_page.rb +1 -1
  44. data/lib/lingara/models/dialogue_plan_request.rb +620 -0
  45. data/lib/lingara/models/dialogue_plan_response.rb +105 -0
  46. data/lib/lingara/models/dialogue_plan_response_one_of.rb +287 -0
  47. data/lib/lingara/models/dialogue_plan_response_one_of1.rb +287 -0
  48. data/lib/lingara/models/dialogue_rule.rb +6 -2
  49. data/lib/lingara/models/dialogue_summary.rb +1 -1
  50. data/lib/lingara/models/dialogue_transition.rb +1 -1
  51. data/lib/lingara/models/dialogue_turn_request.rb +1 -1
  52. data/lib/lingara/models/dialogue_warning.rb +1 -1
  53. data/lib/lingara/models/dialogue_warning_code.rb +5 -2
  54. data/lib/lingara/models/embed_player_link.rb +1 -1
  55. data/lib/lingara/models/embed_token.rb +1 -1
  56. data/lib/lingara/models/embed_token_request.rb +1 -1
  57. data/lib/lingara/models/error_envelope.rb +1 -1
  58. data/lib/lingara/models/event_envelope.rb +1 -1
  59. data/lib/lingara/models/event_page.rb +1 -1
  60. data/lib/lingara/models/exit.rb +247 -0
  61. data/lib/lingara/models/fact_value.rb +1 -1
  62. data/lib/lingara/models/generate_vocabulary_event_done.rb +1 -1
  63. data/lib/lingara/models/generate_vocabulary_event_error.rb +1 -1
  64. data/lib/lingara/models/generate_vocabulary_event_item.rb +1 -1
  65. data/lib/lingara/models/generate_vocabulary_event_started.rb +1 -1
  66. data/lib/lingara/models/graph_checkpoint.rb +40 -5
  67. data/lib/lingara/models/graph_edge.rb +1 -1
  68. data/lib/lingara/models/inbound_event_accepted.rb +1 -1
  69. data/lib/lingara/models/kept_reason.rb +43 -0
  70. data/lib/lingara/models/lesson_plan.rb +1 -1
  71. data/lib/lingara/models/lesson_plan_content.rb +1 -1
  72. data/lib/lingara/models/lesson_plan_create_request.rb +1 -1
  73. data/lib/lingara/models/lesson_plan_failed_data.rb +1 -1
  74. data/lib/lingara/models/lesson_plan_ready_data.rb +1 -1
  75. data/lib/lingara/models/link_status.rb +1 -1
  76. data/lib/lingara/models/notice.rb +1 -1
  77. data/lib/lingara/models/npc.rb +1 -1
  78. data/lib/lingara/models/npc_disposition.rb +299 -0
  79. data/lib/lingara/models/npc_language.rb +1 -1
  80. data/lib/lingara/models/pedagogy.rb +1 -1
  81. data/lib/lingara/models/plan_fail_reason.rb +1 -1
  82. data/lib/lingara/models/plan_fragment.rb +265 -0
  83. data/lib/lingara/models/plan_pending.rb +1 -1
  84. data/lib/lingara/models/plan_phase.rb +1 -1
  85. data/lib/lingara/models/plan_question.rb +1 -1
  86. data/lib/lingara/models/plan_ready_status.rb +1 -1
  87. data/lib/lingara/models/plan_reason.rb +42 -0
  88. data/lib/lingara/models/plan_result.rb +1 -1
  89. data/lib/lingara/models/plan_set.rb +1 -1
  90. data/lib/lingara/models/plan_started.rb +1 -1
  91. data/lib/lingara/models/plan_status.rb +1 -1
  92. data/lib/lingara/models/plan_word.rb +1 -1
  93. data/lib/lingara/models/practice_completed_data.rb +1 -1
  94. data/lib/lingara/models/practice_item.rb +1 -1
  95. data/lib/lingara/models/practice_outcome.rb +1 -1
  96. data/lib/lingara/models/reaction_report.rb +1 -1
  97. data/lib/lingara/models/reaction_status.rb +1 -1
  98. data/lib/lingara/models/rename_canvas_request.rb +1 -1
  99. data/lib/lingara/models/rename_dialogue_request.rb +1 -1
  100. data/lib/lingara/models/save_canvas_draft_request.rb +1 -1
  101. data/lib/lingara/models/save_dialogue_draft_request.rb +2 -2
  102. data/lib/lingara/models/send_dialogue_turn_event_delta.rb +1 -1
  103. data/lib/lingara/models/send_dialogue_turn_event_done.rb +1 -1
  104. data/lib/lingara/models/send_dialogue_turn_event_error.rb +1 -1
  105. data/lib/lingara/models/send_dialogue_turn_event_notice.rb +1 -1
  106. data/lib/lingara/models/send_dialogue_turn_event_transition.rb +1 -1
  107. data/lib/lingara/models/send_tutor_message_event_delta.rb +1 -1
  108. data/lib/lingara/models/send_tutor_message_event_done.rb +1 -1
  109. data/lib/lingara/models/send_tutor_message_event_error.rb +1 -1
  110. data/lib/lingara/models/send_tutor_message_event_notice.rb +1 -1
  111. data/lib/lingara/models/speaker.rb +1 -1
  112. data/lib/lingara/models/stream_error.rb +1 -1
  113. data/lib/lingara/models/stream_events_event_done.rb +1 -1
  114. data/lib/lingara/models/stream_events_event_error.rb +1 -1
  115. data/lib/lingara/models/stream_events_event_event.rb +1 -1
  116. data/lib/lingara/models/stream_lesson_plan_event_error.rb +1 -1
  117. data/lib/lingara/models/stream_lesson_plan_event_pending.rb +1 -1
  118. data/lib/lingara/models/stream_lesson_plan_event_phase.rb +1 -1
  119. data/lib/lingara/models/stream_lesson_plan_event_result.rb +1 -1
  120. data/lib/lingara/models/stream_lesson_plan_event_started.rb +1 -1
  121. data/lib/lingara/models/threshold_scope.rb +1 -1
  122. data/lib/lingara/models/turn_delta.rb +1 -1
  123. data/lib/lingara/models/turn_entry.rb +1 -1
  124. data/lib/lingara/models/turn_role.rb +1 -1
  125. data/lib/lingara/models/tutor_turn_request.rb +1 -1
  126. data/lib/lingara/models/update_available.rb +1 -1
  127. data/lib/lingara/models/usage.rb +1 -1
  128. data/lib/lingara/models/usage_ledger.rb +1 -1
  129. data/lib/lingara/models/usage_threshold_reached_data.rb +1 -1
  130. data/lib/lingara/models/version_detail.rb +1 -1
  131. data/lib/lingara/models/version_history_entry.rb +1 -1
  132. data/lib/lingara/models/version_list.rb +1 -1
  133. data/lib/lingara/models/version_spec.rb +1 -1
  134. data/lib/lingara/models/version_state.rb +1 -1
  135. data/lib/lingara/models/version_summary.rb +1 -1
  136. data/lib/lingara/models/visited_beat.rb +269 -0
  137. data/lib/lingara/models/vocab_example.rb +1 -1
  138. data/lib/lingara/models/vocab_item.rb +1 -1
  139. data/lib/lingara/models/vocab_meta.rb +1 -1
  140. data/lib/lingara/models/vocab_request.rb +1 -1
  141. data/lib/lingara/models/vocab_started.rb +1 -1
  142. data/lib/lingara/models/world_context_changed.rb +1 -1
  143. data/lib/lingara/models/world_practice_completed.rb +1 -1
  144. data/lib/lingara/models/world_practice_requested.rb +1 -1
  145. data/lib/lingara/operations.rb +9 -0
  146. data/lib/lingara/response.rb +6 -1
  147. data/lib/lingara/version.rb +3 -3
  148. data/sig/lingara.rbs +3 -0
  149. metadata +14 -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-expensive-sauger
6
+ The version of the OpenAPI document: 2026-10-dauntless-hoopoe
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-expensive-sauger
6
+ The version of the OpenAPI document: 2026-10-dauntless-hoopoe
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -0,0 +1,299 @@
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-dauntless-hoopoe
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 NpcDisposition
18
+ attr_accessor :suggestibility
19
+
20
+ attr_accessor :initiative
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'suggestibility' => :'suggestibility',
26
+ :'initiative' => :'initiative'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'suggestibility' => :'Float',
44
+ :'initiative' => :'Float'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Lingara::NpcDisposition` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Lingara::NpcDisposition`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'suggestibility')
71
+ self.suggestibility = attributes[:'suggestibility']
72
+ else
73
+ self.suggestibility = nil
74
+ end
75
+
76
+ if attributes.key?(:'initiative')
77
+ self.initiative = attributes[:'initiative']
78
+ else
79
+ self.initiative = nil
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if @suggestibility.nil?
89
+ invalid_properties.push('invalid value for "suggestibility", suggestibility cannot be nil.')
90
+ end
91
+
92
+ if @suggestibility > 1
93
+ invalid_properties.push('invalid value for "suggestibility", must be smaller than or equal to 1.')
94
+ end
95
+
96
+ if @suggestibility < 0
97
+ invalid_properties.push('invalid value for "suggestibility", must be greater than or equal to 0.')
98
+ end
99
+
100
+ if @initiative.nil?
101
+ invalid_properties.push('invalid value for "initiative", initiative cannot be nil.')
102
+ end
103
+
104
+ if @initiative > 1
105
+ invalid_properties.push('invalid value for "initiative", must be smaller than or equal to 1.')
106
+ end
107
+
108
+ if @initiative < 0
109
+ invalid_properties.push('invalid value for "initiative", must be greater than or equal to 0.')
110
+ end
111
+
112
+ invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ warn '[DEPRECATED] the `valid?` method is obsolete'
119
+ return false if @suggestibility.nil?
120
+ return false if @suggestibility > 1
121
+ return false if @suggestibility < 0
122
+ return false if @initiative.nil?
123
+ return false if @initiative > 1
124
+ return false if @initiative < 0
125
+ true
126
+ end
127
+
128
+ # Custom attribute writer method with validation
129
+ # @param [Object] suggestibility Value to be assigned
130
+ def suggestibility=(suggestibility)
131
+ if suggestibility.nil?
132
+ fail ArgumentError, 'suggestibility cannot be nil'
133
+ end
134
+
135
+ if suggestibility > 1
136
+ fail ArgumentError, 'invalid value for "suggestibility", must be smaller than or equal to 1.'
137
+ end
138
+
139
+ if suggestibility < 0
140
+ fail ArgumentError, 'invalid value for "suggestibility", must be greater than or equal to 0.'
141
+ end
142
+
143
+ @suggestibility = suggestibility
144
+ end
145
+
146
+ # Custom attribute writer method with validation
147
+ # @param [Object] initiative Value to be assigned
148
+ def initiative=(initiative)
149
+ if initiative.nil?
150
+ fail ArgumentError, 'initiative cannot be nil'
151
+ end
152
+
153
+ if initiative > 1
154
+ fail ArgumentError, 'invalid value for "initiative", must be smaller than or equal to 1.'
155
+ end
156
+
157
+ if initiative < 0
158
+ fail ArgumentError, 'invalid value for "initiative", must be greater than or equal to 0.'
159
+ end
160
+
161
+ @initiative = initiative
162
+ end
163
+
164
+ # Checks equality by comparing each attribute.
165
+ # @param [Object] Object to be compared
166
+ def ==(o)
167
+ return true if self.equal?(o)
168
+ self.class == o.class &&
169
+ suggestibility == o.suggestibility &&
170
+ initiative == o.initiative
171
+ end
172
+
173
+ # @see the `==` method
174
+ # @param [Object] Object to be compared
175
+ def eql?(o)
176
+ self == o
177
+ end
178
+
179
+ # Calculates hash code according to all attributes.
180
+ # @return [Integer] Hash code
181
+ def hash
182
+ [suggestibility, initiative].hash
183
+ end
184
+
185
+ # Builds the object from hash
186
+ # @param [Hash] attributes Model attributes in the form of hash
187
+ # @return [Object] Returns the model itself
188
+ def self.build_from_hash(attributes)
189
+ return nil unless attributes.is_a?(Hash)
190
+ attributes = attributes.transform_keys(&:to_sym)
191
+ transformed_hash = {}
192
+ openapi_types.each_pair do |key, type|
193
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
194
+ transformed_hash["#{key}"] = nil
195
+ elsif type =~ /\AArray<(.*)>/i
196
+ # check to ensure the input is an array given that the attribute
197
+ # is documented as an array but the input is not
198
+ if attributes[attribute_map[key]].is_a?(Array)
199
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
200
+ end
201
+ elsif !attributes[attribute_map[key]].nil?
202
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
203
+ end
204
+ end
205
+ new(transformed_hash)
206
+ end
207
+
208
+ # Deserializes the data based on type
209
+ # @param string type Data type
210
+ # @param string value Value to be deserialized
211
+ # @return [Object] Deserialized data
212
+ def self._deserialize(type, value)
213
+ case type.to_sym
214
+ when :Time
215
+ Time.parse(value)
216
+ when :Date
217
+ Date.parse(value)
218
+ when :String
219
+ value.to_s
220
+ when :Integer
221
+ value.to_i
222
+ when :Float
223
+ value.to_f
224
+ when :Boolean
225
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
226
+ true
227
+ else
228
+ false
229
+ end
230
+ when :Object
231
+ # generic object (usually a Hash), return directly
232
+ value
233
+ when /\AArray<(?<inner_type>.+)>\z/
234
+ inner_type = Regexp.last_match[:inner_type]
235
+ value.map { |v| _deserialize(inner_type, v) }
236
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
237
+ k_type = Regexp.last_match[:k_type]
238
+ v_type = Regexp.last_match[:v_type]
239
+ {}.tap do |hash|
240
+ value.each do |k, v|
241
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
242
+ end
243
+ end
244
+ else # model
245
+ # models (e.g. Pet) or oneOf
246
+ klass = Lingara.const_get(type)
247
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
248
+ end
249
+ end
250
+
251
+ # Returns the string representation of the object
252
+ # @return [String] String presentation of the object
253
+ def to_s
254
+ to_hash.to_s
255
+ end
256
+
257
+ # to_body is an alias to to_hash (backward compatibility)
258
+ # @return [Hash] Returns the object in the form of hash
259
+ def to_body
260
+ to_hash
261
+ end
262
+
263
+ # Returns the object in the form of hash
264
+ # @return [Hash] Returns the object in the form of hash
265
+ def to_hash
266
+ hash = {}
267
+ self.class.attribute_map.each_pair do |attr, param|
268
+ value = self.send(attr)
269
+ if value.nil?
270
+ is_nullable = self.class.openapi_nullable.include?(attr)
271
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
272
+ end
273
+
274
+ hash[param] = _to_hash(value)
275
+ end
276
+ hash
277
+ end
278
+
279
+ # Outputs non-array value in the form of hash
280
+ # For object, use to_hash. Otherwise, just return the value
281
+ # @param [Object] value Any valid value
282
+ # @return [Hash] Returns the value in the form of hash
283
+ def _to_hash(value)
284
+ if value.is_a?(Array)
285
+ value.compact.map { |v| _to_hash(v) }
286
+ elsif value.is_a?(Hash)
287
+ {}.tap do |hash|
288
+ value.each { |k, v| hash[k] = _to_hash(v) }
289
+ end
290
+ elsif value.respond_to? :to_hash
291
+ value.to_hash
292
+ else
293
+ value
294
+ end
295
+ end
296
+
297
+ end
298
+
299
+ 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-expensive-sauger
6
+ The version of the OpenAPI document: 2026-10-dauntless-hoopoe
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-expensive-sauger
6
+ The version of the OpenAPI document: 2026-10-dauntless-hoopoe
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-expensive-sauger
6
+ The version of the OpenAPI document: 2026-10-dauntless-hoopoe
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -0,0 +1,265 @@
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-dauntless-hoopoe
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 PlanFragment
18
+ attr_accessor :anchor
19
+
20
+ attr_accessor :beats
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'anchor' => :'anchor',
26
+ :'beats' => :'beats'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'anchor' => :'String',
44
+ :'beats' => :'Array<Beat>'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Lingara::PlanFragment` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Lingara::PlanFragment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'anchor')
71
+ self.anchor = attributes[:'anchor']
72
+ else
73
+ self.anchor = nil
74
+ end
75
+
76
+ if attributes.key?(:'beats')
77
+ if (value = attributes[:'beats']).is_a?(Array)
78
+ self.beats = value
79
+ end
80
+ else
81
+ self.beats = nil
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
89
+ invalid_properties = Array.new
90
+ if @anchor.nil?
91
+ invalid_properties.push('invalid value for "anchor", anchor cannot be nil.')
92
+ end
93
+
94
+ if @beats.nil?
95
+ invalid_properties.push('invalid value for "beats", beats cannot be nil.')
96
+ end
97
+
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ warn '[DEPRECATED] the `valid?` method is obsolete'
105
+ return false if @anchor.nil?
106
+ return false if @beats.nil?
107
+ true
108
+ end
109
+
110
+ # Custom attribute writer method with validation
111
+ # @param [Object] anchor Value to be assigned
112
+ def anchor=(anchor)
113
+ if anchor.nil?
114
+ fail ArgumentError, 'anchor cannot be nil'
115
+ end
116
+
117
+ @anchor = anchor
118
+ end
119
+
120
+ # Custom attribute writer method with validation
121
+ # @param [Object] beats Value to be assigned
122
+ def beats=(beats)
123
+ if beats.nil?
124
+ fail ArgumentError, 'beats cannot be nil'
125
+ end
126
+
127
+ @beats = beats
128
+ end
129
+
130
+ # Checks equality by comparing each attribute.
131
+ # @param [Object] Object to be compared
132
+ def ==(o)
133
+ return true if self.equal?(o)
134
+ self.class == o.class &&
135
+ anchor == o.anchor &&
136
+ beats == o.beats
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Integer] Hash code
147
+ def hash
148
+ [anchor, beats].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def self.build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ attributes = attributes.transform_keys(&:to_sym)
157
+ transformed_hash = {}
158
+ openapi_types.each_pair do |key, type|
159
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = nil
161
+ elsif type =~ /\AArray<(.*)>/i
162
+ # check to ensure the input is an array given that the attribute
163
+ # is documented as an array but the input is not
164
+ if attributes[attribute_map[key]].is_a?(Array)
165
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
166
+ end
167
+ elsif !attributes[attribute_map[key]].nil?
168
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
169
+ end
170
+ end
171
+ new(transformed_hash)
172
+ end
173
+
174
+ # Deserializes the data based on type
175
+ # @param string type Data type
176
+ # @param string value Value to be deserialized
177
+ # @return [Object] Deserialized data
178
+ def self._deserialize(type, value)
179
+ case type.to_sym
180
+ when :Time
181
+ Time.parse(value)
182
+ when :Date
183
+ Date.parse(value)
184
+ when :String
185
+ value.to_s
186
+ when :Integer
187
+ value.to_i
188
+ when :Float
189
+ value.to_f
190
+ when :Boolean
191
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
192
+ true
193
+ else
194
+ false
195
+ end
196
+ when :Object
197
+ # generic object (usually a Hash), return directly
198
+ value
199
+ when /\AArray<(?<inner_type>.+)>\z/
200
+ inner_type = Regexp.last_match[:inner_type]
201
+ value.map { |v| _deserialize(inner_type, v) }
202
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
203
+ k_type = Regexp.last_match[:k_type]
204
+ v_type = Regexp.last_match[:v_type]
205
+ {}.tap do |hash|
206
+ value.each do |k, v|
207
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
208
+ end
209
+ end
210
+ else # model
211
+ # models (e.g. Pet) or oneOf
212
+ klass = Lingara.const_get(type)
213
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
214
+ end
215
+ end
216
+
217
+ # Returns the string representation of the object
218
+ # @return [String] String presentation of the object
219
+ def to_s
220
+ to_hash.to_s
221
+ end
222
+
223
+ # to_body is an alias to to_hash (backward compatibility)
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_body
226
+ to_hash
227
+ end
228
+
229
+ # Returns the object in the form of hash
230
+ # @return [Hash] Returns the object in the form of hash
231
+ def to_hash
232
+ hash = {}
233
+ self.class.attribute_map.each_pair do |attr, param|
234
+ value = self.send(attr)
235
+ if value.nil?
236
+ is_nullable = self.class.openapi_nullable.include?(attr)
237
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
238
+ end
239
+
240
+ hash[param] = _to_hash(value)
241
+ end
242
+ hash
243
+ end
244
+
245
+ # Outputs non-array value in the form of hash
246
+ # For object, use to_hash. Otherwise, just return the value
247
+ # @param [Object] value Any valid value
248
+ # @return [Hash] Returns the value in the form of hash
249
+ def _to_hash(value)
250
+ if value.is_a?(Array)
251
+ value.compact.map { |v| _to_hash(v) }
252
+ elsif value.is_a?(Hash)
253
+ {}.tap do |hash|
254
+ value.each { |k, v| hash[k] = _to_hash(v) }
255
+ end
256
+ elsif value.respond_to? :to_hash
257
+ value.to_hash
258
+ else
259
+ value
260
+ end
261
+ end
262
+
263
+ end
264
+
265
+ 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-expensive-sauger
6
+ The version of the OpenAPI document: 2026-10-dauntless-hoopoe
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-expensive-sauger
6
+ The version of the OpenAPI document: 2026-10-dauntless-hoopoe
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-expensive-sauger
6
+ The version of the OpenAPI document: 2026-10-dauntless-hoopoe
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-expensive-sauger
6
+ The version of the OpenAPI document: 2026-10-dauntless-hoopoe
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.14.0
@@ -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-dauntless-hoopoe
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 PlanReason
18
+ START = "start".freeze
19
+ CROSSED = "crossed".freeze
20
+ EXHAUSTED = "exhausted".freeze
21
+ UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze
22
+
23
+ def self.all_vars
24
+ @all_vars ||= [START, CROSSED, EXHAUSTED, 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 PlanReason.all_vars.include?(value)
39
+ raise "Invalid ENUM value #{value} for class #PlanReason"
40
+ end
41
+ end
42
+ end