api-sdk-rb 1.11.111 → 1.11.133

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 (180) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +207 -381
  3. data/docs/{GetPartnerCreditTransactions200Response.md → AccountCreditTransactionListResponse.md} +2 -2
  4. data/docs/{GetUserAdapterConnections200Response.md → AdapterConnectionListResponse.md} +2 -2
  5. data/docs/{RemoveUserAdapterConnection200Response.md → AdapterConnectionRemovalResponse.md} +2 -2
  6. data/docs/{SetUserAdapterConnection200Response.md → AdapterConnectionResponse.md} +2 -2
  7. data/docs/{AddAiAnswersKnowledgeDocument201Response.md → AiAnswersKnowledgeDocumentResponse.md} +2 -2
  8. data/docs/BrandKitApi.md +74 -74
  9. data/docs/BrandKitTokens.md +2 -0
  10. data/docs/BrandKitView.md +1 -1
  11. data/docs/BrandTextStyle.md +22 -0
  12. data/docs/CanvasesApi.md +45 -45
  13. data/docs/{CreateCompositionDatabaseRecord201Response.md → CompositionDatabaseRecordResponse.md} +2 -2
  14. data/docs/CompositionsApi.md +615 -349
  15. data/docs/{CreateCompositionContentItem201Response.md → ContentItemWriteResultResponse.md} +2 -2
  16. data/docs/CreditsApi.md +20 -20
  17. data/docs/{CreateCompositionFromWidget201Response.md → DeleteUpload200Response.md} +3 -3
  18. data/docs/{UploadsIdDelete200ResponseData.md → DeleteUpload200ResponseData.md} +2 -2
  19. data/docs/{GetPartnerDesignDefaults200Response.md → DesignDefaultsResponse.md} +2 -2
  20. data/docs/EntitlementsApi.md +18 -18
  21. data/docs/{OperationsIdGetResponse.md → GetOperationResponse.md} +3 -3
  22. data/docs/{OperationsIdGetResponseData.md → GetOperationResponseData.md} +3 -3
  23. data/docs/GetOperationResponseDataMetadata.md +24 -0
  24. data/docs/InvoicesApi.md +9 -9
  25. data/docs/{UploadsGet200Response.md → ListUploads200Response.md} +2 -2
  26. data/docs/{GetManagedUserLimits200Response.md → ManagedUserLimitsResponse.md} +2 -2
  27. data/docs/{DeleteManagedUser200Response.md → ManagedUserRemovalResponse.md} +2 -2
  28. data/docs/ManagedUsersApi.md +261 -171
  29. data/docs/OperationsApi.md +11 -11
  30. data/docs/PartnersApi.md +388 -388
  31. data/docs/PatchBrandKitRequest.md +2 -0
  32. data/docs/PublicEmbedApi.md +95 -95
  33. data/docs/PublicWorkflowEventsRequestEventsInner.md +3 -1
  34. data/docs/{GetPublicWorkflow200Response.md → PublicWorkflowResponse.md} +2 -2
  35. data/docs/TokensApi.md +11 -9
  36. data/docs/Upload.md +1 -1
  37. data/docs/UploadLimits.md +3 -3
  38. data/docs/UploadsApi.md +85 -85
  39. data/docs/UsersApi.md +125 -125
  40. data/docs/WidgetClarification.md +22 -0
  41. data/docs/WidgetClarificationOption.md +22 -0
  42. data/docs/WidgetClarificationQuestion.md +26 -0
  43. data/docs/WidgetNextStep.md +24 -0
  44. data/docs/WidgetPlan.md +26 -0
  45. data/docs/WidgetPlanDecisions.md +32 -0
  46. data/docs/WidgetPlanDecisionsAdaptersInner.md +20 -0
  47. data/docs/WidgetPlanDecisionsLibrariesInner.md +22 -0
  48. data/docs/WidgetPlanDecisionsResponsive.md +22 -0
  49. data/docs/WidgetPlanTask.md +24 -0
  50. data/docs/WidgetsApi.md +38 -38
  51. data/docs/{CreateWorkspaceWorkflowFromPreset201Response.md → WorkflowDetailResponse.md} +2 -2
  52. data/docs/WorkflowFailureReason.md +15 -0
  53. data/docs/WorkflowFailureReasonCounter.md +22 -0
  54. data/docs/{SaveWorkspaceWorkflow200Response.md → WorkflowResponse.md} +2 -2
  55. data/docs/WorkflowStats.md +4 -2
  56. data/docs/WorkflowsApi.md +197 -413
  57. data/lib/api-sdk-rb/api/brand_kit_api.rb +61 -61
  58. data/lib/api-sdk-rb/api/canvases_api.rb +39 -39
  59. data/lib/api-sdk-rb/api/compositions_api.rb +770 -441
  60. data/lib/api-sdk-rb/api/credits_api.rb +20 -20
  61. data/lib/api-sdk-rb/api/entitlements_api.rb +14 -14
  62. data/lib/api-sdk-rb/api/invoices_api.rb +10 -10
  63. data/lib/api-sdk-rb/api/managed_users_api.rb +278 -172
  64. data/lib/api-sdk-rb/api/operations_api.rb +10 -10
  65. data/lib/api-sdk-rb/api/partners_api.rb +389 -389
  66. data/lib/api-sdk-rb/api/public_embed_api.rb +95 -95
  67. data/lib/api-sdk-rb/api/tokens_api.rb +8 -6
  68. data/lib/api-sdk-rb/api/uploads_api.rb +96 -96
  69. data/lib/api-sdk-rb/api/users_api.rb +132 -132
  70. data/lib/api-sdk-rb/api/widgets_api.rb +40 -40
  71. data/lib/api-sdk-rb/api/workflows_api.rb +246 -468
  72. data/lib/api-sdk-rb/configuration.rb +0 -60
  73. data/lib/api-sdk-rb/models/{get_user_adapter_connections200_response.rb → account_credit_transaction_list_response.rb} +4 -4
  74. data/lib/api-sdk-rb/models/{get_partner_credit_transactions200_response.rb → adapter_connection_list_response.rb} +4 -4
  75. data/lib/api-sdk-rb/models/{save_workspace_workflow200_response.rb → adapter_connection_removal_response.rb} +4 -4
  76. data/lib/api-sdk-rb/models/{set_user_adapter_connection200_response.rb → adapter_connection_response.rb} +3 -3
  77. data/lib/api-sdk-rb/models/{add_ai_answers_knowledge_document201_response.rb → ai_answers_knowledge_document_response.rb} +3 -3
  78. data/lib/api-sdk-rb/models/brand_kit_tokens.rb +33 -2
  79. data/lib/api-sdk-rb/models/brand_kit_view.rb +1 -1
  80. data/lib/api-sdk-rb/models/brand_text_style.rb +344 -0
  81. data/lib/api-sdk-rb/models/{create_composition_database_record201_response.rb → composition_database_record_response.rb} +3 -3
  82. data/lib/api-sdk-rb/models/{create_composition_content_item201_response.rb → content_item_write_result_response.rb} +3 -3
  83. data/lib/api-sdk-rb/models/{operations_id_get_response.rb → delete_upload200_response.rb} +4 -5
  84. data/lib/api-sdk-rb/models/{uploads_id_delete200_response_data.rb → delete_upload200_response_data.rb} +3 -3
  85. data/lib/api-sdk-rb/models/{get_partner_design_defaults200_response.rb → design_defaults_response.rb} +3 -3
  86. data/lib/api-sdk-rb/models/get_operation_response.rb +247 -0
  87. data/lib/api-sdk-rb/models/{operations_id_get_response_data.rb → get_operation_response_data.rb} +5 -8
  88. data/lib/api-sdk-rb/models/get_operation_response_data_metadata.rb +283 -0
  89. data/lib/api-sdk-rb/models/{uploads_get200_response.rb → list_uploads200_response.rb} +3 -3
  90. data/lib/api-sdk-rb/models/{get_managed_user_limits200_response.rb → managed_user_limits_response.rb} +3 -3
  91. data/lib/api-sdk-rb/models/{uploads_id_delete200_response.rb → managed_user_removal_response.rb} +4 -4
  92. data/lib/api-sdk-rb/models/patch_brand_kit_request.rb +32 -1
  93. data/lib/api-sdk-rb/models/public_workflow_events_request_events_inner.rb +26 -4
  94. data/lib/api-sdk-rb/models/{get_public_workflow200_response.rb → public_workflow_response.rb} +3 -3
  95. data/lib/api-sdk-rb/models/upload.rb +1 -1
  96. data/lib/api-sdk-rb/models/upload_limits.rb +3 -3
  97. data/lib/api-sdk-rb/models/widget_clarification.rb +279 -0
  98. data/lib/api-sdk-rb/models/{create_composition_from_widget201_response.rb → widget_clarification_option.rb} +40 -30
  99. data/lib/api-sdk-rb/models/widget_clarification_question.rb +329 -0
  100. data/lib/api-sdk-rb/models/widget_next_step.rb +307 -0
  101. data/lib/api-sdk-rb/models/widget_plan.rb +306 -0
  102. data/lib/api-sdk-rb/models/widget_plan_decisions.rb +346 -0
  103. data/lib/api-sdk-rb/models/widget_plan_decisions_adapters_inner.rb +237 -0
  104. data/lib/api-sdk-rb/models/{create_workspace_workflow_from_preset201_response.rb → widget_plan_decisions_libraries_inner.rb} +39 -30
  105. data/lib/api-sdk-rb/models/widget_plan_decisions_responsive.rb +311 -0
  106. data/lib/api-sdk-rb/models/widget_plan_task.rb +320 -0
  107. data/lib/api-sdk-rb/models/{delete_managed_user200_response.rb → workflow_detail_response.rb} +4 -4
  108. data/lib/api-sdk-rb/models/workflow_failure_reason.rb +42 -0
  109. data/lib/api-sdk-rb/models/workflow_failure_reason_counter.rb +277 -0
  110. data/lib/api-sdk-rb/models/workflow_response.rb +246 -0
  111. data/lib/api-sdk-rb/models/workflow_stats.rb +17 -5
  112. data/lib/api-sdk-rb/version.rb +1 -1
  113. data/lib/api-sdk-rb.rb +32 -21
  114. data/spec/api/brand_kit_api_spec.rb +18 -18
  115. data/spec/api/canvases_api_spec.rb +10 -10
  116. data/spec/api/compositions_api_spec.rb +144 -83
  117. data/spec/api/credits_api_spec.rb +5 -5
  118. data/spec/api/entitlements_api_spec.rb +4 -4
  119. data/spec/api/invoices_api_spec.rb +2 -2
  120. data/spec/api/managed_users_api_spec.rb +63 -42
  121. data/spec/api/operations_api_spec.rb +3 -3
  122. data/spec/api/partners_api_spec.rb +91 -91
  123. data/spec/api/public_embed_api_spec.rb +23 -23
  124. data/spec/api/tokens_api_spec.rb +3 -2
  125. data/spec/api/uploads_api_spec.rb +24 -24
  126. data/spec/api/users_api_spec.rb +30 -30
  127. data/spec/api/widgets_api_spec.rb +9 -9
  128. data/spec/api/workflows_api_spec.rb +50 -89
  129. data/spec/models/{get_user_adapter_connections200_response_spec.rb → account_credit_transaction_list_response_spec.rb} +6 -6
  130. data/spec/models/{get_public_workflow200_response_spec.rb → adapter_connection_list_response_spec.rb} +6 -6
  131. data/spec/models/{save_workspace_workflow200_response_spec.rb → adapter_connection_removal_response_spec.rb} +6 -6
  132. data/spec/models/{delete_managed_user200_response_spec.rb → adapter_connection_response_spec.rb} +6 -6
  133. data/spec/models/ai_answers_knowledge_document_response_spec.rb +48 -0
  134. data/spec/models/brand_kit_tokens_spec.rb +6 -0
  135. data/spec/models/{create_composition_from_widget201_response_spec.rb → brand_text_style_spec.rb} +13 -9
  136. data/spec/models/{get_managed_user_limits200_response_spec.rb → composition_database_record_response_spec.rb} +6 -6
  137. data/spec/models/content_item_write_result_response_spec.rb +48 -0
  138. data/spec/models/{uploads_id_delete200_response_data_spec.rb → delete_upload200_response_data_spec.rb} +6 -6
  139. data/spec/models/{operations_id_get_response_spec.rb → delete_upload200_response_spec.rb} +6 -6
  140. data/spec/models/design_defaults_response_spec.rb +48 -0
  141. data/spec/models/get_operation_response_data_metadata_spec.rb +58 -0
  142. data/spec/models/{operations_id_get_response_data_spec.rb → get_operation_response_data_spec.rb} +6 -6
  143. data/spec/models/{uploads_get200_response_spec.rb → get_operation_response_spec.rb} +6 -6
  144. data/spec/models/list_uploads200_response_spec.rb +48 -0
  145. data/spec/models/managed_user_limits_response_spec.rb +48 -0
  146. data/spec/models/{uploads_id_delete200_response_spec.rb → managed_user_removal_response_spec.rb} +6 -6
  147. data/spec/models/patch_brand_kit_request_spec.rb +6 -0
  148. data/spec/models/public_workflow_events_request_events_inner_spec.rb +10 -0
  149. data/spec/models/public_workflow_response_spec.rb +48 -0
  150. data/spec/models/widget_clarification_option_spec.rb +48 -0
  151. data/spec/models/widget_clarification_question_spec.rb +60 -0
  152. data/spec/models/widget_clarification_spec.rb +48 -0
  153. data/spec/models/widget_next_step_spec.rb +58 -0
  154. data/spec/models/widget_plan_decisions_adapters_inner_spec.rb +42 -0
  155. data/spec/models/widget_plan_decisions_libraries_inner_spec.rb +48 -0
  156. data/spec/models/widget_plan_decisions_responsive_spec.rb +48 -0
  157. data/spec/models/widget_plan_decisions_spec.rb +78 -0
  158. data/spec/models/{create_composition_database_record201_response_spec.rb → widget_plan_spec.rb} +21 -9
  159. data/spec/models/widget_plan_task_spec.rb +62 -0
  160. data/spec/models/workflow_detail_response_spec.rb +48 -0
  161. data/spec/models/workflow_failure_reason_counter_spec.rb +48 -0
  162. data/spec/models/workflow_failure_reason_spec.rb +30 -0
  163. data/spec/models/workflow_response_spec.rb +48 -0
  164. data/spec/models/workflow_stats_spec.rb +6 -0
  165. metadata +130 -86
  166. data/docs/PartnerApi.md +0 -12714
  167. data/docs/UploadsIdDelete200Response.md +0 -22
  168. data/docs/WorkspacesApi.md +0 -1527
  169. data/lib/api-sdk-rb/api/partner_api.rb +0 -13791
  170. data/lib/api-sdk-rb/api/workspaces_api.rb +0 -1775
  171. data/lib/api-sdk-rb/models/remove_user_adapter_connection200_response.rb +0 -246
  172. data/spec/api/partner_api_spec.rb +0 -2437
  173. data/spec/api/workspaces_api_spec.rb +0 -339
  174. data/spec/models/add_ai_answers_knowledge_document201_response_spec.rb +0 -48
  175. data/spec/models/create_composition_content_item201_response_spec.rb +0 -48
  176. data/spec/models/create_workspace_workflow_from_preset201_response_spec.rb +0 -48
  177. data/spec/models/get_partner_credit_transactions200_response_spec.rb +0 -48
  178. data/spec/models/get_partner_design_defaults200_response_spec.rb +0 -48
  179. data/spec/models/remove_user_adapter_connection200_response_spec.rb +0 -48
  180. data/spec/models/set_user_adapter_connection200_response_spec.rb +0 -48
@@ -0,0 +1,329 @@
1
+ =begin
2
+ #Widgetic API Gateway
3
+
4
+ #API documentation for the Widgetic API Gateway
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module ApiSdkRb
17
+ class WidgetClarificationQuestion
18
+ # `q1`, `q2`, ...
19
+ attr_accessor :id
20
+
21
+ attr_accessor :question
22
+
23
+ # The localized word placed in parentheses on the recommended option's label (default `Recommended`).
24
+ attr_accessor :recommended_word
25
+
26
+ # Two to five options with the recommended one first; empty for a question answered in words only.
27
+ attr_accessor :options
28
+
29
+ # Whether the person may answer in their own words (the \"Other...\" row). Always true when there are no options.
30
+ attr_accessor :allow_other
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'id' => :'id',
36
+ :'question' => :'question',
37
+ :'recommended_word' => :'recommendedWord',
38
+ :'options' => :'options',
39
+ :'allow_other' => :'allowOther'
40
+ }
41
+ end
42
+
43
+ # Returns all the JSON keys this model knows about
44
+ def self.acceptable_attributes
45
+ attribute_map.values
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.openapi_types
50
+ {
51
+ :'id' => :'String',
52
+ :'question' => :'String',
53
+ :'recommended_word' => :'String',
54
+ :'options' => :'Array<WidgetClarificationOption>',
55
+ :'allow_other' => :'Boolean'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ApiSdkRb::WidgetClarificationQuestion` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!self.class.attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ApiSdkRb::WidgetClarificationQuestion`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'id')
81
+ self.id = attributes[:'id']
82
+ else
83
+ self.id = nil
84
+ end
85
+
86
+ if attributes.key?(:'question')
87
+ self.question = attributes[:'question']
88
+ else
89
+ self.question = nil
90
+ end
91
+
92
+ if attributes.key?(:'recommended_word')
93
+ self.recommended_word = attributes[:'recommended_word']
94
+ else
95
+ self.recommended_word = nil
96
+ end
97
+
98
+ if attributes.key?(:'options')
99
+ if (value = attributes[:'options']).is_a?(Array)
100
+ self.options = value
101
+ end
102
+ else
103
+ self.options = nil
104
+ end
105
+
106
+ if attributes.key?(:'allow_other')
107
+ self.allow_other = attributes[:'allow_other']
108
+ else
109
+ self.allow_other = nil
110
+ end
111
+ end
112
+
113
+ # Show invalid properties with the reasons. Usually used together with valid?
114
+ # @return Array for valid properties with the reasons
115
+ def list_invalid_properties
116
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
117
+ invalid_properties = Array.new
118
+ if @id.nil?
119
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
120
+ end
121
+
122
+ if @question.nil?
123
+ invalid_properties.push('invalid value for "question", question cannot be nil.')
124
+ end
125
+
126
+ if @recommended_word.nil?
127
+ invalid_properties.push('invalid value for "recommended_word", recommended_word cannot be nil.')
128
+ end
129
+
130
+ if @recommended_word.to_s.length > 24
131
+ invalid_properties.push('invalid value for "recommended_word", the character length must be smaller than or equal to 24.')
132
+ end
133
+
134
+ if @options.nil?
135
+ invalid_properties.push('invalid value for "options", options cannot be nil.')
136
+ end
137
+
138
+ if @options.length > 5
139
+ invalid_properties.push('invalid value for "options", number of items must be less than or equal to 5.')
140
+ end
141
+
142
+ if @allow_other.nil?
143
+ invalid_properties.push('invalid value for "allow_other", allow_other cannot be nil.')
144
+ end
145
+
146
+ invalid_properties
147
+ end
148
+
149
+ # Check to see if the all the properties in the model are valid
150
+ # @return true if the model is valid
151
+ def valid?
152
+ warn '[DEPRECATED] the `valid?` method is obsolete'
153
+ return false if @id.nil?
154
+ return false if @question.nil?
155
+ return false if @recommended_word.nil?
156
+ return false if @recommended_word.to_s.length > 24
157
+ return false if @options.nil?
158
+ return false if @options.length > 5
159
+ return false if @allow_other.nil?
160
+ true
161
+ end
162
+
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] recommended_word Value to be assigned
165
+ def recommended_word=(recommended_word)
166
+ if recommended_word.nil?
167
+ fail ArgumentError, 'recommended_word cannot be nil'
168
+ end
169
+
170
+ if recommended_word.to_s.length > 24
171
+ fail ArgumentError, 'invalid value for "recommended_word", the character length must be smaller than or equal to 24.'
172
+ end
173
+
174
+ @recommended_word = recommended_word
175
+ end
176
+
177
+ # Custom attribute writer method with validation
178
+ # @param [Object] options Value to be assigned
179
+ def options=(options)
180
+ if options.nil?
181
+ fail ArgumentError, 'options cannot be nil'
182
+ end
183
+
184
+ if options.length > 5
185
+ fail ArgumentError, 'invalid value for "options", number of items must be less than or equal to 5.'
186
+ end
187
+
188
+ @options = options
189
+ end
190
+
191
+ # Checks equality by comparing each attribute.
192
+ # @param [Object] Object to be compared
193
+ def ==(o)
194
+ return true if self.equal?(o)
195
+ self.class == o.class &&
196
+ id == o.id &&
197
+ question == o.question &&
198
+ recommended_word == o.recommended_word &&
199
+ options == o.options &&
200
+ allow_other == o.allow_other
201
+ end
202
+
203
+ # @see the `==` method
204
+ # @param [Object] Object to be compared
205
+ def eql?(o)
206
+ self == o
207
+ end
208
+
209
+ # Calculates hash code according to all attributes.
210
+ # @return [Integer] Hash code
211
+ def hash
212
+ [id, question, recommended_word, options, allow_other].hash
213
+ end
214
+
215
+ # Builds the object from hash
216
+ # @param [Hash] attributes Model attributes in the form of hash
217
+ # @return [Object] Returns the model itself
218
+ def self.build_from_hash(attributes)
219
+ return nil unless attributes.is_a?(Hash)
220
+ attributes = attributes.transform_keys(&:to_sym)
221
+ transformed_hash = {}
222
+ openapi_types.each_pair do |key, type|
223
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
224
+ transformed_hash["#{key}"] = nil
225
+ elsif type =~ /\AArray<(.*)>/i
226
+ # check to ensure the input is an array given that the attribute
227
+ # is documented as an array but the input is not
228
+ if attributes[attribute_map[key]].is_a?(Array)
229
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
230
+ end
231
+ elsif !attributes[attribute_map[key]].nil?
232
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
233
+ end
234
+ end
235
+ new(transformed_hash)
236
+ end
237
+
238
+ # Deserializes the data based on type
239
+ # @param string type Data type
240
+ # @param string value Value to be deserialized
241
+ # @return [Object] Deserialized data
242
+ def self._deserialize(type, value)
243
+ case type.to_sym
244
+ when :Time
245
+ Time.parse(value)
246
+ when :Date
247
+ Date.parse(value)
248
+ when :String
249
+ value.to_s
250
+ when :Integer
251
+ value.to_i
252
+ when :Float
253
+ value.to_f
254
+ when :Boolean
255
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
256
+ true
257
+ else
258
+ false
259
+ end
260
+ when :Object
261
+ # generic object (usually a Hash), return directly
262
+ value
263
+ when /\AArray<(?<inner_type>.+)>\z/
264
+ inner_type = Regexp.last_match[:inner_type]
265
+ value.map { |v| _deserialize(inner_type, v) }
266
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
267
+ k_type = Regexp.last_match[:k_type]
268
+ v_type = Regexp.last_match[:v_type]
269
+ {}.tap do |hash|
270
+ value.each do |k, v|
271
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
272
+ end
273
+ end
274
+ else # model
275
+ # models (e.g. Pet) or oneOf
276
+ klass = ApiSdkRb.const_get(type)
277
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
278
+ end
279
+ end
280
+
281
+ # Returns the string representation of the object
282
+ # @return [String] String presentation of the object
283
+ def to_s
284
+ to_hash.to_s
285
+ end
286
+
287
+ # to_body is an alias to to_hash (backward compatibility)
288
+ # @return [Hash] Returns the object in the form of hash
289
+ def to_body
290
+ to_hash
291
+ end
292
+
293
+ # Returns the object in the form of hash
294
+ # @return [Hash] Returns the object in the form of hash
295
+ def to_hash
296
+ hash = {}
297
+ self.class.attribute_map.each_pair do |attr, param|
298
+ value = self.send(attr)
299
+ if value.nil?
300
+ is_nullable = self.class.openapi_nullable.include?(attr)
301
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
302
+ end
303
+
304
+ hash[param] = _to_hash(value)
305
+ end
306
+ hash
307
+ end
308
+
309
+ # Outputs non-array value in the form of hash
310
+ # For object, use to_hash. Otherwise, just return the value
311
+ # @param [Object] value Any valid value
312
+ # @return [Hash] Returns the value in the form of hash
313
+ def _to_hash(value)
314
+ if value.is_a?(Array)
315
+ value.compact.map { |v| _to_hash(v) }
316
+ elsif value.is_a?(Hash)
317
+ {}.tap do |hash|
318
+ value.each { |k, v| hash[k] = _to_hash(v) }
319
+ end
320
+ elsif value.respond_to? :to_hash
321
+ value.to_hash
322
+ else
323
+ value
324
+ end
325
+ end
326
+
327
+ end
328
+
329
+ end
@@ -0,0 +1,307 @@
1
+ =begin
2
+ #Widgetic API Gateway
3
+
4
+ #API documentation for the Widgetic API Gateway
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module ApiSdkRb
17
+ # One suggested next improvement, in `metadata.nextSteps` of a completed generation. The label is a complete request: sending it as the next message is the whole action. The first suggestion is always the recommended one; the chips saved under the reply carry no flag, so a client applies the same rule after a reload.
18
+ class WidgetNextStep
19
+ # `n1`, `n2`, ...
20
+ attr_accessor :id
21
+
22
+ # The request, at most 80 characters.
23
+ attr_accessor :label
24
+
25
+ attr_accessor :kind
26
+
27
+ # True for the first suggestion and false for the others.
28
+ attr_accessor :recommended
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'id' => :'id',
56
+ :'label' => :'label',
57
+ :'kind' => :'kind',
58
+ :'recommended' => :'recommended'
59
+ }
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'id' => :'String',
71
+ :'label' => :'String',
72
+ :'kind' => :'String',
73
+ :'recommended' => :'Boolean'
74
+ }
75
+ end
76
+
77
+ # List of attributes with nullable: true
78
+ def self.openapi_nullable
79
+ Set.new([
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ApiSdkRb::WidgetNextStep` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!self.class.attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ApiSdkRb::WidgetNextStep`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'id')
99
+ self.id = attributes[:'id']
100
+ else
101
+ self.id = nil
102
+ end
103
+
104
+ if attributes.key?(:'label')
105
+ self.label = attributes[:'label']
106
+ else
107
+ self.label = nil
108
+ end
109
+
110
+ if attributes.key?(:'kind')
111
+ self.kind = attributes[:'kind']
112
+ else
113
+ self.kind = nil
114
+ end
115
+
116
+ if attributes.key?(:'recommended')
117
+ self.recommended = attributes[:'recommended']
118
+ else
119
+ self.recommended = nil
120
+ end
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
127
+ invalid_properties = Array.new
128
+ if @id.nil?
129
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
130
+ end
131
+
132
+ if @label.nil?
133
+ invalid_properties.push('invalid value for "label", label cannot be nil.')
134
+ end
135
+
136
+ if @kind.nil?
137
+ invalid_properties.push('invalid value for "kind", kind cannot be nil.')
138
+ end
139
+
140
+ if @recommended.nil?
141
+ invalid_properties.push('invalid value for "recommended", recommended cannot be nil.')
142
+ end
143
+
144
+ invalid_properties
145
+ end
146
+
147
+ # Check to see if the all the properties in the model are valid
148
+ # @return true if the model is valid
149
+ def valid?
150
+ warn '[DEPRECATED] the `valid?` method is obsolete'
151
+ return false if @id.nil?
152
+ return false if @label.nil?
153
+ return false if @kind.nil?
154
+ kind_validator = EnumAttributeValidator.new('String', ["content", "style", "layout", "behavior", "animation", "data", "other"])
155
+ return false unless kind_validator.valid?(@kind)
156
+ return false if @recommended.nil?
157
+ true
158
+ end
159
+
160
+ # Custom attribute writer method checking allowed values (enum).
161
+ # @param [Object] kind Object to be assigned
162
+ def kind=(kind)
163
+ validator = EnumAttributeValidator.new('String', ["content", "style", "layout", "behavior", "animation", "data", "other"])
164
+ unless validator.valid?(kind)
165
+ fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}."
166
+ end
167
+ @kind = kind
168
+ end
169
+
170
+ # Checks equality by comparing each attribute.
171
+ # @param [Object] Object to be compared
172
+ def ==(o)
173
+ return true if self.equal?(o)
174
+ self.class == o.class &&
175
+ id == o.id &&
176
+ label == o.label &&
177
+ kind == o.kind &&
178
+ recommended == o.recommended
179
+ end
180
+
181
+ # @see the `==` method
182
+ # @param [Object] Object to be compared
183
+ def eql?(o)
184
+ self == o
185
+ end
186
+
187
+ # Calculates hash code according to all attributes.
188
+ # @return [Integer] Hash code
189
+ def hash
190
+ [id, label, kind, recommended].hash
191
+ end
192
+
193
+ # Builds the object from hash
194
+ # @param [Hash] attributes Model attributes in the form of hash
195
+ # @return [Object] Returns the model itself
196
+ def self.build_from_hash(attributes)
197
+ return nil unless attributes.is_a?(Hash)
198
+ attributes = attributes.transform_keys(&:to_sym)
199
+ transformed_hash = {}
200
+ openapi_types.each_pair do |key, type|
201
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
202
+ transformed_hash["#{key}"] = nil
203
+ elsif type =~ /\AArray<(.*)>/i
204
+ # check to ensure the input is an array given that the attribute
205
+ # is documented as an array but the input is not
206
+ if attributes[attribute_map[key]].is_a?(Array)
207
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
208
+ end
209
+ elsif !attributes[attribute_map[key]].nil?
210
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
211
+ end
212
+ end
213
+ new(transformed_hash)
214
+ end
215
+
216
+ # Deserializes the data based on type
217
+ # @param string type Data type
218
+ # @param string value Value to be deserialized
219
+ # @return [Object] Deserialized data
220
+ def self._deserialize(type, value)
221
+ case type.to_sym
222
+ when :Time
223
+ Time.parse(value)
224
+ when :Date
225
+ Date.parse(value)
226
+ when :String
227
+ value.to_s
228
+ when :Integer
229
+ value.to_i
230
+ when :Float
231
+ value.to_f
232
+ when :Boolean
233
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
234
+ true
235
+ else
236
+ false
237
+ end
238
+ when :Object
239
+ # generic object (usually a Hash), return directly
240
+ value
241
+ when /\AArray<(?<inner_type>.+)>\z/
242
+ inner_type = Regexp.last_match[:inner_type]
243
+ value.map { |v| _deserialize(inner_type, v) }
244
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
245
+ k_type = Regexp.last_match[:k_type]
246
+ v_type = Regexp.last_match[:v_type]
247
+ {}.tap do |hash|
248
+ value.each do |k, v|
249
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
250
+ end
251
+ end
252
+ else # model
253
+ # models (e.g. Pet) or oneOf
254
+ klass = ApiSdkRb.const_get(type)
255
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
256
+ end
257
+ end
258
+
259
+ # Returns the string representation of the object
260
+ # @return [String] String presentation of the object
261
+ def to_s
262
+ to_hash.to_s
263
+ end
264
+
265
+ # to_body is an alias to to_hash (backward compatibility)
266
+ # @return [Hash] Returns the object in the form of hash
267
+ def to_body
268
+ to_hash
269
+ end
270
+
271
+ # Returns the object in the form of hash
272
+ # @return [Hash] Returns the object in the form of hash
273
+ def to_hash
274
+ hash = {}
275
+ self.class.attribute_map.each_pair do |attr, param|
276
+ value = self.send(attr)
277
+ if value.nil?
278
+ is_nullable = self.class.openapi_nullable.include?(attr)
279
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
280
+ end
281
+
282
+ hash[param] = _to_hash(value)
283
+ end
284
+ hash
285
+ end
286
+
287
+ # Outputs non-array value in the form of hash
288
+ # For object, use to_hash. Otherwise, just return the value
289
+ # @param [Object] value Any valid value
290
+ # @return [Hash] Returns the value in the form of hash
291
+ def _to_hash(value)
292
+ if value.is_a?(Array)
293
+ value.compact.map { |v| _to_hash(v) }
294
+ elsif value.is_a?(Hash)
295
+ {}.tap do |hash|
296
+ value.each { |k, v| hash[k] = _to_hash(v) }
297
+ end
298
+ elsif value.respond_to? :to_hash
299
+ value.to_hash
300
+ else
301
+ value
302
+ end
303
+ end
304
+
305
+ end
306
+
307
+ end