lingara-apps 0.1.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.
@@ -0,0 +1,417 @@
1
+ =begin
2
+ #Lingara apps
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 2026-10-affable-towhee
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::Apps
17
+ class AppRenderRequest
18
+ attr_accessor :type
19
+
20
+ attr_accessor :id
21
+
22
+ attr_accessor :install_id
23
+
24
+ attr_accessor :subject
25
+
26
+ attr_accessor :slot
27
+
28
+ attr_accessor :locale
29
+
30
+ attr_accessor :context
31
+
32
+ class EnumAttributeValidator
33
+ attr_reader :datatype
34
+ attr_reader :allowable_values
35
+
36
+ def initialize(datatype, allowable_values)
37
+ @allowable_values = allowable_values.map do |value|
38
+ case datatype.to_s
39
+ when /Integer/i
40
+ value.to_i
41
+ when /Float/i
42
+ value.to_f
43
+ else
44
+ value
45
+ end
46
+ end
47
+ end
48
+
49
+ def valid?(value)
50
+ !value || allowable_values.include?(value)
51
+ end
52
+ end
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'type' => :'type',
58
+ :'id' => :'id',
59
+ :'install_id' => :'install_id',
60
+ :'subject' => :'subject',
61
+ :'slot' => :'slot',
62
+ :'locale' => :'locale',
63
+ :'context' => :'context'
64
+ }
65
+ end
66
+
67
+ # Returns attribute mapping this model knows about
68
+ def self.acceptable_attribute_map
69
+ attribute_map
70
+ end
71
+
72
+ # Returns all the JSON keys this model knows about
73
+ def self.acceptable_attributes
74
+ acceptable_attribute_map.values
75
+ end
76
+
77
+ # Attribute type mapping.
78
+ def self.openapi_types
79
+ {
80
+ :'type' => :'String',
81
+ :'id' => :'String',
82
+ :'install_id' => :'String',
83
+ :'subject' => :'String',
84
+ :'slot' => :'AppSlotName',
85
+ :'locale' => :'String',
86
+ :'context' => :'Array<Object>'
87
+ }
88
+ end
89
+
90
+ # List of attributes with nullable: true
91
+ def self.openapi_nullable
92
+ Set.new([
93
+ ])
94
+ end
95
+
96
+ # Initializes the object
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ def initialize(attributes = {})
99
+ if (!attributes.is_a?(Hash))
100
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Lingara::Apps::AppRenderRequest` initialize method"
101
+ end
102
+
103
+ # check to see if the attribute exists and convert string to symbol for hash key
104
+ acceptable_attribute_map = self.class.acceptable_attribute_map
105
+ attributes = attributes.each_with_object({}) { |(k, v), h|
106
+ if (!acceptable_attribute_map.key?(k.to_sym))
107
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Lingara::Apps::AppRenderRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
108
+ end
109
+ h[k.to_sym] = v
110
+ }
111
+
112
+ if attributes.key?(:'type')
113
+ self.type = attributes[:'type']
114
+ else
115
+ self.type = nil
116
+ end
117
+
118
+ if attributes.key?(:'id')
119
+ self.id = attributes[:'id']
120
+ else
121
+ self.id = nil
122
+ end
123
+
124
+ if attributes.key?(:'install_id')
125
+ self.install_id = attributes[:'install_id']
126
+ else
127
+ self.install_id = nil
128
+ end
129
+
130
+ if attributes.key?(:'subject')
131
+ self.subject = attributes[:'subject']
132
+ else
133
+ self.subject = nil
134
+ end
135
+
136
+ if attributes.key?(:'slot')
137
+ self.slot = attributes[:'slot']
138
+ else
139
+ self.slot = nil
140
+ end
141
+
142
+ if attributes.key?(:'locale')
143
+ self.locale = attributes[:'locale']
144
+ else
145
+ self.locale = nil
146
+ end
147
+
148
+ if attributes.key?(:'context')
149
+ if (value = attributes[:'context']).is_a?(Array)
150
+ self.context = value
151
+ end
152
+ else
153
+ self.context = nil
154
+ end
155
+ end
156
+
157
+ # Show invalid properties with the reasons. Usually used together with valid?
158
+ # @return Array for valid properties with the reasons
159
+ def list_invalid_properties
160
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
161
+ invalid_properties = Array.new
162
+ if @type.nil?
163
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
164
+ end
165
+
166
+ if @id.nil?
167
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
168
+ end
169
+
170
+ if @install_id.nil?
171
+ invalid_properties.push('invalid value for "install_id", install_id cannot be nil.')
172
+ end
173
+
174
+ if @subject.nil?
175
+ invalid_properties.push('invalid value for "subject", subject cannot be nil.')
176
+ end
177
+
178
+ if @slot.nil?
179
+ invalid_properties.push('invalid value for "slot", slot cannot be nil.')
180
+ end
181
+
182
+ if @locale.nil?
183
+ invalid_properties.push('invalid value for "locale", locale cannot be nil.')
184
+ end
185
+
186
+ if @context.nil?
187
+ invalid_properties.push('invalid value for "context", context cannot be nil.')
188
+ end
189
+
190
+ invalid_properties
191
+ end
192
+
193
+ # Check to see if the all the properties in the model are valid
194
+ # @return true if the model is valid
195
+ def valid?
196
+ warn '[DEPRECATED] the `valid?` method is obsolete'
197
+ return false if @type.nil?
198
+ return false if @id.nil?
199
+ return false if @install_id.nil?
200
+ return false if @subject.nil?
201
+ return false if @slot.nil?
202
+ return false if @locale.nil?
203
+ return false if @context.nil?
204
+ true
205
+ end
206
+
207
+ # Custom attribute writer method with validation
208
+ # @param [Object] type Value to be assigned
209
+ def type=(type)
210
+ if type.nil?
211
+ fail ArgumentError, 'type cannot be nil'
212
+ end
213
+
214
+ @type = type
215
+ end
216
+
217
+ # Custom attribute writer method with validation
218
+ # @param [Object] id Value to be assigned
219
+ def id=(id)
220
+ if id.nil?
221
+ fail ArgumentError, 'id cannot be nil'
222
+ end
223
+
224
+ @id = id
225
+ end
226
+
227
+ # Custom attribute writer method with validation
228
+ # @param [Object] install_id Value to be assigned
229
+ def install_id=(install_id)
230
+ if install_id.nil?
231
+ fail ArgumentError, 'install_id cannot be nil'
232
+ end
233
+
234
+ @install_id = install_id
235
+ end
236
+
237
+ # Custom attribute writer method with validation
238
+ # @param [Object] subject Value to be assigned
239
+ def subject=(subject)
240
+ if subject.nil?
241
+ fail ArgumentError, 'subject cannot be nil'
242
+ end
243
+
244
+ @subject = subject
245
+ end
246
+
247
+ # Custom attribute writer method with validation
248
+ # @param [Object] slot Value to be assigned
249
+ def slot=(slot)
250
+ if slot.nil?
251
+ fail ArgumentError, 'slot cannot be nil'
252
+ end
253
+
254
+ @slot = slot
255
+ end
256
+
257
+ # Custom attribute writer method with validation
258
+ # @param [Object] locale Value to be assigned
259
+ def locale=(locale)
260
+ if locale.nil?
261
+ fail ArgumentError, 'locale cannot be nil'
262
+ end
263
+
264
+ @locale = locale
265
+ end
266
+
267
+ # Custom attribute writer method with validation
268
+ # @param [Object] context Value to be assigned
269
+ def context=(context)
270
+ if context.nil?
271
+ fail ArgumentError, 'context cannot be nil'
272
+ end
273
+
274
+ @context = context
275
+ end
276
+
277
+ # Checks equality by comparing each attribute.
278
+ # @param [Object] Object to be compared
279
+ def ==(o)
280
+ return true if self.equal?(o)
281
+ self.class == o.class &&
282
+ type == o.type &&
283
+ id == o.id &&
284
+ install_id == o.install_id &&
285
+ subject == o.subject &&
286
+ slot == o.slot &&
287
+ locale == o.locale &&
288
+ context == o.context
289
+ end
290
+
291
+ # @see the `==` method
292
+ # @param [Object] Object to be compared
293
+ def eql?(o)
294
+ self == o
295
+ end
296
+
297
+ # Calculates hash code according to all attributes.
298
+ # @return [Integer] Hash code
299
+ def hash
300
+ [type, id, install_id, subject, slot, locale, context].hash
301
+ end
302
+
303
+ # Builds the object from hash
304
+ # @param [Hash] attributes Model attributes in the form of hash
305
+ # @return [Object] Returns the model itself
306
+ def self.build_from_hash(attributes)
307
+ return nil unless attributes.is_a?(Hash)
308
+ attributes = attributes.transform_keys(&:to_sym)
309
+ transformed_hash = {}
310
+ openapi_types.each_pair do |key, type|
311
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
312
+ transformed_hash["#{key}"] = nil
313
+ elsif type =~ /\AArray<(.*)>/i
314
+ # check to ensure the input is an array given that the attribute
315
+ # is documented as an array but the input is not
316
+ if attributes[attribute_map[key]].is_a?(Array)
317
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
318
+ end
319
+ elsif !attributes[attribute_map[key]].nil?
320
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
321
+ end
322
+ end
323
+ new(transformed_hash)
324
+ end
325
+
326
+ # Deserializes the data based on type
327
+ # @param string type Data type
328
+ # @param string value Value to be deserialized
329
+ # @return [Object] Deserialized data
330
+ def self._deserialize(type, value)
331
+ case type.to_sym
332
+ when :Time
333
+ Time.parse(value)
334
+ when :Date
335
+ Date.parse(value)
336
+ when :String
337
+ value.to_s
338
+ when :Integer
339
+ value.to_i
340
+ when :Float
341
+ value.to_f
342
+ when :Boolean
343
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
344
+ true
345
+ else
346
+ false
347
+ end
348
+ when :Object
349
+ # generic object (usually a Hash), return directly
350
+ value
351
+ when /\AArray<(?<inner_type>.+)>\z/
352
+ inner_type = Regexp.last_match[:inner_type]
353
+ value.map { |v| _deserialize(inner_type, v) }
354
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
355
+ k_type = Regexp.last_match[:k_type]
356
+ v_type = Regexp.last_match[:v_type]
357
+ {}.tap do |hash|
358
+ value.each do |k, v|
359
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
360
+ end
361
+ end
362
+ else # model
363
+ # models (e.g. Pet) or oneOf
364
+ klass = Lingara::Apps.const_get(type)
365
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
366
+ end
367
+ end
368
+
369
+ # Returns the string representation of the object
370
+ # @return [String] String presentation of the object
371
+ def to_s
372
+ to_hash.to_s
373
+ end
374
+
375
+ # to_body is an alias to to_hash (backward compatibility)
376
+ # @return [Hash] Returns the object in the form of hash
377
+ def to_body
378
+ to_hash
379
+ end
380
+
381
+ # Returns the object in the form of hash
382
+ # @return [Hash] Returns the object in the form of hash
383
+ def to_hash
384
+ hash = {}
385
+ self.class.attribute_map.each_pair do |attr, param|
386
+ value = self.send(attr)
387
+ if value.nil?
388
+ is_nullable = self.class.openapi_nullable.include?(attr)
389
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
390
+ end
391
+
392
+ hash[param] = _to_hash(value)
393
+ end
394
+ hash
395
+ end
396
+
397
+ # Outputs non-array value in the form of hash
398
+ # For object, use to_hash. Otherwise, just return the value
399
+ # @param [Object] value Any valid value
400
+ # @return [Hash] Returns the value in the form of hash
401
+ def _to_hash(value)
402
+ if value.is_a?(Array)
403
+ value.compact.map { |v| _to_hash(v) }
404
+ elsif value.is_a?(Hash)
405
+ {}.tap do |hash|
406
+ value.each { |k, v| hash[k] = _to_hash(v) }
407
+ end
408
+ elsif value.respond_to? :to_hash
409
+ value.to_hash
410
+ else
411
+ value
412
+ end
413
+ end
414
+
415
+ end
416
+
417
+ end
@@ -0,0 +1,41 @@
1
+ =begin
2
+ #Lingara apps
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 2026-10-affable-towhee
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::Apps
17
+ class AppSlotName
18
+ PLANS_EMPTY_DETAIL = "plans.empty_detail".freeze
19
+ HOME_SIDE = "home.side".freeze
20
+ UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [PLANS_EMPTY_DETAIL, HOME_SIDE, 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 AppSlotName.all_vars.include?(value)
38
+ raise "Invalid ENUM value #{value} for class #AppSlotName"
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,41 @@
1
+ =begin
2
+ #Lingara apps
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 2026-10-affable-towhee
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::Apps
17
+ class ButtonStyle
18
+ PRIMARY = "primary".freeze
19
+ SECONDARY = "secondary".freeze
20
+ UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [PRIMARY, SECONDARY, 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 ButtonStyle.all_vars.include?(value)
38
+ raise "Invalid ENUM value #{value} for class #ButtonStyle"
39
+ end
40
+ end
41
+ end