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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 036ad517cca18cf58d747419eec0e33e9a99b63c32d03501010bd830812f95a1
4
- data.tar.gz: 6358d969bc3e00cc27e67948d8d1157855d79ac512eaa2acbc79a67e7df38524
3
+ metadata.gz: 4ffe9d87ddac253f540c66ddac565ada4acfb67d20915c078c23435538b76e81
4
+ data.tar.gz: f042d0f9783740947c0b7d479f16064b07f37ebe87f40b31fda724c7f121fb0e
5
5
  SHA512:
6
- metadata.gz: a1aa17ebd4a8eb05a87b0bacf94c04afda1f66cc1c3c89789ca89e9d7931da72a88941e1bd4b6d407f63f24b56581b30b7057de9c9ff37d77db731ade6ed0972
7
- data.tar.gz: cd1c73956a79536e0e13b3087a31d047e1d27bf78b38054bf944cc424632d07a245643d04206942318ffd816218f4e76f69e821e201e60e14acf1866d3ff8b3e
6
+ metadata.gz: b72b7eeaa78fcda92994d4b2ed449cdb12bcfacc78976a7e2def49f227394debaef73ad672493333d5906df09f5541953b63c67d4b08c617ce7e1b1942f4e731
7
+ data.tar.gz: 93b02d3cdccb2188a8b99d674919df3d1b967fbd1369d279f242bf379004f9bd75de898fd2579aae23198ef10cdc3a5515866aad7d47f5e490647cbe6fbe9987
data/README.md CHANGED
@@ -212,6 +212,23 @@ a `429` or `503` raises `Lingara::ApiError` at once with its `retry_after`,
212
212
  and you decide whether to send the turn again. No retry helps
213
213
  `403 embed_needs_metered` or `422 safety_input_flagged` (say something else).
214
214
 
215
+ `client.plan_dialogue(document:, npc:, reason:, id_prefix:, turns:, beats:, ...)`
216
+ plans the next beats of a Procedural dialogue: call it when you run one
217
+ outside the embed kits (inside them, the kit calls it). Its `value` is a
218
+ `Lingara::DialoguePlanResponseOneOf` (`status` `"planned"`, a typed
219
+ `fragment`) or a `Lingara::DialoguePlanResponseOneOf1` (`status` `"kept"`, a
220
+ `reason`). A keep is a result, never an error: your frontier stands (on a
221
+ first plan, walk the deterministic seed). The `document:` is sent as given
222
+ and no fact value is sent, only which topics and goals hold; the fragment is
223
+ validated by the server and the embed core (`lingara-dialogue-ir`), never by
224
+ the library. It is **never retried**, like the turn, so a `429` or `503`
225
+ raises `Lingara::ApiError` at once with its `retry_after`. The library sets
226
+ no plan timeout of its own (the server keeps after 10 s). Cost: one
227
+ `embed:play` unit per call, a `kept` and every refusal after admission
228
+ included. `KeptReason` and `AtomKind` are closed, so a reason or atom a later
229
+ spec adds fails the whole answer's decode (`:malformed_response`) until you
230
+ upgrade.
231
+
215
232
  `practice.completed` arrives typed as `Lingara::Events::PracticeCompleted` on
216
233
  the feed, the tail and webhooks, and your client needs `events:read` and
217
234
  `embed:play` to hear it. A game reports practice with
@@ -209,6 +209,19 @@ module Lingara
209
209
  stream("sendDialogueTurn", [], body, policy: @tail_policy, &block)
210
210
  end
211
211
 
212
+ # Plans the next beats of a Procedural dialogue (scope embed:play, a
213
+ # metered payer only; ADR 3.11.26n). Returns a Response whose value is a
214
+ # DialoguePlanResponseOneOf (status "planned", a typed fragment) or a
215
+ # DialoguePlanResponseOneOf1 (status "kept", a reason): a keep is a
216
+ # result, never an error. The document is sent as given and nothing is
217
+ # validated here. Never retried, as the turn is not: each call spends one
218
+ # embed:play unit, a keep and every refusal after admission included, so
219
+ # a 429 or 503 is raised at once with its retry_after.
220
+ def plan_dialogue(**body)
221
+ operation = OPERATIONS.fetch("planDialogue")
222
+ json("planDialogue", [], body: payload(operation, body), policy: @tail_policy)
223
+ end
224
+
212
225
  def to_s
213
226
  inspect
214
227
  end
@@ -232,11 +245,13 @@ module Lingara
232
245
 
233
246
  # +body+ is JSON text already; +headers+ join every attempt's. +decode+
234
247
  # replaces the generated model's decoding (create_embed_token's).
235
- def json(id, args, query: nil, body: nil, headers: {}, decode: nil)
248
+ # +policy+ is the single-attempt one for a call that must not be retried
249
+ # (plan_dialogue).
250
+ def json(id, args, query: nil, body: nil, headers: {}, decode: nil, policy: @policy)
236
251
  operation = OPERATIONS.fetch(id)
237
252
  url = url_for(operation, args, query)
238
253
  decode ||= ->(text) { Decoding.response(operation[:response], text) }
239
- pipeline(operation, url, body, headers: headers) do |response, _phase, observe|
254
+ pipeline(operation, url, body, headers: headers, policy: policy) do |response, _phase, observe|
240
255
  served = observe.call(response)
241
256
  Response.new(value: decode.call(response.body.to_s), served_version: served)
242
257
  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
@@ -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,44 @@
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 AtomKind
18
+ OPEN = "open".freeze
19
+ ELICIT = "elicit".freeze
20
+ REVEAL = "reveal".freeze
21
+ PRACTISE = "practise".freeze
22
+ CLOSE = "close".freeze
23
+ UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze
24
+
25
+ def self.all_vars
26
+ @all_vars ||= [OPEN, ELICIT, REVEAL, PRACTISE, CLOSE, UNKNOWN_DEFAULT_OPEN_API].freeze
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def self.build_from_hash(value)
33
+ new.build_from_hash(value)
34
+ end
35
+
36
+ # Builds the enum from string
37
+ # @param [String] The enum value in the form of the string
38
+ # @return [String] The enum value
39
+ def build_from_hash(value)
40
+ return value if AtomKind.all_vars.include?(value)
41
+ raise "Invalid ENUM value #{value} for class #AtomKind"
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,389 @@
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 Beat
18
+ attr_accessor :id
19
+
20
+ attr_accessor :atom
21
+
22
+ attr_accessor :depth
23
+
24
+ attr_accessor :sketch
25
+
26
+ attr_accessor :topic
27
+
28
+ attr_accessor :goal
29
+
30
+ attr_accessor :ending
31
+
32
+ attr_accessor :angle
33
+
34
+ attr_accessor :exits
35
+
36
+ class EnumAttributeValidator
37
+ attr_reader :datatype
38
+ attr_reader :allowable_values
39
+
40
+ def initialize(datatype, allowable_values)
41
+ @allowable_values = allowable_values.map do |value|
42
+ case datatype.to_s
43
+ when /Integer/i
44
+ value.to_i
45
+ when /Float/i
46
+ value.to_f
47
+ else
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ def valid?(value)
54
+ !value || allowable_values.include?(value)
55
+ end
56
+ end
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'id' => :'id',
62
+ :'atom' => :'atom',
63
+ :'depth' => :'depth',
64
+ :'sketch' => :'sketch',
65
+ :'topic' => :'topic',
66
+ :'goal' => :'goal',
67
+ :'ending' => :'ending',
68
+ :'angle' => :'angle',
69
+ :'exits' => :'exits'
70
+ }
71
+ end
72
+
73
+ # Returns attribute mapping this model knows about
74
+ def self.acceptable_attribute_map
75
+ attribute_map
76
+ end
77
+
78
+ # Returns all the JSON keys this model knows about
79
+ def self.acceptable_attributes
80
+ acceptable_attribute_map.values
81
+ end
82
+
83
+ # Attribute type mapping.
84
+ def self.openapi_types
85
+ {
86
+ :'id' => :'String',
87
+ :'atom' => :'AtomKind',
88
+ :'depth' => :'Integer',
89
+ :'sketch' => :'Boolean',
90
+ :'topic' => :'String',
91
+ :'goal' => :'String',
92
+ :'ending' => :'String',
93
+ :'angle' => :'String',
94
+ :'exits' => :'Array<Exit>'
95
+ }
96
+ end
97
+
98
+ # List of attributes with nullable: true
99
+ def self.openapi_nullable
100
+ Set.new([
101
+ :'topic',
102
+ :'goal',
103
+ :'ending',
104
+ :'angle',
105
+ ])
106
+ end
107
+
108
+ # Initializes the object
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ def initialize(attributes = {})
111
+ if (!attributes.is_a?(Hash))
112
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Lingara::Beat` initialize method"
113
+ end
114
+
115
+ # check to see if the attribute exists and convert string to symbol for hash key
116
+ acceptable_attribute_map = self.class.acceptable_attribute_map
117
+ attributes = attributes.each_with_object({}) { |(k, v), h|
118
+ if (!acceptable_attribute_map.key?(k.to_sym))
119
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Lingara::Beat`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
120
+ end
121
+ h[k.to_sym] = v
122
+ }
123
+
124
+ if attributes.key?(:'id')
125
+ self.id = attributes[:'id']
126
+ else
127
+ self.id = nil
128
+ end
129
+
130
+ if attributes.key?(:'atom')
131
+ self.atom = attributes[:'atom']
132
+ else
133
+ self.atom = nil
134
+ end
135
+
136
+ if attributes.key?(:'depth')
137
+ self.depth = attributes[:'depth']
138
+ else
139
+ self.depth = nil
140
+ end
141
+
142
+ if attributes.key?(:'sketch')
143
+ self.sketch = attributes[:'sketch']
144
+ end
145
+
146
+ if attributes.key?(:'topic')
147
+ self.topic = attributes[:'topic']
148
+ end
149
+
150
+ if attributes.key?(:'goal')
151
+ self.goal = attributes[:'goal']
152
+ end
153
+
154
+ if attributes.key?(:'ending')
155
+ self.ending = attributes[:'ending']
156
+ end
157
+
158
+ if attributes.key?(:'angle')
159
+ self.angle = attributes[:'angle']
160
+ end
161
+
162
+ if attributes.key?(:'exits')
163
+ if (value = attributes[:'exits']).is_a?(Array)
164
+ self.exits = value
165
+ end
166
+ end
167
+ end
168
+
169
+ # Show invalid properties with the reasons. Usually used together with valid?
170
+ # @return Array for valid properties with the reasons
171
+ def list_invalid_properties
172
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
173
+ invalid_properties = Array.new
174
+ if @id.nil?
175
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
176
+ end
177
+
178
+ if @atom.nil?
179
+ invalid_properties.push('invalid value for "atom", atom cannot be nil.')
180
+ end
181
+
182
+ if @depth.nil?
183
+ invalid_properties.push('invalid value for "depth", depth cannot be nil.')
184
+ end
185
+
186
+ if @depth > 255
187
+ invalid_properties.push('invalid value for "depth", must be smaller than or equal to 255.')
188
+ end
189
+
190
+ if @depth < 0
191
+ invalid_properties.push('invalid value for "depth", must be greater than or equal to 0.')
192
+ end
193
+
194
+ invalid_properties
195
+ end
196
+
197
+ # Check to see if the all the properties in the model are valid
198
+ # @return true if the model is valid
199
+ def valid?
200
+ warn '[DEPRECATED] the `valid?` method is obsolete'
201
+ return false if @id.nil?
202
+ return false if @atom.nil?
203
+ return false if @depth.nil?
204
+ return false if @depth > 255
205
+ return false if @depth < 0
206
+ true
207
+ end
208
+
209
+ # Custom attribute writer method with validation
210
+ # @param [Object] id Value to be assigned
211
+ def id=(id)
212
+ if id.nil?
213
+ fail ArgumentError, 'id cannot be nil'
214
+ end
215
+
216
+ @id = id
217
+ end
218
+
219
+ # Custom attribute writer method with validation
220
+ # @param [Object] atom Value to be assigned
221
+ def atom=(atom)
222
+ if atom.nil?
223
+ fail ArgumentError, 'atom cannot be nil'
224
+ end
225
+
226
+ @atom = atom
227
+ end
228
+
229
+ # Custom attribute writer method with validation
230
+ # @param [Object] depth Value to be assigned
231
+ def depth=(depth)
232
+ if depth.nil?
233
+ fail ArgumentError, 'depth cannot be nil'
234
+ end
235
+
236
+ if depth > 255
237
+ fail ArgumentError, 'invalid value for "depth", must be smaller than or equal to 255.'
238
+ end
239
+
240
+ if depth < 0
241
+ fail ArgumentError, 'invalid value for "depth", must be greater than or equal to 0.'
242
+ end
243
+
244
+ @depth = depth
245
+ end
246
+
247
+ # Checks equality by comparing each attribute.
248
+ # @param [Object] Object to be compared
249
+ def ==(o)
250
+ return true if self.equal?(o)
251
+ self.class == o.class &&
252
+ id == o.id &&
253
+ atom == o.atom &&
254
+ depth == o.depth &&
255
+ sketch == o.sketch &&
256
+ topic == o.topic &&
257
+ goal == o.goal &&
258
+ ending == o.ending &&
259
+ angle == o.angle &&
260
+ exits == o.exits
261
+ end
262
+
263
+ # @see the `==` method
264
+ # @param [Object] Object to be compared
265
+ def eql?(o)
266
+ self == o
267
+ end
268
+
269
+ # Calculates hash code according to all attributes.
270
+ # @return [Integer] Hash code
271
+ def hash
272
+ [id, atom, depth, sketch, topic, goal, ending, angle, exits].hash
273
+ end
274
+
275
+ # Builds the object from hash
276
+ # @param [Hash] attributes Model attributes in the form of hash
277
+ # @return [Object] Returns the model itself
278
+ def self.build_from_hash(attributes)
279
+ return nil unless attributes.is_a?(Hash)
280
+ attributes = attributes.transform_keys(&:to_sym)
281
+ transformed_hash = {}
282
+ openapi_types.each_pair do |key, type|
283
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
284
+ transformed_hash["#{key}"] = nil
285
+ elsif type =~ /\AArray<(.*)>/i
286
+ # check to ensure the input is an array given that the attribute
287
+ # is documented as an array but the input is not
288
+ if attributes[attribute_map[key]].is_a?(Array)
289
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
290
+ end
291
+ elsif !attributes[attribute_map[key]].nil?
292
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
293
+ end
294
+ end
295
+ new(transformed_hash)
296
+ end
297
+
298
+ # Deserializes the data based on type
299
+ # @param string type Data type
300
+ # @param string value Value to be deserialized
301
+ # @return [Object] Deserialized data
302
+ def self._deserialize(type, value)
303
+ case type.to_sym
304
+ when :Time
305
+ Time.parse(value)
306
+ when :Date
307
+ Date.parse(value)
308
+ when :String
309
+ value.to_s
310
+ when :Integer
311
+ value.to_i
312
+ when :Float
313
+ value.to_f
314
+ when :Boolean
315
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
316
+ true
317
+ else
318
+ false
319
+ end
320
+ when :Object
321
+ # generic object (usually a Hash), return directly
322
+ value
323
+ when /\AArray<(?<inner_type>.+)>\z/
324
+ inner_type = Regexp.last_match[:inner_type]
325
+ value.map { |v| _deserialize(inner_type, v) }
326
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
327
+ k_type = Regexp.last_match[:k_type]
328
+ v_type = Regexp.last_match[:v_type]
329
+ {}.tap do |hash|
330
+ value.each do |k, v|
331
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
332
+ end
333
+ end
334
+ else # model
335
+ # models (e.g. Pet) or oneOf
336
+ klass = Lingara.const_get(type)
337
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
338
+ end
339
+ end
340
+
341
+ # Returns the string representation of the object
342
+ # @return [String] String presentation of the object
343
+ def to_s
344
+ to_hash.to_s
345
+ end
346
+
347
+ # to_body is an alias to to_hash (backward compatibility)
348
+ # @return [Hash] Returns the object in the form of hash
349
+ def to_body
350
+ to_hash
351
+ end
352
+
353
+ # Returns the object in the form of hash
354
+ # @return [Hash] Returns the object in the form of hash
355
+ def to_hash
356
+ hash = {}
357
+ self.class.attribute_map.each_pair do |attr, param|
358
+ value = self.send(attr)
359
+ if value.nil?
360
+ is_nullable = self.class.openapi_nullable.include?(attr)
361
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
362
+ end
363
+
364
+ hash[param] = _to_hash(value)
365
+ end
366
+ hash
367
+ end
368
+
369
+ # Outputs non-array value in the form of hash
370
+ # For object, use to_hash. Otherwise, just return the value
371
+ # @param [Object] value Any valid value
372
+ # @return [Hash] Returns the value in the form of hash
373
+ def _to_hash(value)
374
+ if value.is_a?(Array)
375
+ value.compact.map { |v| _to_hash(v) }
376
+ elsif value.is_a?(Hash)
377
+ {}.tap do |hash|
378
+ value.each { |k, v| hash[k] = _to_hash(v) }
379
+ end
380
+ elsif value.respond_to? :to_hash
381
+ value.to_hash
382
+ else
383
+ value
384
+ end
385
+ end
386
+
387
+ end
388
+
389
+ 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
@@ -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