solifyn 1.1.4 → 1.1.6

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 (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -4
  3. data/docs/CreateEntitlementDto.md +42 -0
  4. data/docs/CreateFramerTemplateDto.md +22 -0
  5. data/docs/EntitlementDetailResponseDto.md +56 -0
  6. data/docs/EntitlementGrantResponseDto.md +4 -0
  7. data/docs/EntitlementGrantsApi.md +5 -1
  8. data/docs/EntitlementsApi.md +331 -0
  9. data/docs/FramerIntegrationApi.md +355 -0
  10. data/docs/FramerTemplateResponseDto.md +30 -0
  11. data/docs/LinkedProductDto.md +20 -0
  12. data/docs/ProductCreate.md +7 -1
  13. data/docs/ProductUpdate.md +7 -1
  14. data/docs/UpdateEntitlementDto.md +42 -0
  15. data/docs/UpdateFramerTemplateDto.md +22 -0
  16. data/lib/solifyn/api/entitlement_grants_api.rb +6 -0
  17. data/lib/solifyn/api/entitlements_api.rb +347 -0
  18. data/lib/solifyn/api/framer_integration_api.rb +345 -0
  19. data/lib/solifyn/models/create_entitlement_dto.rb +385 -0
  20. data/lib/solifyn/models/create_framer_template_dto.rb +249 -0
  21. data/lib/solifyn/models/entitlement_detail_response_dto.rb +470 -0
  22. data/lib/solifyn/models/entitlement_grant_response_dto.rb +21 -1
  23. data/lib/solifyn/models/framer_template_response_dto.rb +317 -0
  24. data/lib/solifyn/models/linked_product_dto.rb +239 -0
  25. data/lib/solifyn/models/product_create.rb +38 -4
  26. data/lib/solifyn/models/product_update.rb +38 -4
  27. data/lib/solifyn/models/update_entitlement_dto.rb +371 -0
  28. data/lib/solifyn/models/update_framer_template_dto.rb +235 -0
  29. data/lib/solifyn/version.rb +1 -1
  30. data/lib/solifyn.rb +9 -0
  31. data/spec/api/entitlements_api_spec.rb +95 -0
  32. data/spec/api/framer_integration_api_spec.rb +95 -0
  33. data/spec/models/create_entitlement_dto_spec.rb +112 -0
  34. data/spec/models/create_framer_template_dto_spec.rb +48 -0
  35. data/spec/models/entitlement_detail_response_dto_spec.rb +150 -0
  36. data/spec/models/framer_template_response_dto_spec.rb +72 -0
  37. data/spec/models/linked_product_dto_spec.rb +42 -0
  38. data/spec/models/update_entitlement_dto_spec.rb +112 -0
  39. data/spec/models/update_framer_template_dto_spec.rb +48 -0
  40. metadata +172 -136
@@ -0,0 +1,470 @@
1
+ =begin
2
+ #Solifyn API
3
+
4
+ #Welcome to the Solifyn API Reference. Leverage our secure endpoints to manage products and issue, validate, and manage software license keys programmatically.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Solifyn
17
+ class EntitlementDetailResponseDto
18
+ # The unique entitlement ID
19
+ attr_accessor :id
20
+
21
+ # The owning business ID
22
+ attr_accessor :business_id
23
+
24
+ # The name of the entitlement
25
+ attr_accessor :name
26
+
27
+ # The type of access to grant
28
+ attr_accessor :type
29
+
30
+ # Status of the entitlement
31
+ attr_accessor :status
32
+
33
+ # When the entitlement was created
34
+ attr_accessor :created_at
35
+
36
+ # When the entitlement was last updated
37
+ attr_accessor :updated_at
38
+
39
+ # The GitHub repository (e.g., owner/repo)
40
+ attr_accessor :github_repo
41
+
42
+ # The GitHub repository permission level
43
+ attr_accessor :github_permission
44
+
45
+ # The Discord Guild/Server ID
46
+ attr_accessor :discord_guild_id
47
+
48
+ # The Discord Role ID to assign
49
+ attr_accessor :discord_role_id
50
+
51
+ # The associated Framer Template ID
52
+ attr_accessor :framer_template_id
53
+
54
+ # The static License Key (if not dynamically generated)
55
+ attr_accessor :license_key
56
+
57
+ # The maximum activation limit for licenses
58
+ attr_accessor :activation_limit
59
+
60
+ # A message shown to the user upon license activation
61
+ attr_accessor :activation_message
62
+
63
+ # The number of hours until the entitlement expires
64
+ attr_accessor :expiry_hours
65
+
66
+ # The digital download URL or redirect link
67
+ attr_accessor :digital_link
68
+
69
+ # Custom setup instructions for the user
70
+ attr_accessor :instructions
71
+
72
+ # Number of active customer grants issued from this entitlement
73
+ attr_accessor :grants_count
74
+
75
+ # Products that are currently linked to this entitlement
76
+ attr_accessor :products
77
+
78
+ # Attribute mapping from ruby-style variable name to JSON key.
79
+ def self.attribute_map
80
+ {
81
+ :'id' => :'id',
82
+ :'business_id' => :'businessId',
83
+ :'name' => :'name',
84
+ :'type' => :'type',
85
+ :'status' => :'status',
86
+ :'created_at' => :'createdAt',
87
+ :'updated_at' => :'updatedAt',
88
+ :'github_repo' => :'githubRepo',
89
+ :'github_permission' => :'githubPermission',
90
+ :'discord_guild_id' => :'discordGuildId',
91
+ :'discord_role_id' => :'discordRoleId',
92
+ :'framer_template_id' => :'framerTemplateId',
93
+ :'license_key' => :'licenseKey',
94
+ :'activation_limit' => :'activationLimit',
95
+ :'activation_message' => :'activationMessage',
96
+ :'expiry_hours' => :'expiryHours',
97
+ :'digital_link' => :'digitalLink',
98
+ :'instructions' => :'instructions',
99
+ :'grants_count' => :'grantsCount',
100
+ :'products' => :'products'
101
+ }
102
+ end
103
+
104
+ # Returns all the JSON keys this model knows about
105
+ def self.acceptable_attributes
106
+ attribute_map.values
107
+ end
108
+
109
+ # Attribute type mapping.
110
+ def self.openapi_types
111
+ {
112
+ :'id' => :'String',
113
+ :'business_id' => :'String',
114
+ :'name' => :'String',
115
+ :'type' => :'String',
116
+ :'status' => :'String',
117
+ :'created_at' => :'Time',
118
+ :'updated_at' => :'Time',
119
+ :'github_repo' => :'String',
120
+ :'github_permission' => :'String',
121
+ :'discord_guild_id' => :'String',
122
+ :'discord_role_id' => :'String',
123
+ :'framer_template_id' => :'String',
124
+ :'license_key' => :'String',
125
+ :'activation_limit' => :'Float',
126
+ :'activation_message' => :'String',
127
+ :'expiry_hours' => :'Float',
128
+ :'digital_link' => :'String',
129
+ :'instructions' => :'String',
130
+ :'grants_count' => :'Float',
131
+ :'products' => :'Array<LinkedProductDto>'
132
+ }
133
+ end
134
+
135
+ # List of attributes with nullable: true
136
+ def self.openapi_nullable
137
+ Set.new([
138
+ ])
139
+ end
140
+
141
+ # Initializes the object
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ def initialize(attributes = {})
144
+ if (!attributes.is_a?(Hash))
145
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Solifyn::EntitlementDetailResponseDto` initialize method"
146
+ end
147
+
148
+ # check to see if the attribute exists and convert string to symbol for hash key
149
+ attributes = attributes.each_with_object({}) { |(k, v), h|
150
+ if (!self.class.attribute_map.key?(k.to_sym))
151
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Solifyn::EntitlementDetailResponseDto`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
152
+ end
153
+ h[k.to_sym] = v
154
+ }
155
+
156
+ if attributes.key?(:'id')
157
+ self.id = attributes[:'id']
158
+ else
159
+ self.id = nil
160
+ end
161
+
162
+ if attributes.key?(:'business_id')
163
+ self.business_id = attributes[:'business_id']
164
+ else
165
+ self.business_id = nil
166
+ end
167
+
168
+ if attributes.key?(:'name')
169
+ self.name = attributes[:'name']
170
+ else
171
+ self.name = nil
172
+ end
173
+
174
+ if attributes.key?(:'type')
175
+ self.type = attributes[:'type']
176
+ else
177
+ self.type = nil
178
+ end
179
+
180
+ if attributes.key?(:'status')
181
+ self.status = attributes[:'status']
182
+ else
183
+ self.status = nil
184
+ end
185
+
186
+ if attributes.key?(:'created_at')
187
+ self.created_at = attributes[:'created_at']
188
+ else
189
+ self.created_at = nil
190
+ end
191
+
192
+ if attributes.key?(:'updated_at')
193
+ self.updated_at = attributes[:'updated_at']
194
+ else
195
+ self.updated_at = nil
196
+ end
197
+
198
+ if attributes.key?(:'github_repo')
199
+ self.github_repo = attributes[:'github_repo']
200
+ end
201
+
202
+ if attributes.key?(:'github_permission')
203
+ self.github_permission = attributes[:'github_permission']
204
+ end
205
+
206
+ if attributes.key?(:'discord_guild_id')
207
+ self.discord_guild_id = attributes[:'discord_guild_id']
208
+ end
209
+
210
+ if attributes.key?(:'discord_role_id')
211
+ self.discord_role_id = attributes[:'discord_role_id']
212
+ end
213
+
214
+ if attributes.key?(:'framer_template_id')
215
+ self.framer_template_id = attributes[:'framer_template_id']
216
+ end
217
+
218
+ if attributes.key?(:'license_key')
219
+ self.license_key = attributes[:'license_key']
220
+ end
221
+
222
+ if attributes.key?(:'activation_limit')
223
+ self.activation_limit = attributes[:'activation_limit']
224
+ end
225
+
226
+ if attributes.key?(:'activation_message')
227
+ self.activation_message = attributes[:'activation_message']
228
+ end
229
+
230
+ if attributes.key?(:'expiry_hours')
231
+ self.expiry_hours = attributes[:'expiry_hours']
232
+ end
233
+
234
+ if attributes.key?(:'digital_link')
235
+ self.digital_link = attributes[:'digital_link']
236
+ end
237
+
238
+ if attributes.key?(:'instructions')
239
+ self.instructions = attributes[:'instructions']
240
+ end
241
+
242
+ if attributes.key?(:'grants_count')
243
+ self.grants_count = attributes[:'grants_count']
244
+ else
245
+ self.grants_count = nil
246
+ end
247
+
248
+ if attributes.key?(:'products')
249
+ if (value = attributes[:'products']).is_a?(Array)
250
+ self.products = value
251
+ end
252
+ else
253
+ self.products = nil
254
+ end
255
+ end
256
+
257
+ # Show invalid properties with the reasons. Usually used together with valid?
258
+ # @return Array for valid properties with the reasons
259
+ def list_invalid_properties
260
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
261
+ invalid_properties = Array.new
262
+ if @id.nil?
263
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
264
+ end
265
+
266
+ if @business_id.nil?
267
+ invalid_properties.push('invalid value for "business_id", business_id cannot be nil.')
268
+ end
269
+
270
+ if @name.nil?
271
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
272
+ end
273
+
274
+ if @type.nil?
275
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
276
+ end
277
+
278
+ if @status.nil?
279
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
280
+ end
281
+
282
+ if @created_at.nil?
283
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
284
+ end
285
+
286
+ if @updated_at.nil?
287
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
288
+ end
289
+
290
+ if @grants_count.nil?
291
+ invalid_properties.push('invalid value for "grants_count", grants_count cannot be nil.')
292
+ end
293
+
294
+ if @products.nil?
295
+ invalid_properties.push('invalid value for "products", products cannot be nil.')
296
+ end
297
+
298
+ invalid_properties
299
+ end
300
+
301
+ # Check to see if the all the properties in the model are valid
302
+ # @return true if the model is valid
303
+ def valid?
304
+ warn '[DEPRECATED] the `valid?` method is obsolete'
305
+ return false if @id.nil?
306
+ return false if @business_id.nil?
307
+ return false if @name.nil?
308
+ return false if @type.nil?
309
+ return false if @status.nil?
310
+ return false if @created_at.nil?
311
+ return false if @updated_at.nil?
312
+ return false if @grants_count.nil?
313
+ return false if @products.nil?
314
+ true
315
+ end
316
+
317
+ # Checks equality by comparing each attribute.
318
+ # @param [Object] Object to be compared
319
+ def ==(o)
320
+ return true if self.equal?(o)
321
+ self.class == o.class &&
322
+ id == o.id &&
323
+ business_id == o.business_id &&
324
+ name == o.name &&
325
+ type == o.type &&
326
+ status == o.status &&
327
+ created_at == o.created_at &&
328
+ updated_at == o.updated_at &&
329
+ github_repo == o.github_repo &&
330
+ github_permission == o.github_permission &&
331
+ discord_guild_id == o.discord_guild_id &&
332
+ discord_role_id == o.discord_role_id &&
333
+ framer_template_id == o.framer_template_id &&
334
+ license_key == o.license_key &&
335
+ activation_limit == o.activation_limit &&
336
+ activation_message == o.activation_message &&
337
+ expiry_hours == o.expiry_hours &&
338
+ digital_link == o.digital_link &&
339
+ instructions == o.instructions &&
340
+ grants_count == o.grants_count &&
341
+ products == o.products
342
+ end
343
+
344
+ # @see the `==` method
345
+ # @param [Object] Object to be compared
346
+ def eql?(o)
347
+ self == o
348
+ end
349
+
350
+ # Calculates hash code according to all attributes.
351
+ # @return [Integer] Hash code
352
+ def hash
353
+ [id, business_id, name, type, status, created_at, updated_at, github_repo, github_permission, discord_guild_id, discord_role_id, framer_template_id, license_key, activation_limit, activation_message, expiry_hours, digital_link, instructions, grants_count, products].hash
354
+ end
355
+
356
+ # Builds the object from hash
357
+ # @param [Hash] attributes Model attributes in the form of hash
358
+ # @return [Object] Returns the model itself
359
+ def self.build_from_hash(attributes)
360
+ return nil unless attributes.is_a?(Hash)
361
+ attributes = attributes.transform_keys(&:to_sym)
362
+ transformed_hash = {}
363
+ openapi_types.each_pair do |key, type|
364
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
365
+ transformed_hash["#{key}"] = nil
366
+ elsif type =~ /\AArray<(.*)>/i
367
+ # check to ensure the input is an array given that the attribute
368
+ # is documented as an array but the input is not
369
+ if attributes[attribute_map[key]].is_a?(Array)
370
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
371
+ end
372
+ elsif !attributes[attribute_map[key]].nil?
373
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
374
+ end
375
+ end
376
+ new(transformed_hash)
377
+ end
378
+
379
+ # Deserializes the data based on type
380
+ # @param string type Data type
381
+ # @param string value Value to be deserialized
382
+ # @return [Object] Deserialized data
383
+ def self._deserialize(type, value)
384
+ case type.to_sym
385
+ when :Time
386
+ Time.parse(value)
387
+ when :Date
388
+ Date.parse(value)
389
+ when :String
390
+ value.to_s
391
+ when :Integer
392
+ value.to_i
393
+ when :Float
394
+ value.to_f
395
+ when :Boolean
396
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
397
+ true
398
+ else
399
+ false
400
+ end
401
+ when :Object
402
+ # generic object (usually a Hash), return directly
403
+ value
404
+ when /\AArray<(?<inner_type>.+)>\z/
405
+ inner_type = Regexp.last_match[:inner_type]
406
+ value.map { |v| _deserialize(inner_type, v) }
407
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
408
+ k_type = Regexp.last_match[:k_type]
409
+ v_type = Regexp.last_match[:v_type]
410
+ {}.tap do |hash|
411
+ value.each do |k, v|
412
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
413
+ end
414
+ end
415
+ else # model
416
+ # models (e.g. Pet) or oneOf
417
+ klass = Solifyn.const_get(type)
418
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
419
+ end
420
+ end
421
+
422
+ # Returns the string representation of the object
423
+ # @return [String] String presentation of the object
424
+ def to_s
425
+ to_hash.to_s
426
+ end
427
+
428
+ # to_body is an alias to to_hash (backward compatibility)
429
+ # @return [Hash] Returns the object in the form of hash
430
+ def to_body
431
+ to_hash
432
+ end
433
+
434
+ # Returns the object in the form of hash
435
+ # @return [Hash] Returns the object in the form of hash
436
+ def to_hash
437
+ hash = {}
438
+ self.class.attribute_map.each_pair do |attr, param|
439
+ value = self.send(attr)
440
+ if value.nil?
441
+ is_nullable = self.class.openapi_nullable.include?(attr)
442
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
443
+ end
444
+
445
+ hash[param] = _to_hash(value)
446
+ end
447
+ hash
448
+ end
449
+
450
+ # Outputs non-array value in the form of hash
451
+ # For object, use to_hash. Otherwise, just return the value
452
+ # @param [Object] value Any valid value
453
+ # @return [Hash] Returns the value in the form of hash
454
+ def _to_hash(value)
455
+ if value.is_a?(Array)
456
+ value.compact.map { |v| _to_hash(v) }
457
+ elsif value.is_a?(Hash)
458
+ {}.tap do |hash|
459
+ value.each { |k, v| hash[k] = _to_hash(v) }
460
+ end
461
+ elsif value.respond_to? :to_hash
462
+ value.to_hash
463
+ else
464
+ value
465
+ end
466
+ end
467
+
468
+ end
469
+
470
+ end
@@ -54,6 +54,12 @@ module Solifyn
54
54
  # The connected customer Discord user ID.
55
55
  attr_accessor :discord_user_id
56
56
 
57
+ # The Framer template ID if type is FRAMER.
58
+ attr_accessor :framer_template_id
59
+
60
+ # The single-use remix link generated for the customer if type is FRAMER.
61
+ attr_accessor :framer_remix_link
62
+
57
63
  # Delivery status of the collaborator invite (PENDING, DELIVERED, FAILED, REVOKED).
58
64
  attr_accessor :status
59
65
 
@@ -88,6 +94,8 @@ module Solifyn
88
94
  :'discord_role_id' => :'discordRoleId',
89
95
  :'discord_username' => :'discordUsername',
90
96
  :'discord_user_id' => :'discordUserId',
97
+ :'framer_template_id' => :'framerTemplateId',
98
+ :'framer_remix_link' => :'framerRemixLink',
91
99
  :'status' => :'status',
92
100
  :'oauth_url' => :'oauthUrl',
93
101
  :'error_details' => :'errorDetails',
@@ -118,6 +126,8 @@ module Solifyn
118
126
  :'discord_role_id' => :'String',
119
127
  :'discord_username' => :'String',
120
128
  :'discord_user_id' => :'String',
129
+ :'framer_template_id' => :'String',
130
+ :'framer_remix_link' => :'String',
121
131
  :'status' => :'String',
122
132
  :'oauth_url' => :'String',
123
133
  :'error_details' => :'String',
@@ -210,6 +220,14 @@ module Solifyn
210
220
  self.discord_user_id = attributes[:'discord_user_id']
211
221
  end
212
222
 
223
+ if attributes.key?(:'framer_template_id')
224
+ self.framer_template_id = attributes[:'framer_template_id']
225
+ end
226
+
227
+ if attributes.key?(:'framer_remix_link')
228
+ self.framer_remix_link = attributes[:'framer_remix_link']
229
+ end
230
+
213
231
  if attributes.key?(:'status')
214
232
  self.status = attributes[:'status']
215
233
  else
@@ -314,6 +332,8 @@ module Solifyn
314
332
  discord_role_id == o.discord_role_id &&
315
333
  discord_username == o.discord_username &&
316
334
  discord_user_id == o.discord_user_id &&
335
+ framer_template_id == o.framer_template_id &&
336
+ framer_remix_link == o.framer_remix_link &&
317
337
  status == o.status &&
318
338
  oauth_url == o.oauth_url &&
319
339
  error_details == o.error_details &&
@@ -331,7 +351,7 @@ module Solifyn
331
351
  # Calculates hash code according to all attributes.
332
352
  # @return [Integer] Hash code
333
353
  def hash
334
- [id, business_id, customer_id, payment_id, product_id, type, github_repo, github_permission, github_username, discord_guild_id, discord_role_id, discord_username, discord_user_id, status, oauth_url, error_details, metadata, created_at, updated_at].hash
354
+ [id, business_id, customer_id, payment_id, product_id, type, github_repo, github_permission, github_username, discord_guild_id, discord_role_id, discord_username, discord_user_id, framer_template_id, framer_remix_link, status, oauth_url, error_details, metadata, created_at, updated_at].hash
335
355
  end
336
356
 
337
357
  # Builds the object from hash