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
@@ -0,0 +1,105 @@
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
+ module DialoguePlanResponse
18
+ class << self
19
+ # List of class defined in oneOf (OpenAPI v3)
20
+ def openapi_one_of
21
+ [
22
+ :'DialoguePlanResponseOneOf',
23
+ :'DialoguePlanResponseOneOf1'
24
+ ]
25
+ end
26
+
27
+ # Builds the object
28
+ # @param [Mixed] Data to be matched against the list of oneOf items
29
+ # @return [Object] Returns the model or the data itself
30
+ def build(data)
31
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
32
+ # Note:
33
+ # - We do not attempt to check whether exactly one item matches.
34
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
35
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
36
+ # - TODO: scalar values are de facto behaving as if they were nullable.
37
+ # - TODO: logging when debugging is set.
38
+ openapi_one_of.each do |klass|
39
+ begin
40
+ next if klass == :AnyType # "nullable: true"
41
+ typed_data = find_and_cast_into_type(klass, data)
42
+ return typed_data if typed_data
43
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
44
+ end
45
+ end
46
+
47
+ openapi_one_of.include?(:AnyType) ? data : nil
48
+ end
49
+
50
+ private
51
+
52
+ SchemaMismatchError = Class.new(StandardError)
53
+
54
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
55
+ def find_and_cast_into_type(klass, data)
56
+ return if data.nil?
57
+
58
+ case klass.to_s
59
+ when 'Boolean'
60
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
61
+ when 'Float'
62
+ return data if data.instance_of?(Float)
63
+ when 'Integer'
64
+ return data if data.instance_of?(Integer)
65
+ when 'Time'
66
+ return Time.parse(data)
67
+ when 'Date'
68
+ return Date.iso8601(data)
69
+ when 'String'
70
+ return data if data.instance_of?(String)
71
+ when 'Object' # "type: object"
72
+ return data if data.instance_of?(Hash)
73
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
74
+ if data.instance_of?(Array)
75
+ sub_type = Regexp.last_match[:sub_type]
76
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
77
+ end
78
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
79
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
80
+ sub_type = Regexp.last_match[:sub_type]
81
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
82
+ end
83
+ else # model
84
+ const = Lingara.const_get(klass)
85
+ if const
86
+ if const.respond_to?(:openapi_one_of) # nested oneOf model
87
+ model = const.build(data)
88
+ return model if model
89
+ else
90
+ # raise if data contains keys that are not known to the model
91
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
92
+ model = const.build_from_hash(data)
93
+ return model if model
94
+ end
95
+ end
96
+ end
97
+
98
+ raise # if no match by now, raise
99
+ rescue
100
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
101
+ end
102
+ end
103
+ end
104
+
105
+ end
@@ -0,0 +1,287 @@
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 DialoguePlanResponseOneOf
18
+ attr_accessor :fragment
19
+
20
+ attr_accessor :status
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
+ :'fragment' => :'fragment',
48
+ :'status' => :'status'
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
+ :'fragment' => :'PlanFragment',
66
+ :'status' => :'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::DialoguePlanResponseOneOf` 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::DialoguePlanResponseOneOf`. 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?(:'fragment')
93
+ self.fragment = attributes[:'fragment']
94
+ else
95
+ self.fragment = nil
96
+ end
97
+
98
+ if attributes.key?(:'status')
99
+ self.status = attributes[:'status']
100
+ else
101
+ self.status = 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 @fragment.nil?
111
+ invalid_properties.push('invalid value for "fragment", fragment cannot be nil.')
112
+ end
113
+
114
+ if @status.nil?
115
+ invalid_properties.push('invalid value for "status", status 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 @fragment.nil?
126
+ return false if @status.nil?
127
+ status_validator = EnumAttributeValidator.new('String', ["planned", "unknown_default_open_api"])
128
+ return false unless status_validator.valid?(@status)
129
+ true
130
+ end
131
+
132
+ # Custom attribute writer method with validation
133
+ # @param [Object] fragment Value to be assigned
134
+ def fragment=(fragment)
135
+ if fragment.nil?
136
+ fail ArgumentError, 'fragment cannot be nil'
137
+ end
138
+
139
+ @fragment = fragment
140
+ end
141
+
142
+ # Custom attribute writer method checking allowed values (enum).
143
+ # @param [Object] status Object to be assigned
144
+ def status=(status)
145
+ validator = EnumAttributeValidator.new('String', ["planned", "unknown_default_open_api"])
146
+ unless validator.valid?(status)
147
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
148
+ end
149
+ @status = status
150
+ end
151
+
152
+ # Checks equality by comparing each attribute.
153
+ # @param [Object] Object to be compared
154
+ def ==(o)
155
+ return true if self.equal?(o)
156
+ self.class == o.class &&
157
+ fragment == o.fragment &&
158
+ status == o.status
159
+ end
160
+
161
+ # @see the `==` method
162
+ # @param [Object] Object to be compared
163
+ def eql?(o)
164
+ self == o
165
+ end
166
+
167
+ # Calculates hash code according to all attributes.
168
+ # @return [Integer] Hash code
169
+ def hash
170
+ [fragment, status].hash
171
+ end
172
+
173
+ # Builds the object from hash
174
+ # @param [Hash] attributes Model attributes in the form of hash
175
+ # @return [Object] Returns the model itself
176
+ def self.build_from_hash(attributes)
177
+ return nil unless attributes.is_a?(Hash)
178
+ attributes = attributes.transform_keys(&:to_sym)
179
+ transformed_hash = {}
180
+ openapi_types.each_pair do |key, type|
181
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
182
+ transformed_hash["#{key}"] = nil
183
+ elsif type =~ /\AArray<(.*)>/i
184
+ # check to ensure the input is an array given that the attribute
185
+ # is documented as an array but the input is not
186
+ if attributes[attribute_map[key]].is_a?(Array)
187
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
188
+ end
189
+ elsif !attributes[attribute_map[key]].nil?
190
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
191
+ end
192
+ end
193
+ new(transformed_hash)
194
+ end
195
+
196
+ # Deserializes the data based on type
197
+ # @param string type Data type
198
+ # @param string value Value to be deserialized
199
+ # @return [Object] Deserialized data
200
+ def self._deserialize(type, value)
201
+ case type.to_sym
202
+ when :Time
203
+ Time.parse(value)
204
+ when :Date
205
+ Date.parse(value)
206
+ when :String
207
+ value.to_s
208
+ when :Integer
209
+ value.to_i
210
+ when :Float
211
+ value.to_f
212
+ when :Boolean
213
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
214
+ true
215
+ else
216
+ false
217
+ end
218
+ when :Object
219
+ # generic object (usually a Hash), return directly
220
+ value
221
+ when /\AArray<(?<inner_type>.+)>\z/
222
+ inner_type = Regexp.last_match[:inner_type]
223
+ value.map { |v| _deserialize(inner_type, v) }
224
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
225
+ k_type = Regexp.last_match[:k_type]
226
+ v_type = Regexp.last_match[:v_type]
227
+ {}.tap do |hash|
228
+ value.each do |k, v|
229
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
230
+ end
231
+ end
232
+ else # model
233
+ # models (e.g. Pet) or oneOf
234
+ klass = Lingara.const_get(type)
235
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
236
+ end
237
+ end
238
+
239
+ # Returns the string representation of the object
240
+ # @return [String] String presentation of the object
241
+ def to_s
242
+ to_hash.to_s
243
+ end
244
+
245
+ # to_body is an alias to to_hash (backward compatibility)
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_body
248
+ to_hash
249
+ end
250
+
251
+ # Returns the object in the form of hash
252
+ # @return [Hash] Returns the object in the form of hash
253
+ def to_hash
254
+ hash = {}
255
+ self.class.attribute_map.each_pair do |attr, param|
256
+ value = self.send(attr)
257
+ if value.nil?
258
+ is_nullable = self.class.openapi_nullable.include?(attr)
259
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
260
+ end
261
+
262
+ hash[param] = _to_hash(value)
263
+ end
264
+ hash
265
+ end
266
+
267
+ # Outputs non-array value in the form of hash
268
+ # For object, use to_hash. Otherwise, just return the value
269
+ # @param [Object] value Any valid value
270
+ # @return [Hash] Returns the value in the form of hash
271
+ def _to_hash(value)
272
+ if value.is_a?(Array)
273
+ value.compact.map { |v| _to_hash(v) }
274
+ elsif value.is_a?(Hash)
275
+ {}.tap do |hash|
276
+ value.each { |k, v| hash[k] = _to_hash(v) }
277
+ end
278
+ elsif value.respond_to? :to_hash
279
+ value.to_hash
280
+ else
281
+ value
282
+ end
283
+ end
284
+
285
+ end
286
+
287
+ end
@@ -0,0 +1,287 @@
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 DialoguePlanResponseOneOf1
18
+ attr_accessor :reason
19
+
20
+ attr_accessor :status
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
+ :'reason' => :'reason',
48
+ :'status' => :'status'
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
+ :'reason' => :'KeptReason',
66
+ :'status' => :'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::DialoguePlanResponseOneOf1` 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::DialoguePlanResponseOneOf1`. 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?(:'reason')
93
+ self.reason = attributes[:'reason']
94
+ else
95
+ self.reason = nil
96
+ end
97
+
98
+ if attributes.key?(:'status')
99
+ self.status = attributes[:'status']
100
+ else
101
+ self.status = 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 @reason.nil?
111
+ invalid_properties.push('invalid value for "reason", reason cannot be nil.')
112
+ end
113
+
114
+ if @status.nil?
115
+ invalid_properties.push('invalid value for "status", status 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 @reason.nil?
126
+ return false if @status.nil?
127
+ status_validator = EnumAttributeValidator.new('String', ["kept", "unknown_default_open_api"])
128
+ return false unless status_validator.valid?(@status)
129
+ true
130
+ end
131
+
132
+ # Custom attribute writer method with validation
133
+ # @param [Object] reason Value to be assigned
134
+ def reason=(reason)
135
+ if reason.nil?
136
+ fail ArgumentError, 'reason cannot be nil'
137
+ end
138
+
139
+ @reason = reason
140
+ end
141
+
142
+ # Custom attribute writer method checking allowed values (enum).
143
+ # @param [Object] status Object to be assigned
144
+ def status=(status)
145
+ validator = EnumAttributeValidator.new('String', ["kept", "unknown_default_open_api"])
146
+ unless validator.valid?(status)
147
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
148
+ end
149
+ @status = status
150
+ end
151
+
152
+ # Checks equality by comparing each attribute.
153
+ # @param [Object] Object to be compared
154
+ def ==(o)
155
+ return true if self.equal?(o)
156
+ self.class == o.class &&
157
+ reason == o.reason &&
158
+ status == o.status
159
+ end
160
+
161
+ # @see the `==` method
162
+ # @param [Object] Object to be compared
163
+ def eql?(o)
164
+ self == o
165
+ end
166
+
167
+ # Calculates hash code according to all attributes.
168
+ # @return [Integer] Hash code
169
+ def hash
170
+ [reason, status].hash
171
+ end
172
+
173
+ # Builds the object from hash
174
+ # @param [Hash] attributes Model attributes in the form of hash
175
+ # @return [Object] Returns the model itself
176
+ def self.build_from_hash(attributes)
177
+ return nil unless attributes.is_a?(Hash)
178
+ attributes = attributes.transform_keys(&:to_sym)
179
+ transformed_hash = {}
180
+ openapi_types.each_pair do |key, type|
181
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
182
+ transformed_hash["#{key}"] = nil
183
+ elsif type =~ /\AArray<(.*)>/i
184
+ # check to ensure the input is an array given that the attribute
185
+ # is documented as an array but the input is not
186
+ if attributes[attribute_map[key]].is_a?(Array)
187
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
188
+ end
189
+ elsif !attributes[attribute_map[key]].nil?
190
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
191
+ end
192
+ end
193
+ new(transformed_hash)
194
+ end
195
+
196
+ # Deserializes the data based on type
197
+ # @param string type Data type
198
+ # @param string value Value to be deserialized
199
+ # @return [Object] Deserialized data
200
+ def self._deserialize(type, value)
201
+ case type.to_sym
202
+ when :Time
203
+ Time.parse(value)
204
+ when :Date
205
+ Date.parse(value)
206
+ when :String
207
+ value.to_s
208
+ when :Integer
209
+ value.to_i
210
+ when :Float
211
+ value.to_f
212
+ when :Boolean
213
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
214
+ true
215
+ else
216
+ false
217
+ end
218
+ when :Object
219
+ # generic object (usually a Hash), return directly
220
+ value
221
+ when /\AArray<(?<inner_type>.+)>\z/
222
+ inner_type = Regexp.last_match[:inner_type]
223
+ value.map { |v| _deserialize(inner_type, v) }
224
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
225
+ k_type = Regexp.last_match[:k_type]
226
+ v_type = Regexp.last_match[:v_type]
227
+ {}.tap do |hash|
228
+ value.each do |k, v|
229
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
230
+ end
231
+ end
232
+ else # model
233
+ # models (e.g. Pet) or oneOf
234
+ klass = Lingara.const_get(type)
235
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
236
+ end
237
+ end
238
+
239
+ # Returns the string representation of the object
240
+ # @return [String] String presentation of the object
241
+ def to_s
242
+ to_hash.to_s
243
+ end
244
+
245
+ # to_body is an alias to to_hash (backward compatibility)
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_body
248
+ to_hash
249
+ end
250
+
251
+ # Returns the object in the form of hash
252
+ # @return [Hash] Returns the object in the form of hash
253
+ def to_hash
254
+ hash = {}
255
+ self.class.attribute_map.each_pair do |attr, param|
256
+ value = self.send(attr)
257
+ if value.nil?
258
+ is_nullable = self.class.openapi_nullable.include?(attr)
259
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
260
+ end
261
+
262
+ hash[param] = _to_hash(value)
263
+ end
264
+ hash
265
+ end
266
+
267
+ # Outputs non-array value in the form of hash
268
+ # For object, use to_hash. Otherwise, just return the value
269
+ # @param [Object] value Any valid value
270
+ # @return [Hash] Returns the value in the form of hash
271
+ def _to_hash(value)
272
+ if value.is_a?(Array)
273
+ value.compact.map { |v| _to_hash(v) }
274
+ elsif value.is_a?(Hash)
275
+ {}.tap do |hash|
276
+ value.each { |k, v| hash[k] = _to_hash(v) }
277
+ end
278
+ elsif value.respond_to? :to_hash
279
+ value.to_hash
280
+ else
281
+ value
282
+ end
283
+ end
284
+
285
+ end
286
+
287
+ 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
@@ -31,10 +31,14 @@ module Lingara
31
31
  TEXT_BLANK = "text_blank".freeze
32
32
  TEXT_MULTILINE = "text_multiline".freeze
33
33
  TEXT_CHAR = "text_char".freeze
34
+ KIND_MISMATCH = "kind_mismatch".freeze
35
+ STEER_TARGET = "steer_target".freeze
36
+ POOL_ESCAPE = "pool_escape".freeze
37
+ ATOM_SET = "atom_set".freeze
34
38
  UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze
35
39
 
36
40
  def self.all_vars
37
- @all_vars ||= [MISSING_MEMBER, UNKNOWN_MEMBER, ID_PATTERN, BOUND, NUMBER_RANGE, DUPLICATE_ID, UNKNOWN_TARGET, OUTCOME_NAME, UNDECLARED_FACT, PREDICATE_UNPARSED, PREDICATE_TYPE, DEFAULT_TYPE, WHEN_LESS_CYCLE, TEXT_BLANK, TEXT_MULTILINE, TEXT_CHAR, UNKNOWN_DEFAULT_OPEN_API].freeze
41
+ @all_vars ||= [MISSING_MEMBER, UNKNOWN_MEMBER, ID_PATTERN, BOUND, NUMBER_RANGE, DUPLICATE_ID, UNKNOWN_TARGET, OUTCOME_NAME, UNDECLARED_FACT, PREDICATE_UNPARSED, PREDICATE_TYPE, DEFAULT_TYPE, WHEN_LESS_CYCLE, TEXT_BLANK, TEXT_MULTILINE, TEXT_CHAR, KIND_MISMATCH, STEER_TARGET, POOL_ESCAPE, ATOM_SET, UNKNOWN_DEFAULT_OPEN_API].freeze
38
42
  end
39
43
 
40
44
  # Builds the enum from string