lingara 0.2.0.pre.alpha.6 → 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.
- checksums.yaml +4 -4
- data/README.md +17 -0
- data/lib/lingara/client.rb +17 -2
- data/lib/lingara/minted_token.rb +33 -7
- data/lib/lingara/models/activate_canvas_request.rb +1 -1
- data/lib/lingara/models/activate_dialogue_request.rb +1 -1
- data/lib/lingara/models/allowance_row.rb +1 -1
- data/lib/lingara/models/app_context_slice.rb +1 -1
- data/lib/lingara/models/app_disabled_data.rb +1 -1
- data/lib/lingara/models/app_enabled_data.rb +1 -1
- data/lib/lingara/models/app_installed_data.rb +1 -1
- data/lib/lingara/models/app_uninstalled_data.rb +1 -1
- data/lib/lingara/models/atom_kind.rb +44 -0
- data/lib/lingara/models/beat.rb +389 -0
- data/lib/lingara/models/canvas.rb +1 -1
- data/lib/lingara/models/canvas_activation_outcome.rb +1 -1
- data/lib/lingara/models/canvas_active.rb +1 -1
- data/lib/lingara/models/canvas_definition.rb +1 -1
- data/lib/lingara/models/canvas_draft.rb +1 -1
- data/lib/lingara/models/canvas_dry_run.rb +1 -1
- data/lib/lingara/models/canvas_edge.rb +1 -1
- data/lib/lingara/models/canvas_made_object.rb +1 -1
- data/lib/lingara/models/canvas_node.rb +1 -1
- data/lib/lingara/models/canvas_node_kind.rb +1 -1
- data/lib/lingara/models/canvas_object_ref.rb +1 -1
- data/lib/lingara/models/canvas_page.rb +1 -1
- data/lib/lingara/models/canvas_param.rb +1 -1
- data/lib/lingara/models/canvas_plan.rb +1 -1
- data/lib/lingara/models/canvas_recipe.rb +1 -1
- data/lib/lingara/models/canvas_summary.rb +1 -1
- data/lib/lingara/models/canvas_verdict.rb +1 -1
- data/lib/lingara/models/canvas_verdict_kind.rb +1 -1
- data/lib/lingara/models/create_canvas_request.rb +1 -1
- data/lib/lingara/models/create_dialogue_request.rb +2 -2
- data/lib/lingara/models/create_lesson_plan_event_error.rb +1 -1
- data/lib/lingara/models/create_lesson_plan_event_phase.rb +1 -1
- data/lib/lingara/models/create_lesson_plan_event_result.rb +1 -1
- data/lib/lingara/models/create_lesson_plan_event_started.rb +1 -1
- data/lib/lingara/models/dialogue.rb +1 -1
- data/lib/lingara/models/dialogue_active.rb +2 -2
- data/lib/lingara/models/dialogue_draft.rb +2 -2
- data/lib/lingara/models/dialogue_entry.rb +1 -1
- data/lib/lingara/models/dialogue_npc.rb +17 -6
- data/lib/lingara/models/dialogue_page.rb +1 -1
- data/lib/lingara/models/dialogue_plan_request.rb +620 -0
- data/lib/lingara/models/dialogue_plan_response.rb +105 -0
- data/lib/lingara/models/dialogue_plan_response_one_of.rb +287 -0
- data/lib/lingara/models/dialogue_plan_response_one_of1.rb +287 -0
- data/lib/lingara/models/dialogue_rule.rb +6 -2
- data/lib/lingara/models/dialogue_summary.rb +1 -1
- data/lib/lingara/models/dialogue_transition.rb +1 -1
- data/lib/lingara/models/dialogue_turn_request.rb +1 -1
- data/lib/lingara/models/dialogue_warning.rb +1 -1
- data/lib/lingara/models/dialogue_warning_code.rb +5 -2
- data/lib/lingara/models/embed_player_link.rb +1 -1
- data/lib/lingara/models/embed_token.rb +16 -5
- data/lib/lingara/models/embed_token_request.rb +43 -6
- data/lib/lingara/models/error_envelope.rb +1 -1
- data/lib/lingara/models/event_envelope.rb +1 -1
- data/lib/lingara/models/event_page.rb +1 -1
- data/lib/lingara/models/exit.rb +247 -0
- data/lib/lingara/models/fact_value.rb +1 -1
- data/lib/lingara/models/generate_vocabulary_event_done.rb +1 -1
- data/lib/lingara/models/generate_vocabulary_event_error.rb +1 -1
- data/lib/lingara/models/generate_vocabulary_event_item.rb +1 -1
- data/lib/lingara/models/generate_vocabulary_event_started.rb +1 -1
- data/lib/lingara/models/graph_checkpoint.rb +40 -5
- data/lib/lingara/models/graph_edge.rb +1 -1
- data/lib/lingara/models/inbound_event_accepted.rb +1 -1
- data/lib/lingara/models/kept_reason.rb +43 -0
- data/lib/lingara/models/lesson_plan.rb +1 -1
- data/lib/lingara/models/lesson_plan_content.rb +1 -1
- data/lib/lingara/models/lesson_plan_create_request.rb +1 -1
- data/lib/lingara/models/lesson_plan_failed_data.rb +1 -1
- data/lib/lingara/models/lesson_plan_ready_data.rb +1 -1
- data/lib/lingara/models/link_status.rb +1 -1
- data/lib/lingara/models/notice.rb +1 -1
- data/lib/lingara/models/npc.rb +1 -1
- data/lib/lingara/models/npc_disposition.rb +299 -0
- data/lib/lingara/models/npc_language.rb +1 -1
- data/lib/lingara/models/pedagogy.rb +1 -1
- data/lib/lingara/models/plan_fail_reason.rb +1 -1
- data/lib/lingara/models/plan_fragment.rb +265 -0
- data/lib/lingara/models/plan_pending.rb +1 -1
- data/lib/lingara/models/plan_phase.rb +1 -1
- data/lib/lingara/models/plan_question.rb +1 -1
- data/lib/lingara/models/plan_ready_status.rb +1 -1
- data/lib/lingara/models/plan_reason.rb +42 -0
- data/lib/lingara/models/plan_result.rb +1 -1
- data/lib/lingara/models/plan_set.rb +1 -1
- data/lib/lingara/models/plan_started.rb +1 -1
- data/lib/lingara/models/plan_status.rb +1 -1
- data/lib/lingara/models/plan_word.rb +1 -1
- data/lib/lingara/models/practice_completed_data.rb +1 -1
- data/lib/lingara/models/practice_item.rb +1 -1
- data/lib/lingara/models/practice_outcome.rb +1 -1
- data/lib/lingara/models/reaction_report.rb +1 -1
- data/lib/lingara/models/reaction_status.rb +1 -1
- data/lib/lingara/models/rename_canvas_request.rb +1 -1
- data/lib/lingara/models/rename_dialogue_request.rb +1 -1
- data/lib/lingara/models/save_canvas_draft_request.rb +1 -1
- data/lib/lingara/models/save_dialogue_draft_request.rb +2 -2
- data/lib/lingara/models/send_dialogue_turn_event_delta.rb +1 -1
- data/lib/lingara/models/send_dialogue_turn_event_done.rb +1 -1
- data/lib/lingara/models/send_dialogue_turn_event_error.rb +1 -1
- data/lib/lingara/models/send_dialogue_turn_event_notice.rb +1 -1
- data/lib/lingara/models/send_dialogue_turn_event_transition.rb +1 -1
- data/lib/lingara/models/send_tutor_message_event_delta.rb +1 -1
- data/lib/lingara/models/send_tutor_message_event_done.rb +1 -1
- data/lib/lingara/models/send_tutor_message_event_error.rb +1 -1
- data/lib/lingara/models/send_tutor_message_event_notice.rb +1 -1
- data/lib/lingara/models/speaker.rb +1 -1
- data/lib/lingara/models/stream_error.rb +1 -1
- data/lib/lingara/models/stream_events_event_done.rb +1 -1
- data/lib/lingara/models/stream_events_event_error.rb +1 -1
- data/lib/lingara/models/stream_events_event_event.rb +1 -1
- data/lib/lingara/models/stream_lesson_plan_event_error.rb +1 -1
- data/lib/lingara/models/stream_lesson_plan_event_pending.rb +1 -1
- data/lib/lingara/models/stream_lesson_plan_event_phase.rb +1 -1
- data/lib/lingara/models/stream_lesson_plan_event_result.rb +1 -1
- data/lib/lingara/models/stream_lesson_plan_event_started.rb +1 -1
- data/lib/lingara/models/threshold_scope.rb +1 -1
- data/lib/lingara/models/turn_delta.rb +1 -1
- data/lib/lingara/models/turn_entry.rb +1 -1
- data/lib/lingara/models/turn_role.rb +1 -1
- data/lib/lingara/models/tutor_turn_request.rb +1 -1
- data/lib/lingara/models/update_available.rb +279 -0
- data/lib/lingara/models/usage.rb +1 -1
- data/lib/lingara/models/usage_ledger.rb +1 -1
- data/lib/lingara/models/usage_threshold_reached_data.rb +1 -1
- data/lib/lingara/models/version_detail.rb +1 -1
- data/lib/lingara/models/version_history_entry.rb +1 -1
- data/lib/lingara/models/version_list.rb +1 -1
- data/lib/lingara/models/version_spec.rb +1 -1
- data/lib/lingara/models/version_state.rb +1 -1
- data/lib/lingara/models/version_summary.rb +1 -1
- data/lib/lingara/models/visited_beat.rb +269 -0
- data/lib/lingara/models/vocab_example.rb +1 -1
- data/lib/lingara/models/vocab_item.rb +1 -1
- data/lib/lingara/models/vocab_meta.rb +1 -1
- data/lib/lingara/models/vocab_request.rb +1 -1
- data/lib/lingara/models/vocab_started.rb +1 -1
- data/lib/lingara/models/world_context_changed.rb +1 -1
- data/lib/lingara/models/world_practice_completed.rb +1 -1
- data/lib/lingara/models/world_practice_requested.rb +1 -1
- data/lib/lingara/operations.rb +9 -0
- data/lib/lingara/response.rb +6 -1
- data/lib/lingara/version.rb +3 -3
- data/sig/lingara.rbs +7 -1
- metadata +15 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4ffe9d87ddac253f540c66ddac565ada4acfb67d20915c078c23435538b76e81
|
|
4
|
+
data.tar.gz: f042d0f9783740947c0b7d479f16064b07f37ebe87f40b31fda724c7f121fb0e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
data/lib/lingara/client.rb
CHANGED
|
@@ -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
|
-
|
|
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
|
data/lib/lingara/minted_token.rb
CHANGED
|
@@ -4,7 +4,7 @@ require "json"
|
|
|
4
4
|
|
|
5
5
|
module Lingara
|
|
6
6
|
# What create_embed_token returns (ADR 1.10.26w D3): a player's embed
|
|
7
|
-
# token and the
|
|
7
|
+
# token and the six fields minted beside it. #token is an AccessToken, so
|
|
8
8
|
# the lgr_et_ value renders [REDACTED] in #inspect, #to_s and pp like
|
|
9
9
|
# every other token (K1); token.expose_secret reads it.
|
|
10
10
|
#
|
|
@@ -20,28 +20,52 @@ module Lingara
|
|
|
20
20
|
"token" => String, "expires_at" => String, "expires_in" => Integer, "subject" => String, "scopes" => Array,
|
|
21
21
|
"account_linked" => [true, false]
|
|
22
22
|
}.freeze
|
|
23
|
+
# The schema's maxLength for a notice's message, in code points (never
|
|
24
|
+
# bytes), so every library agrees on a notice near the limit.
|
|
25
|
+
MESSAGE_MAX = 280
|
|
23
26
|
|
|
24
27
|
# +token+ an AccessToken; +expires_at+ a Time, as the generated
|
|
25
28
|
# EmbedToken reads it; +expires_in+ whole seconds, for a device whose
|
|
26
29
|
# clock cannot be trusted; +subject+ the player's lgr_sub_, stable across
|
|
27
30
|
# mints; +scopes+ as granted; +account_linked+ always false until a
|
|
28
|
-
# player links an account
|
|
29
|
-
|
|
31
|
+
# player links an account; +update_available+ Lingara's notice that the
|
|
32
|
+
# embed_version the request named is behind, deprecated or withdrawn
|
|
33
|
+
# (an UpdateAvailable, copied verbatim), or nil when the request named
|
|
34
|
+
# none, the version is current, or the notice was malformed. A notice is
|
|
35
|
+
# advisory, so a bad one is dropped and never costs the token (ADR
|
|
36
|
+
# 31.10.26g D3).
|
|
37
|
+
attr_reader :token, :expires_at, :expires_in, :subject, :scopes, :account_linked, :update_available
|
|
30
38
|
|
|
31
39
|
# A mint's answer body to a MintedToken. Every field must be present and
|
|
32
40
|
# of its JSON type, and the token must start lgr_et_; anything else is
|
|
33
41
|
# TransportError(:malformed_response), raised with no cause so nothing
|
|
34
|
-
# of the body, the token included, travels with it.
|
|
42
|
+
# of the body, the token included, travels with it. The notice is
|
|
43
|
+
# deleted before those checks and the model, so it can fail neither.
|
|
35
44
|
def self.decode(body)
|
|
36
45
|
fields = JSON.parse(body)
|
|
46
|
+
notice = fields.delete("update_available") if fields.is_a?(Hash)
|
|
37
47
|
raise ArgumentError unless well_typed?(fields)
|
|
38
48
|
model = EmbedToken.build_from_hash(fields)
|
|
39
49
|
new(token: AccessToken.new(model.token), expires_at: model.expires_at, expires_in: model.expires_in,
|
|
40
|
-
subject: model.subject, scopes: model.scopes, account_linked: model.account_linked
|
|
50
|
+
subject: model.subject, scopes: model.scopes, account_linked: model.account_linked,
|
|
51
|
+
update_available: update_from(notice))
|
|
41
52
|
rescue
|
|
42
53
|
raise TransportError.new(:malformed_response, "the answer is not a minted token"), cause: nil
|
|
43
54
|
end
|
|
44
55
|
|
|
56
|
+
# The notice, when it is a Hash whose "deprecated" is a boolean and whose
|
|
57
|
+
# "latest" and "message" are each present and a String or nil, "message"
|
|
58
|
+
# at most 280 code points; otherwise nil. It reads the raw value by hand,
|
|
59
|
+
# since the generated initialize raises on an unknown key, which is
|
|
60
|
+
# ignored here.
|
|
61
|
+
def self.update_from(notice)
|
|
62
|
+
return nil unless notice.is_a?(Hash) && [true, false].include?(notice["deprecated"])
|
|
63
|
+
return nil unless %w[latest message].all? { |key| notice.key?(key) && [String, NilClass].include?(notice[key].class) }
|
|
64
|
+
return nil if notice["message"] && notice["message"].length > MESSAGE_MAX
|
|
65
|
+
UpdateAvailable.new(latest: notice["latest"], deprecated: notice["deprecated"], message: notice["message"])
|
|
66
|
+
end
|
|
67
|
+
private_class_method :update_from
|
|
68
|
+
|
|
45
69
|
def self.well_typed?(fields)
|
|
46
70
|
return false unless fields.is_a?(Hash)
|
|
47
71
|
typed = FIELDS.all? do |name, type|
|
|
@@ -51,13 +75,14 @@ module Lingara
|
|
|
51
75
|
end
|
|
52
76
|
private_class_method :well_typed?
|
|
53
77
|
|
|
54
|
-
def initialize(token:, expires_at:, expires_in:, subject:, scopes:, account_linked:)
|
|
78
|
+
def initialize(token:, expires_at:, expires_in:, subject:, scopes:, account_linked:, update_available: nil)
|
|
55
79
|
@token = token
|
|
56
80
|
@expires_at = expires_at
|
|
57
81
|
@expires_in = expires_in
|
|
58
82
|
@subject = subject.dup.freeze
|
|
59
83
|
@scopes = scopes.map { |scope| scope.dup.freeze }.freeze
|
|
60
84
|
@account_linked = account_linked
|
|
85
|
+
@update_available = update_available
|
|
61
86
|
freeze
|
|
62
87
|
end
|
|
63
88
|
|
|
@@ -67,7 +92,8 @@ module Lingara
|
|
|
67
92
|
|
|
68
93
|
def inspect
|
|
69
94
|
"#<Lingara::MintedToken token=#{REDACTED} expires_at=#{@expires_at.inspect} expires_in=#{@expires_in} " \
|
|
70
|
-
"subject=#{@subject.inspect} scopes=#{@scopes.inspect} account_linked=#{@account_linked}
|
|
95
|
+
"subject=#{@subject.inspect} scopes=#{@scopes.inspect} account_linked=#{@account_linked} " \
|
|
96
|
+
"update_available=#{@update_available&.to_hash.inspect}>"
|
|
71
97
|
end
|
|
72
98
|
end
|
|
73
99
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|