solifyn 1.0.0 → 1.0.5

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 (155) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +20 -7
  3. data/docs/BalanceApi.md +1 -1
  4. data/docs/CheckoutApi.md +1 -1
  5. data/docs/CheckoutLinksApi.md +1 -1
  6. data/docs/CheckoutSessionDetailsDto.md +3 -1
  7. data/docs/CollectionProductDto.md +12 -0
  8. data/docs/CollectionsApi.md +1 -1
  9. data/docs/CustomersApi.md +1 -1
  10. data/docs/DefaultApi.md +285 -1
  11. data/docs/DeveloperApi.md +1 -1
  12. data/docs/DigitalFileApi.md +1 -1
  13. data/docs/DiscordIntegrationApi.md +135 -0
  14. data/docs/DiscordRolesResponseDto.md +24 -0
  15. data/docs/DiscountsApi.md +1 -1
  16. data/docs/DisputesApi.md +1 -1
  17. data/docs/EntitlementGrantResponseDto.md +54 -0
  18. data/docs/EntitlementGrantsApi.md +289 -0
  19. data/docs/GitHubIntegrationApi.md +145 -0
  20. data/docs/GithubReposResponseDto.md +22 -0
  21. data/docs/LicenseApi.md +1 -1
  22. data/docs/LicenseKeysApi.md +1 -1
  23. data/docs/LicenseKeysClientApi.md +1 -1
  24. data/docs/MetersApi.md +1 -1
  25. data/docs/OrdersApi.md +1 -1
  26. data/docs/Product.md +12 -0
  27. data/docs/ProductAddOnsApi.md +1 -1
  28. data/docs/ProductCreate.md +12 -0
  29. data/docs/ProductUpdate.md +12 -0
  30. data/docs/ProductsApi.md +1 -1
  31. data/docs/RefundRequestsApi.md +1 -1
  32. data/docs/RefundsChargebacksApi.md +1 -1
  33. data/docs/SubscriptionsApi.md +1 -1
  34. data/docs/SyncLoginDto.md +18 -0
  35. data/docs/WebhookApi.md +1 -1
  36. data/docs/WebhookEndpointApi.md +55 -10
  37. data/docs/WebhookEntitlementGrantPayload.md +44 -0
  38. data/git_push.sh +2 -2
  39. data/lib/solifyn/api/default_api.rb +248 -0
  40. data/lib/solifyn/api/{partner_api.rb → discord_integration_api.rb} +32 -19
  41. data/lib/solifyn/api/entitlement_grants_api.rb +271 -0
  42. data/lib/solifyn/api/git_hub_integration_api.rb +137 -0
  43. data/lib/solifyn/api/webhook_endpoint_api.rb +9 -9
  44. data/lib/solifyn/configuration.rb +4 -4
  45. data/lib/solifyn/models/checkout_session_details_dto.rb +16 -4
  46. data/lib/solifyn/models/collection_product_dto.rb +115 -1
  47. data/lib/solifyn/models/{payout_method.rb → discord_roles_response_dto.rb} +41 -34
  48. data/lib/solifyn/models/{withdrawal.rb → entitlement_grant_response_dto.rb} +149 -109
  49. data/lib/solifyn/models/{payout_account.rb → github_repos_response_dto.rb} +31 -24
  50. data/lib/solifyn/models/product.rb +115 -1
  51. data/lib/solifyn/models/product_create.rb +77 -1
  52. data/lib/solifyn/models/product_update.rb +77 -1
  53. data/lib/solifyn/models/{payout_method_list.rb → sync_login_dto.rb} +15 -17
  54. data/lib/solifyn/models/{payout_verification.rb → webhook_entitlement_grant_payload.rb} +118 -41
  55. data/lib/solifyn/version.rb +1 -1
  56. data/lib/solifyn.rb +8 -0
  57. data/spec/api/checkout_api_spec.rb +12 -0
  58. data/spec/api/default_api_spec.rb +59 -11
  59. data/spec/api/developer_api_spec.rb +52 -29
  60. data/spec/api/{partner_api_spec.rb → discord_integration_api_spec.rb} +16 -11
  61. data/spec/api/entitlement_grants_api_spec.rb +83 -0
  62. data/spec/api/git_hub_integration_api_spec.rb +58 -0
  63. data/spec/models/checkout_session_details_dto_spec.rb +6 -0
  64. data/spec/models/collection_product_dto_spec.rb +28 -0
  65. data/spec/models/{payout_method_spec.rb → discord_roles_response_dto_spec.rb} +9 -9
  66. data/spec/models/{withdrawal_spec.rb → entitlement_grant_response_dto_spec.rb} +18 -18
  67. data/spec/models/{payout_account_spec.rb → github_repos_response_dto_spec.rb} +8 -8
  68. data/spec/models/order_spec.rb +6 -0
  69. data/spec/models/product_create_spec.rb +28 -0
  70. data/spec/models/product_spec.rb +28 -0
  71. data/spec/models/product_update_spec.rb +28 -0
  72. data/spec/models/{business_create_spec.rb → sync_login_dto_spec.rb} +7 -7
  73. data/spec/models/{business_spec.rb → webhook_entitlement_grant_payload_spec.rb} +17 -53
  74. metadata +162 -254
  75. data/docs/AffiliateApi.md +0 -845
  76. data/docs/BillingApi.md +0 -68
  77. data/docs/BrandsApi.md +0 -286
  78. data/docs/Business.md +0 -56
  79. data/docs/BusinessCreate.md +0 -18
  80. data/docs/BusinessFullCreate.md +0 -26
  81. data/docs/BusinessFullCreateResponse.md +0 -20
  82. data/docs/BusinessesApi.md +0 -350
  83. data/docs/ChatApi.md +0 -246
  84. data/docs/CommunityApi.md +0 -497
  85. data/docs/PartnerApi.md +0 -125
  86. data/docs/PayoutAccessToken.md +0 -20
  87. data/docs/PayoutAccount.md +0 -22
  88. data/docs/PayoutAccountLink.md +0 -20
  89. data/docs/PayoutMethod.md +0 -24
  90. data/docs/PayoutMethodList.md +0 -18
  91. data/docs/PayoutVerification.md +0 -24
  92. data/docs/PayoutVerificationList.md +0 -18
  93. data/docs/PayoutsApi.md +0 -579
  94. data/docs/TicketApi.md +0 -318
  95. data/docs/UserPage.md +0 -26
  96. data/docs/UserProfileThemesApi.md +0 -345
  97. data/docs/UserSettings.md +0 -34
  98. data/docs/UserSettingsUpdate.md +0 -76
  99. data/docs/UserStats.md +0 -20
  100. data/docs/UserTheme.md +0 -26
  101. data/docs/UserThemeUpdate.md +0 -22
  102. data/docs/WhopApiKeysRotation.md +0 -18
  103. data/docs/Withdrawal.md +0 -46
  104. data/docs/WithdrawalCreate.md +0 -22
  105. data/docs/WithdrawalList.md +0 -20
  106. data/lib/solifyn/api/affiliate_api.rb +0 -760
  107. data/lib/solifyn/api/billing_api.rb +0 -77
  108. data/lib/solifyn/api/brands_api.rb +0 -284
  109. data/lib/solifyn/api/businesses_api.rb +0 -338
  110. data/lib/solifyn/api/chat_api.rb +0 -232
  111. data/lib/solifyn/api/community_api.rb +0 -466
  112. data/lib/solifyn/api/payouts_api.rb +0 -520
  113. data/lib/solifyn/api/ticket_api.rb +0 -328
  114. data/lib/solifyn/api/user_profile_themes_api.rb +0 -313
  115. data/lib/solifyn/models/business.rb +0 -482
  116. data/lib/solifyn/models/business_create.rb +0 -241
  117. data/lib/solifyn/models/business_full_create.rb +0 -288
  118. data/lib/solifyn/models/business_full_create_response.rb +0 -239
  119. data/lib/solifyn/models/payout_access_token.rb +0 -239
  120. data/lib/solifyn/models/payout_account_link.rb +0 -239
  121. data/lib/solifyn/models/payout_verification_list.rb +0 -224
  122. data/lib/solifyn/models/user_page.rb +0 -290
  123. data/lib/solifyn/models/user_settings.rb +0 -337
  124. data/lib/solifyn/models/user_settings_update.rb +0 -505
  125. data/lib/solifyn/models/user_stats.rb +0 -241
  126. data/lib/solifyn/models/user_theme.rb +0 -276
  127. data/lib/solifyn/models/user_theme_update.rb +0 -235
  128. data/lib/solifyn/models/whop_api_keys_rotation.rb +0 -222
  129. data/lib/solifyn/models/withdrawal_create.rb +0 -249
  130. data/lib/solifyn/models/withdrawal_list.rb +0 -241
  131. data/spec/api/affiliate_api_spec.rb +0 -165
  132. data/spec/api/billing_api_spec.rb +0 -46
  133. data/spec/api/brands_api_spec.rb +0 -83
  134. data/spec/api/businesses_api_spec.rb +0 -93
  135. data/spec/api/chat_api_spec.rb +0 -72
  136. data/spec/api/community_api_spec.rb +0 -113
  137. data/spec/api/payouts_api_spec.rb +0 -133
  138. data/spec/api/ticket_api_spec.rb +0 -86
  139. data/spec/api/user_profile_themes_api_spec.rb +0 -91
  140. data/spec/models/business_full_create_response_spec.rb +0 -42
  141. data/spec/models/business_full_create_spec.rb +0 -60
  142. data/spec/models/payout_access_token_spec.rb +0 -42
  143. data/spec/models/payout_account_link_spec.rb +0 -42
  144. data/spec/models/payout_method_list_spec.rb +0 -36
  145. data/spec/models/payout_verification_list_spec.rb +0 -36
  146. data/spec/models/payout_verification_spec.rb +0 -54
  147. data/spec/models/user_page_spec.rb +0 -60
  148. data/spec/models/user_settings_spec.rb +0 -84
  149. data/spec/models/user_settings_update_spec.rb +0 -210
  150. data/spec/models/user_stats_spec.rb +0 -42
  151. data/spec/models/user_theme_spec.rb +0 -60
  152. data/spec/models/user_theme_update_spec.rb +0 -48
  153. data/spec/models/whop_api_keys_rotation_spec.rb +0 -36
  154. data/spec/models/withdrawal_create_spec.rb +0 -48
  155. data/spec/models/withdrawal_list_spec.rb +0 -42
@@ -1,224 +0,0 @@
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 PayoutVerificationList
18
- # List of verifications for the payout account
19
- attr_accessor :data
20
-
21
- # Attribute mapping from ruby-style variable name to JSON key.
22
- def self.attribute_map
23
- {
24
- :'data' => :'data'
25
- }
26
- end
27
-
28
- # Returns all the JSON keys this model knows about
29
- def self.acceptable_attributes
30
- attribute_map.values
31
- end
32
-
33
- # Attribute type mapping.
34
- def self.openapi_types
35
- {
36
- :'data' => :'Array<PayoutVerification>'
37
- }
38
- end
39
-
40
- # List of attributes with nullable: true
41
- def self.openapi_nullable
42
- Set.new([
43
- ])
44
- end
45
-
46
- # Initializes the object
47
- # @param [Hash] attributes Model attributes in the form of hash
48
- def initialize(attributes = {})
49
- if (!attributes.is_a?(Hash))
50
- fail ArgumentError, "The input argument (attributes) must be a hash in `Solifyn::PayoutVerificationList` initialize method"
51
- end
52
-
53
- # check to see if the attribute exists and convert string to symbol for hash key
54
- attributes = attributes.each_with_object({}) { |(k, v), h|
55
- if (!self.class.attribute_map.key?(k.to_sym))
56
- fail ArgumentError, "`#{k}` is not a valid attribute in `Solifyn::PayoutVerificationList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
- end
58
- h[k.to_sym] = v
59
- }
60
-
61
- if attributes.key?(:'data')
62
- if (value = attributes[:'data']).is_a?(Array)
63
- self.data = value
64
- end
65
- else
66
- self.data = nil
67
- end
68
- end
69
-
70
- # Show invalid properties with the reasons. Usually used together with valid?
71
- # @return Array for valid properties with the reasons
72
- def list_invalid_properties
73
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
74
- invalid_properties = Array.new
75
- if @data.nil?
76
- invalid_properties.push('invalid value for "data", data cannot be nil.')
77
- end
78
-
79
- invalid_properties
80
- end
81
-
82
- # Check to see if the all the properties in the model are valid
83
- # @return true if the model is valid
84
- def valid?
85
- warn '[DEPRECATED] the `valid?` method is obsolete'
86
- return false if @data.nil?
87
- true
88
- end
89
-
90
- # Checks equality by comparing each attribute.
91
- # @param [Object] Object to be compared
92
- def ==(o)
93
- return true if self.equal?(o)
94
- self.class == o.class &&
95
- data == o.data
96
- end
97
-
98
- # @see the `==` method
99
- # @param [Object] Object to be compared
100
- def eql?(o)
101
- self == o
102
- end
103
-
104
- # Calculates hash code according to all attributes.
105
- # @return [Integer] Hash code
106
- def hash
107
- [data].hash
108
- end
109
-
110
- # Builds the object from hash
111
- # @param [Hash] attributes Model attributes in the form of hash
112
- # @return [Object] Returns the model itself
113
- def self.build_from_hash(attributes)
114
- return nil unless attributes.is_a?(Hash)
115
- attributes = attributes.transform_keys(&:to_sym)
116
- transformed_hash = {}
117
- openapi_types.each_pair do |key, type|
118
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
119
- transformed_hash["#{key}"] = nil
120
- elsif type =~ /\AArray<(.*)>/i
121
- # check to ensure the input is an array given that the attribute
122
- # is documented as an array but the input is not
123
- if attributes[attribute_map[key]].is_a?(Array)
124
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
125
- end
126
- elsif !attributes[attribute_map[key]].nil?
127
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
128
- end
129
- end
130
- new(transformed_hash)
131
- end
132
-
133
- # Deserializes the data based on type
134
- # @param string type Data type
135
- # @param string value Value to be deserialized
136
- # @return [Object] Deserialized data
137
- def self._deserialize(type, value)
138
- case type.to_sym
139
- when :Time
140
- Time.parse(value)
141
- when :Date
142
- Date.parse(value)
143
- when :String
144
- value.to_s
145
- when :Integer
146
- value.to_i
147
- when :Float
148
- value.to_f
149
- when :Boolean
150
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
- true
152
- else
153
- false
154
- end
155
- when :Object
156
- # generic object (usually a Hash), return directly
157
- value
158
- when /\AArray<(?<inner_type>.+)>\z/
159
- inner_type = Regexp.last_match[:inner_type]
160
- value.map { |v| _deserialize(inner_type, v) }
161
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
- k_type = Regexp.last_match[:k_type]
163
- v_type = Regexp.last_match[:v_type]
164
- {}.tap do |hash|
165
- value.each do |k, v|
166
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
- end
168
- end
169
- else # model
170
- # models (e.g. Pet) or oneOf
171
- klass = Solifyn.const_get(type)
172
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
173
- end
174
- end
175
-
176
- # Returns the string representation of the object
177
- # @return [String] String presentation of the object
178
- def to_s
179
- to_hash.to_s
180
- end
181
-
182
- # to_body is an alias to to_hash (backward compatibility)
183
- # @return [Hash] Returns the object in the form of hash
184
- def to_body
185
- to_hash
186
- end
187
-
188
- # Returns the object in the form of hash
189
- # @return [Hash] Returns the object in the form of hash
190
- def to_hash
191
- hash = {}
192
- self.class.attribute_map.each_pair do |attr, param|
193
- value = self.send(attr)
194
- if value.nil?
195
- is_nullable = self.class.openapi_nullable.include?(attr)
196
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
197
- end
198
-
199
- hash[param] = _to_hash(value)
200
- end
201
- hash
202
- end
203
-
204
- # Outputs non-array value in the form of hash
205
- # For object, use to_hash. Otherwise, just return the value
206
- # @param [Object] value Any valid value
207
- # @return [Hash] Returns the value in the form of hash
208
- def _to_hash(value)
209
- if value.is_a?(Array)
210
- value.compact.map { |v| _to_hash(v) }
211
- elsif value.is_a?(Hash)
212
- {}.tap do |hash|
213
- value.each { |k, v| hash[k] = _to_hash(v) }
214
- end
215
- elsif value.respond_to? :to_hash
216
- value.to_hash
217
- else
218
- value
219
- end
220
- end
221
-
222
- end
223
-
224
- end
@@ -1,290 +0,0 @@
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 UserPage
18
- # Store page record ID
19
- attr_accessor :id
20
-
21
- # Unique subdomain
22
- attr_accessor :subdomain
23
-
24
- # Friendly store name
25
- attr_accessor :store_name
26
-
27
- # Styling config JSON
28
- attr_accessor :config
29
-
30
- # Linked business ID
31
- attr_accessor :business_id
32
-
33
- # Attribute mapping from ruby-style variable name to JSON key.
34
- def self.attribute_map
35
- {
36
- :'id' => :'id',
37
- :'subdomain' => :'subdomain',
38
- :'store_name' => :'storeName',
39
- :'config' => :'config',
40
- :'business_id' => :'businessId'
41
- }
42
- end
43
-
44
- # Returns all the JSON keys this model knows about
45
- def self.acceptable_attributes
46
- attribute_map.values
47
- end
48
-
49
- # Attribute type mapping.
50
- def self.openapi_types
51
- {
52
- :'id' => :'String',
53
- :'subdomain' => :'String',
54
- :'store_name' => :'String',
55
- :'config' => :'Object',
56
- :'business_id' => :'String'
57
- }
58
- end
59
-
60
- # List of attributes with nullable: true
61
- def self.openapi_nullable
62
- Set.new([
63
- ])
64
- end
65
-
66
- # Initializes the object
67
- # @param [Hash] attributes Model attributes in the form of hash
68
- def initialize(attributes = {})
69
- if (!attributes.is_a?(Hash))
70
- fail ArgumentError, "The input argument (attributes) must be a hash in `Solifyn::UserPage` initialize method"
71
- end
72
-
73
- # check to see if the attribute exists and convert string to symbol for hash key
74
- attributes = attributes.each_with_object({}) { |(k, v), h|
75
- if (!self.class.attribute_map.key?(k.to_sym))
76
- fail ArgumentError, "`#{k}` is not a valid attribute in `Solifyn::UserPage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
- end
78
- h[k.to_sym] = v
79
- }
80
-
81
- if attributes.key?(:'id')
82
- self.id = attributes[:'id']
83
- else
84
- self.id = nil
85
- end
86
-
87
- if attributes.key?(:'subdomain')
88
- self.subdomain = attributes[:'subdomain']
89
- else
90
- self.subdomain = nil
91
- end
92
-
93
- if attributes.key?(:'store_name')
94
- self.store_name = attributes[:'store_name']
95
- else
96
- self.store_name = nil
97
- end
98
-
99
- if attributes.key?(:'config')
100
- self.config = attributes[:'config']
101
- else
102
- self.config = nil
103
- end
104
-
105
- if attributes.key?(:'business_id')
106
- self.business_id = attributes[:'business_id']
107
- else
108
- self.business_id = nil
109
- end
110
- end
111
-
112
- # Show invalid properties with the reasons. Usually used together with valid?
113
- # @return Array for valid properties with the reasons
114
- def list_invalid_properties
115
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
116
- invalid_properties = Array.new
117
- if @id.nil?
118
- invalid_properties.push('invalid value for "id", id cannot be nil.')
119
- end
120
-
121
- if @subdomain.nil?
122
- invalid_properties.push('invalid value for "subdomain", subdomain cannot be nil.')
123
- end
124
-
125
- if @store_name.nil?
126
- invalid_properties.push('invalid value for "store_name", store_name cannot be nil.')
127
- end
128
-
129
- if @config.nil?
130
- invalid_properties.push('invalid value for "config", config cannot be nil.')
131
- end
132
-
133
- if @business_id.nil?
134
- invalid_properties.push('invalid value for "business_id", business_id cannot be nil.')
135
- end
136
-
137
- invalid_properties
138
- end
139
-
140
- # Check to see if the all the properties in the model are valid
141
- # @return true if the model is valid
142
- def valid?
143
- warn '[DEPRECATED] the `valid?` method is obsolete'
144
- return false if @id.nil?
145
- return false if @subdomain.nil?
146
- return false if @store_name.nil?
147
- return false if @config.nil?
148
- return false if @business_id.nil?
149
- true
150
- end
151
-
152
- # Checks equality by comparing each attribute.
153
- # @param [Object] Object to be compared
154
- def ==(o)
155
- return true if self.equal?(o)
156
- self.class == o.class &&
157
- id == o.id &&
158
- subdomain == o.subdomain &&
159
- store_name == o.store_name &&
160
- config == o.config &&
161
- business_id == o.business_id
162
- end
163
-
164
- # @see the `==` method
165
- # @param [Object] Object to be compared
166
- def eql?(o)
167
- self == o
168
- end
169
-
170
- # Calculates hash code according to all attributes.
171
- # @return [Integer] Hash code
172
- def hash
173
- [id, subdomain, store_name, config, business_id].hash
174
- end
175
-
176
- # Builds the object from hash
177
- # @param [Hash] attributes Model attributes in the form of hash
178
- # @return [Object] Returns the model itself
179
- def self.build_from_hash(attributes)
180
- return nil unless attributes.is_a?(Hash)
181
- attributes = attributes.transform_keys(&:to_sym)
182
- transformed_hash = {}
183
- openapi_types.each_pair do |key, type|
184
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
185
- transformed_hash["#{key}"] = nil
186
- elsif type =~ /\AArray<(.*)>/i
187
- # check to ensure the input is an array given that the attribute
188
- # is documented as an array but the input is not
189
- if attributes[attribute_map[key]].is_a?(Array)
190
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
191
- end
192
- elsif !attributes[attribute_map[key]].nil?
193
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
194
- end
195
- end
196
- new(transformed_hash)
197
- end
198
-
199
- # Deserializes the data based on type
200
- # @param string type Data type
201
- # @param string value Value to be deserialized
202
- # @return [Object] Deserialized data
203
- def self._deserialize(type, value)
204
- case type.to_sym
205
- when :Time
206
- Time.parse(value)
207
- when :Date
208
- Date.parse(value)
209
- when :String
210
- value.to_s
211
- when :Integer
212
- value.to_i
213
- when :Float
214
- value.to_f
215
- when :Boolean
216
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
217
- true
218
- else
219
- false
220
- end
221
- when :Object
222
- # generic object (usually a Hash), return directly
223
- value
224
- when /\AArray<(?<inner_type>.+)>\z/
225
- inner_type = Regexp.last_match[:inner_type]
226
- value.map { |v| _deserialize(inner_type, v) }
227
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
228
- k_type = Regexp.last_match[:k_type]
229
- v_type = Regexp.last_match[:v_type]
230
- {}.tap do |hash|
231
- value.each do |k, v|
232
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
233
- end
234
- end
235
- else # model
236
- # models (e.g. Pet) or oneOf
237
- klass = Solifyn.const_get(type)
238
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
239
- end
240
- end
241
-
242
- # Returns the string representation of the object
243
- # @return [String] String presentation of the object
244
- def to_s
245
- to_hash.to_s
246
- end
247
-
248
- # to_body is an alias to to_hash (backward compatibility)
249
- # @return [Hash] Returns the object in the form of hash
250
- def to_body
251
- to_hash
252
- end
253
-
254
- # Returns the object in the form of hash
255
- # @return [Hash] Returns the object in the form of hash
256
- def to_hash
257
- hash = {}
258
- self.class.attribute_map.each_pair do |attr, param|
259
- value = self.send(attr)
260
- if value.nil?
261
- is_nullable = self.class.openapi_nullable.include?(attr)
262
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
263
- end
264
-
265
- hash[param] = _to_hash(value)
266
- end
267
- hash
268
- end
269
-
270
- # Outputs non-array value in the form of hash
271
- # For object, use to_hash. Otherwise, just return the value
272
- # @param [Object] value Any valid value
273
- # @return [Hash] Returns the value in the form of hash
274
- def _to_hash(value)
275
- if value.is_a?(Array)
276
- value.compact.map { |v| _to_hash(v) }
277
- elsif value.is_a?(Hash)
278
- {}.tap do |hash|
279
- value.each { |k, v| hash[k] = _to_hash(v) }
280
- end
281
- elsif value.respond_to? :to_hash
282
- value.to_hash
283
- else
284
- value
285
- end
286
- end
287
-
288
- end
289
-
290
- end