lingara 0.1.0.pre.alpha.13 → 0.2.0.pre.alpha.3

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