wesley-key-sdk 4.0.0 → 4.2.0

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 (96) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +47 -34
  3. data/bin/console +4 -4
  4. data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/api_helper.rb +2 -2
  5. data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/apis/base_api.rb +3 -3
  6. data/lib/swagger_petstore_open_api30/apis/pet_api.rb +287 -0
  7. data/lib/swagger_petstore_open_api30/apis/store_api.rb +131 -0
  8. data/lib/swagger_petstore_open_api30/apis/user_api.rb +233 -0
  9. data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/client.rb +34 -15
  10. data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/configuration.rb +30 -20
  11. data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/exceptions/api_exception.rb +2 -2
  12. data/lib/swagger_petstore_open_api30/exceptions/oauth_provider_exception.rb +64 -0
  13. data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/http/api_response.rb +2 -2
  14. data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/http/auth/api_key.rb +15 -15
  15. data/lib/swagger_petstore_open_api30/http/auth/petstore_auth.rb +112 -0
  16. data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/http/http_call_back.rb +2 -2
  17. data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/http/http_method_enum.rb +2 -2
  18. data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/http/http_request.rb +2 -2
  19. data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/http/http_response.rb +2 -2
  20. data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/http/proxy_settings.rb +2 -2
  21. data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/logging/configuration/api_logging_configuration.rb +2 -2
  22. data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/logging/sdk_logger.rb +2 -2
  23. data/lib/swagger_petstore_open_api30/models/api_response.rb +118 -0
  24. data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/models/base_model.rb +2 -2
  25. data/lib/{webhooks_and_callbacks_api/models/package.rb → swagger_petstore_open_api30/models/category.rb} +39 -29
  26. data/lib/swagger_petstore_open_api30/models/oauth_provider_error.rb +62 -0
  27. data/lib/swagger_petstore_open_api30/models/oauth_scope_petstore_auth.rb +36 -0
  28. data/lib/swagger_petstore_open_api30/models/oauth_token.rb +125 -0
  29. data/lib/swagger_petstore_open_api30/models/order.rb +167 -0
  30. data/lib/swagger_petstore_open_api30/models/order_status.rb +40 -0
  31. data/lib/swagger_petstore_open_api30/models/pet.rb +168 -0
  32. data/lib/swagger_petstore_open_api30/models/pet_status.rb +40 -0
  33. data/lib/{webhooks_and_callbacks_api/models/delivery_details.rb → swagger_petstore_open_api30/models/tag.rb} +36 -35
  34. data/lib/swagger_petstore_open_api30/models/user.rb +182 -0
  35. data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/utilities/date_time_helper.rb +2 -2
  36. data/lib/{webhooks_and_callbacks_api → swagger_petstore_open_api30}/utilities/file_wrapper.rb +2 -2
  37. data/lib/swagger_petstore_open_api30/utilities/xml_utilities.rb +12 -0
  38. data/lib/swagger_petstore_open_api30.rb +62 -0
  39. metadata +37 -78
  40. data/lib/webhooks_and_callbacks_api/apis/orders_api.rb +0 -34
  41. data/lib/webhooks_and_callbacks_api/events/callbacks/callbacks_a_handler.rb +0 -66
  42. data/lib/webhooks_and_callbacks_api/events/callbacks/callbacks_b_handler.rb +0 -78
  43. data/lib/webhooks_and_callbacks_api/events/signature_verification_failure.rb +0 -33
  44. data/lib/webhooks_and_callbacks_api/events/signature_verification_result.rb +0 -14
  45. data/lib/webhooks_and_callbacks_api/events/unknown_event.rb +0 -32
  46. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_a_handler.rb +0 -67
  47. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_b_handler.rb +0 -86
  48. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_c_handler.rb +0 -79
  49. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_handler.rb +0 -67
  50. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_no_verification_handler.rb +0 -39
  51. data/lib/webhooks_and_callbacks_api/exceptions/error_exception.rb +0 -57
  52. data/lib/webhooks_and_callbacks_api/http/auth/bearer_auth.rb +0 -53
  53. data/lib/webhooks_and_callbacks_api/models/address.rb +0 -114
  54. data/lib/webhooks_and_callbacks_api/models/audit_log_event.rb +0 -115
  55. data/lib/webhooks_and_callbacks_api/models/create_order_request.rb +0 -131
  56. data/lib/webhooks_and_callbacks_api/models/email_notification_callback.rb +0 -97
  57. data/lib/webhooks_and_callbacks_api/models/event.rb +0 -52
  58. data/lib/webhooks_and_callbacks_api/models/event_type.rb +0 -26
  59. data/lib/webhooks_and_callbacks_api/models/event_type1.rb +0 -26
  60. data/lib/webhooks_and_callbacks_api/models/event_type2.rb +0 -26
  61. data/lib/webhooks_and_callbacks_api/models/event_type3.rb +0 -26
  62. data/lib/webhooks_and_callbacks_api/models/fulfillment_callback.rb +0 -411
  63. data/lib/webhooks_and_callbacks_api/models/fulfillment_status.rb +0 -40
  64. data/lib/webhooks_and_callbacks_api/models/fulfillment_statuss.rb +0 -40
  65. data/lib/webhooks_and_callbacks_api/models/inventory_stock_decrease_event.rb +0 -90
  66. data/lib/webhooks_and_callbacks_api/models/inventory_stock_depleted_event.rb +0 -90
  67. data/lib/webhooks_and_callbacks_api/models/inventory_stock_increase_event.rb +0 -90
  68. data/lib/webhooks_and_callbacks_api/models/notification_callback.rb +0 -119
  69. data/lib/webhooks_and_callbacks_api/models/oauth_scope_oauth_acg.rb +0 -44
  70. data/lib/webhooks_and_callbacks_api/models/order.rb +0 -161
  71. data/lib/webhooks_and_callbacks_api/models/order_created_event.rb +0 -314
  72. data/lib/webhooks_and_callbacks_api/models/order_item.rb +0 -102
  73. data/lib/webhooks_and_callbacks_api/models/order_updated_event.rb +0 -100
  74. data/lib/webhooks_and_callbacks_api/models/payment_callback.rb +0 -167
  75. data/lib/webhooks_and_callbacks_api/models/payment_completed_event.rb +0 -98
  76. data/lib/webhooks_and_callbacks_api/models/payment_status.rb +0 -40
  77. data/lib/webhooks_and_callbacks_api/models/payment_status_created_event.rb +0 -89
  78. data/lib/webhooks_and_callbacks_api/models/payment_status_updated_event.rb +0 -89
  79. data/lib/webhooks_and_callbacks_api/models/primitive_collection_event.rb +0 -98
  80. data/lib/webhooks_and_callbacks_api/models/root_level_primitive_one_of_event_request.rb +0 -40
  81. data/lib/webhooks_and_callbacks_api/models/root_level_primitive_one_of_event_request1.rb +0 -40
  82. data/lib/webhooks_and_callbacks_api/models/sms_notification_callback.rb +0 -95
  83. data/lib/webhooks_and_callbacks_api/models/status.rb +0 -44
  84. data/lib/webhooks_and_callbacks_api/models/status1.rb +0 -36
  85. data/lib/webhooks_and_callbacks_api/models/status2.rb +0 -36
  86. data/lib/webhooks_and_callbacks_api/models/system_alert_notification_event.rb +0 -90
  87. data/lib/webhooks_and_callbacks_api/models/system_maintenance_notification_event.rb +0 -90
  88. data/lib/webhooks_and_callbacks_api/models/system_performance_notification_event.rb +0 -90
  89. data/lib/webhooks_and_callbacks_api/models/user_action_notification_event.rb +0 -90
  90. data/lib/webhooks_and_callbacks_api/models/user_preference_notification_event.rb +0 -90
  91. data/lib/webhooks_and_callbacks_api/models/user_status_notification_event.rb +0 -90
  92. data/lib/webhooks_and_callbacks_api/models/webhook.rb +0 -142
  93. data/lib/webhooks_and_callbacks_api/models/webhook_registration.rb +0 -103
  94. data/lib/webhooks_and_callbacks_api/models/webhook_update.rb +0 -105
  95. data/lib/webhooks_and_callbacks_api/utilities/union_type_lookup.rb +0 -172
  96. data/lib/webhooks_and_callbacks_api.rb +0 -122
@@ -1,314 +0,0 @@
1
- # webhooks_and_callbacks_api
2
- #
3
- # This file was automatically generated by
4
- # APIMATIC v3.0 ( https://www.apimatic.io ).
5
-
6
- require 'date'
7
- module WebhooksAndCallbacksApi
8
- # OrderCreatedEvent Model.
9
- class OrderCreatedEvent < BaseModel
10
- SKIP = Object.new
11
- private_constant :SKIP
12
-
13
- # TODO: Write general description for this method
14
- # @return [String]
15
- attr_accessor :order_id
16
-
17
- # TODO: Write general description for this method
18
- # @return [FulfillmentStatus]
19
- attr_accessor :fulfillment_status
20
-
21
- # TODO: Write general description for this method
22
- # @return [String]
23
- attr_accessor :tracking_number
24
-
25
- # TODO: Write general description for this method
26
- # @return [String]
27
- attr_accessor :carrier
28
-
29
- # List of scopes that apply to the OAuth token
30
- # @return [Array[OauthScopeOauthACG]]
31
- attr_accessor :scopes
32
-
33
- # List of scopes that apply to the OAuth token
34
- # @return [Date]
35
- attr_accessor :estimated_delivery
36
-
37
- # List of scopes that apply to the OAuth token
38
- # @return [DateTime]
39
- attr_accessor :timestamp
40
-
41
- # Binary file upload
42
- # @return [Binary]
43
- attr_accessor :document
44
-
45
- # Binary file upload
46
- # @return [Float]
47
- attr_accessor :total_weight
48
-
49
- # Binary file upload
50
- # @return [Float]
51
- attr_accessor :price
52
-
53
- # Binary file upload
54
- # @return [Integer]
55
- attr_accessor :quantity
56
-
57
- # Binary file upload
58
- # @return [Integer]
59
- attr_accessor :long_id
60
-
61
- # Binary file upload
62
- # @return [TrueClass | FalseClass]
63
- attr_accessor :fragile
64
-
65
- # Explicitly nullable field
66
- # @return [String]
67
- attr_accessor :notes
68
-
69
- # Explicitly nullable field
70
- # @return [Array[String]]
71
- attr_accessor :items
72
-
73
- # Explicitly nullable field
74
- # @return [Array[Package]]
75
- attr_accessor :packages
76
-
77
- # Explicitly nullable field
78
- # @return [Address]
79
- attr_accessor :address
80
-
81
- # Explicitly nullable field
82
- # @return [Object]
83
- attr_accessor :metadata
84
-
85
- # Explicitly nullable field
86
- # @return [Hash[String, String]]
87
- attr_accessor :attributes
88
-
89
- # Explicitly nullable field
90
- # @return [Object]
91
- attr_accessor :delivery_details
92
-
93
- # A mapping from model property names to API property names.
94
- def self.names
95
- @_hash = {} if @_hash.nil?
96
- @_hash['order_id'] = 'orderId'
97
- @_hash['fulfillment_status'] = 'fulfillmentStatus'
98
- @_hash['tracking_number'] = 'trackingNumber'
99
- @_hash['carrier'] = 'carrier'
100
- @_hash['scopes'] = 'scopes'
101
- @_hash['estimated_delivery'] = 'estimatedDelivery'
102
- @_hash['timestamp'] = 'timestamp'
103
- @_hash['document'] = 'document'
104
- @_hash['total_weight'] = 'totalWeight'
105
- @_hash['price'] = 'price'
106
- @_hash['quantity'] = 'quantity'
107
- @_hash['long_id'] = 'longId'
108
- @_hash['fragile'] = 'fragile'
109
- @_hash['notes'] = 'notes'
110
- @_hash['items'] = 'items'
111
- @_hash['packages'] = 'packages'
112
- @_hash['address'] = 'address'
113
- @_hash['metadata'] = 'metadata'
114
- @_hash['attributes'] = 'attributes'
115
- @_hash['delivery_details'] = 'deliveryDetails'
116
- @_hash
117
- end
118
-
119
- # An array for optional fields
120
- def self.optionals
121
- %w[
122
- tracking_number
123
- carrier
124
- scopes
125
- estimated_delivery
126
- timestamp
127
- document
128
- total_weight
129
- price
130
- quantity
131
- long_id
132
- fragile
133
- notes
134
- items
135
- packages
136
- address
137
- metadata
138
- attributes
139
- delivery_details
140
- ]
141
- end
142
-
143
- # An array for nullable fields
144
- def self.nullables
145
- %w[
146
- order_id
147
- tracking_number
148
- scopes
149
- notes
150
- ]
151
- end
152
-
153
- def initialize(order_id:, fulfillment_status:, tracking_number: SKIP,
154
- carrier: SKIP, scopes: SKIP, estimated_delivery: SKIP,
155
- timestamp: SKIP, document: SKIP, total_weight: SKIP,
156
- price: SKIP, quantity: SKIP, long_id: SKIP, fragile: SKIP,
157
- notes: SKIP, items: SKIP, packages: SKIP, address: SKIP,
158
- metadata: SKIP, attributes: SKIP, delivery_details: SKIP,
159
- additional_properties: nil)
160
- # Add additional model properties to the instance
161
- additional_properties = {} if additional_properties.nil?
162
-
163
- @order_id = order_id
164
- @fulfillment_status = fulfillment_status
165
- @tracking_number = tracking_number unless tracking_number == SKIP
166
- @carrier = carrier unless carrier == SKIP
167
- @scopes = scopes unless scopes == SKIP
168
- @estimated_delivery = estimated_delivery unless estimated_delivery == SKIP
169
- @timestamp = timestamp unless timestamp == SKIP
170
- @document = document unless document == SKIP
171
- @total_weight = total_weight unless total_weight == SKIP
172
- @price = price unless price == SKIP
173
- @quantity = quantity unless quantity == SKIP
174
- @long_id = long_id unless long_id == SKIP
175
- @fragile = fragile unless fragile == SKIP
176
- @notes = notes unless notes == SKIP
177
- @items = items unless items == SKIP
178
- @packages = packages unless packages == SKIP
179
- @address = address unless address == SKIP
180
- @metadata = metadata unless metadata == SKIP
181
- @attributes = attributes unless attributes == SKIP
182
- @delivery_details = delivery_details unless delivery_details == SKIP
183
- @additional_properties = additional_properties
184
- end
185
-
186
- # Creates an instance of the object from a hash.
187
- def self.from_hash(hash)
188
- return nil unless hash
189
-
190
- # Extract variables from the hash.
191
- order_id = hash.key?('orderId') ? hash['orderId'] : nil
192
- fulfillment_status =
193
- hash.key?('fulfillmentStatus') ? hash['fulfillmentStatus'] : nil
194
- tracking_number =
195
- hash.key?('trackingNumber') ? hash['trackingNumber'] : SKIP
196
- carrier = hash.key?('carrier') ? hash['carrier'] : SKIP
197
- scopes = hash.key?('scopes') ? hash['scopes'] : SKIP
198
- estimated_delivery =
199
- hash.key?('estimatedDelivery') ? hash['estimatedDelivery'] : SKIP
200
- timestamp = if hash.key?('timestamp')
201
- (DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
202
- else
203
- SKIP
204
- end
205
- document = hash.key?('document') ? hash['document'] : SKIP
206
- total_weight = hash.key?('totalWeight') ? hash['totalWeight'] : SKIP
207
- price = hash.key?('price') ? hash['price'] : SKIP
208
- quantity = hash.key?('quantity') ? hash['quantity'] : SKIP
209
- long_id = hash.key?('longId') ? hash['longId'] : SKIP
210
- fragile = hash.key?('fragile') ? hash['fragile'] : SKIP
211
- notes = hash.key?('notes') ? hash['notes'] : SKIP
212
- items = hash.key?('items') ? hash['items'] : SKIP
213
- # Parameter is an array, so we need to iterate through it
214
- packages = nil
215
- unless hash['packages'].nil?
216
- packages = []
217
- hash['packages'].each do |structure|
218
- packages << (Package.from_hash(structure) if structure)
219
- end
220
- end
221
-
222
- packages = SKIP unless hash.key?('packages')
223
- address = Address.from_hash(hash['address']) if hash['address']
224
- metadata = hash.key?('metadata') ? hash['metadata'] : SKIP
225
- attributes = hash.key?('attributes') ? hash['attributes'] : SKIP
226
- delivery_details = hash.key?('deliveryDetails') ? APIHelper.deserialize_union_type(
227
- UnionTypeLookUp.get(:OrderCreatedEventDeliveryDetails), hash['deliveryDetails']
228
- ) : SKIP
229
-
230
- # Create a new hash for additional properties, removing known properties.
231
- new_hash = hash.reject { |k, _| names.value?(k) }
232
-
233
- additional_properties = APIHelper.get_additional_properties(
234
- new_hash, proc { |value| value }
235
- )
236
-
237
- # Create object from extracted values.
238
- OrderCreatedEvent.new(order_id: order_id,
239
- fulfillment_status: fulfillment_status,
240
- tracking_number: tracking_number,
241
- carrier: carrier,
242
- scopes: scopes,
243
- estimated_delivery: estimated_delivery,
244
- timestamp: timestamp,
245
- document: document,
246
- total_weight: total_weight,
247
- price: price,
248
- quantity: quantity,
249
- long_id: long_id,
250
- fragile: fragile,
251
- notes: notes,
252
- items: items,
253
- packages: packages,
254
- address: address,
255
- metadata: metadata,
256
- attributes: attributes,
257
- delivery_details: delivery_details,
258
- additional_properties: additional_properties)
259
- end
260
-
261
- def to_custom_timestamp
262
- DateTimeHelper.to_rfc3339(timestamp)
263
- end
264
-
265
- # Validates an instance of the object from a given value.
266
- # @param [OrderCreatedEvent | Hash] The value against the validation is performed.
267
- def self.validate(value)
268
- if value.instance_of? self
269
- return (
270
- APIHelper.valid_type?(value.order_id,
271
- ->(val) { val.instance_of? String }) and
272
- APIHelper.valid_type?(value.fulfillment_status,
273
- ->(val) { FulfillmentStatus.validate(val) })
274
- )
275
- end
276
-
277
- return false unless value.instance_of? Hash
278
-
279
- (
280
- APIHelper.valid_type?(value['orderId'],
281
- ->(val) { val.instance_of? String }) and
282
- APIHelper.valid_type?(value['fulfillmentStatus'],
283
- ->(val) { FulfillmentStatus.validate(val) })
284
- )
285
- end
286
-
287
- # Provides a human-readable string representation of the object.
288
- def to_s
289
- class_name = self.class.name.split('::').last
290
- "<#{class_name} order_id: #{@order_id}, fulfillment_status: #{@fulfillment_status},"\
291
- " tracking_number: #{@tracking_number}, carrier: #{@carrier}, scopes: #{@scopes},"\
292
- " estimated_delivery: #{@estimated_delivery}, timestamp: #{@timestamp}, document:"\
293
- " #{@document}, total_weight: #{@total_weight}, price: #{@price}, quantity: #{@quantity},"\
294
- " long_id: #{@long_id}, fragile: #{@fragile}, notes: #{@notes}, items: #{@items}, packages:"\
295
- " #{@packages}, address: #{@address}, metadata: #{@metadata}, attributes: #{@attributes},"\
296
- " delivery_details: #{@delivery_details}, additional_properties: #{@additional_properties}>"
297
- end
298
-
299
- # Provides a debugging-friendly string with detailed object information.
300
- def inspect
301
- class_name = self.class.name.split('::').last
302
- "<#{class_name} order_id: #{@order_id.inspect}, fulfillment_status:"\
303
- " #{@fulfillment_status.inspect}, tracking_number: #{@tracking_number.inspect}, carrier:"\
304
- " #{@carrier.inspect}, scopes: #{@scopes.inspect}, estimated_delivery:"\
305
- " #{@estimated_delivery.inspect}, timestamp: #{@timestamp.inspect}, document:"\
306
- " #{@document.inspect}, total_weight: #{@total_weight.inspect}, price: #{@price.inspect},"\
307
- " quantity: #{@quantity.inspect}, long_id: #{@long_id.inspect}, fragile:"\
308
- " #{@fragile.inspect}, notes: #{@notes.inspect}, items: #{@items.inspect}, packages:"\
309
- " #{@packages.inspect}, address: #{@address.inspect}, metadata: #{@metadata.inspect},"\
310
- " attributes: #{@attributes.inspect}, delivery_details: #{@delivery_details.inspect},"\
311
- " additional_properties: #{@additional_properties}>"
312
- end
313
- end
314
- end
@@ -1,102 +0,0 @@
1
- # webhooks_and_callbacks_api
2
- #
3
- # This file was automatically generated by
4
- # APIMATIC v3.0 ( https://www.apimatic.io ).
5
-
6
- module WebhooksAndCallbacksApi
7
- # OrderItem Model.
8
- class OrderItem < BaseModel
9
- SKIP = Object.new
10
- private_constant :SKIP
11
-
12
- # TODO: Write general description for this method
13
- # @return [String]
14
- attr_accessor :product_id
15
-
16
- # TODO: Write general description for this method
17
- # @return [Integer]
18
- attr_accessor :quantity
19
-
20
- # TODO: Write general description for this method
21
- # @return [Float]
22
- attr_accessor :price
23
-
24
- # TODO: Write general description for this method
25
- # @return [String]
26
- attr_accessor :description
27
-
28
- # A mapping from model property names to API property names.
29
- def self.names
30
- @_hash = {} if @_hash.nil?
31
- @_hash['product_id'] = 'productId'
32
- @_hash['quantity'] = 'quantity'
33
- @_hash['price'] = 'price'
34
- @_hash['description'] = 'description'
35
- @_hash
36
- end
37
-
38
- # An array for optional fields
39
- def self.optionals
40
- %w[
41
- description
42
- ]
43
- end
44
-
45
- # An array for nullable fields
46
- def self.nullables
47
- []
48
- end
49
-
50
- def initialize(product_id:, quantity:, price:, description: SKIP,
51
- additional_properties: nil)
52
- # Add additional model properties to the instance
53
- additional_properties = {} if additional_properties.nil?
54
-
55
- @product_id = product_id
56
- @quantity = quantity
57
- @price = price
58
- @description = description unless description == SKIP
59
- @additional_properties = additional_properties
60
- end
61
-
62
- # Creates an instance of the object from a hash.
63
- def self.from_hash(hash)
64
- return nil unless hash
65
-
66
- # Extract variables from the hash.
67
- product_id = hash.key?('productId') ? hash['productId'] : nil
68
- quantity = hash.key?('quantity') ? hash['quantity'] : nil
69
- price = hash.key?('price') ? hash['price'] : nil
70
- description = hash.key?('description') ? hash['description'] : SKIP
71
-
72
- # Create a new hash for additional properties, removing known properties.
73
- new_hash = hash.reject { |k, _| names.value?(k) }
74
-
75
- additional_properties = APIHelper.get_additional_properties(
76
- new_hash, proc { |value| value }
77
- )
78
-
79
- # Create object from extracted values.
80
- OrderItem.new(product_id: product_id,
81
- quantity: quantity,
82
- price: price,
83
- description: description,
84
- additional_properties: additional_properties)
85
- end
86
-
87
- # Provides a human-readable string representation of the object.
88
- def to_s
89
- class_name = self.class.name.split('::').last
90
- "<#{class_name} product_id: #{@product_id}, quantity: #{@quantity}, price: #{@price},"\
91
- " description: #{@description}, additional_properties: #{@additional_properties}>"
92
- end
93
-
94
- # Provides a debugging-friendly string with detailed object information.
95
- def inspect
96
- class_name = self.class.name.split('::').last
97
- "<#{class_name} product_id: #{@product_id.inspect}, quantity: #{@quantity.inspect}, price:"\
98
- " #{@price.inspect}, description: #{@description.inspect}, additional_properties:"\
99
- " #{@additional_properties}>"
100
- end
101
- end
102
- end
@@ -1,100 +0,0 @@
1
- # webhooks_and_callbacks_api
2
- #
3
- # This file was automatically generated by
4
- # APIMATIC v3.0 ( https://www.apimatic.io ).
5
-
6
- module WebhooksAndCallbacksApi
7
- # OrderUpdatedEvent Model.
8
- class OrderUpdatedEvent < BaseModel
9
- SKIP = Object.new
10
- private_constant :SKIP
11
-
12
- # TODO: Write general description for this method
13
- # @return [EventType]
14
- attr_accessor :event_type
15
-
16
- # TODO: Write general description for this method
17
- # @return [Integer]
18
- attr_accessor :order_updated_id
19
-
20
- # A mapping from model property names to API property names.
21
- def self.names
22
- @_hash = {} if @_hash.nil?
23
- @_hash['event_type'] = 'eventType'
24
- @_hash['order_updated_id'] = 'orderUpdatedId'
25
- @_hash
26
- end
27
-
28
- # An array for optional fields
29
- def self.optionals
30
- %w[
31
- event_type
32
- ]
33
- end
34
-
35
- # An array for nullable fields
36
- def self.nullables
37
- []
38
- end
39
-
40
- def initialize(order_updated_id:, event_type: SKIP,
41
- additional_properties: nil)
42
- # Add additional model properties to the instance
43
- additional_properties = {} if additional_properties.nil?
44
-
45
- @event_type = event_type unless event_type == SKIP
46
- @order_updated_id = order_updated_id
47
- @additional_properties = additional_properties
48
- end
49
-
50
- # Creates an instance of the object from a hash.
51
- def self.from_hash(hash)
52
- return nil unless hash
53
-
54
- # Extract variables from the hash.
55
- order_updated_id =
56
- hash.key?('orderUpdatedId') ? hash['orderUpdatedId'] : nil
57
- event_type = hash.key?('eventType') ? hash['eventType'] : SKIP
58
-
59
- # Create a new hash for additional properties, removing known properties.
60
- new_hash = hash.reject { |k, _| names.value?(k) }
61
-
62
- additional_properties = APIHelper.get_additional_properties(
63
- new_hash, proc { |value| value }
64
- )
65
-
66
- # Create object from extracted values.
67
- OrderUpdatedEvent.new(order_updated_id: order_updated_id,
68
- event_type: event_type,
69
- additional_properties: additional_properties)
70
- end
71
-
72
- # Validates an instance of the object from a given value.
73
- # @param [OrderUpdatedEvent | Hash] The value against the validation is performed.
74
- def self.validate(value)
75
- if value.instance_of? self
76
- return APIHelper.valid_type?(value.order_updated_id,
77
- ->(val) { val.instance_of? Integer })
78
- end
79
-
80
- return false unless value.instance_of? Hash
81
-
82
- APIHelper.valid_type?(value['orderUpdatedId'],
83
- ->(val) { val.instance_of? Integer })
84
- end
85
-
86
- # Provides a human-readable string representation of the object.
87
- def to_s
88
- class_name = self.class.name.split('::').last
89
- "<#{class_name} event_type: #{@event_type}, order_updated_id: #{@order_updated_id},"\
90
- " additional_properties: #{@additional_properties}>"
91
- end
92
-
93
- # Provides a debugging-friendly string with detailed object information.
94
- def inspect
95
- class_name = self.class.name.split('::').last
96
- "<#{class_name} event_type: #{@event_type.inspect}, order_updated_id:"\
97
- " #{@order_updated_id.inspect}, additional_properties: #{@additional_properties}>"
98
- end
99
- end
100
- end
@@ -1,167 +0,0 @@
1
- # webhooks_and_callbacks_api
2
- #
3
- # This file was automatically generated by
4
- # APIMATIC v3.0 ( https://www.apimatic.io ).
5
-
6
- require 'date'
7
- module WebhooksAndCallbacksApi
8
- # PaymentCallback Model.
9
- class PaymentCallback < BaseModel
10
- SKIP = Object.new
11
- private_constant :SKIP
12
-
13
- # TODO: Write general description for this method
14
- # @return [String]
15
- attr_accessor :order_id
16
-
17
- # TODO: Write general description for this method
18
- # @return [PaymentStatus]
19
- attr_accessor :payment_status
20
-
21
- # TODO: Write general description for this method
22
- # @return [String]
23
- attr_accessor :transaction_id
24
-
25
- # TODO: Write general description for this method
26
- # @return [Float]
27
- attr_accessor :amount
28
-
29
- # TODO: Write general description for this method
30
- # @return [String]
31
- attr_accessor :currency
32
-
33
- # TODO: Write general description for this method
34
- # @return [DateTime]
35
- attr_accessor :timestamp
36
-
37
- # Reason for payment failure (if applicable)
38
- # @return [String]
39
- attr_accessor :failure_reason
40
-
41
- # A mapping from model property names to API property names.
42
- def self.names
43
- @_hash = {} if @_hash.nil?
44
- @_hash['order_id'] = 'orderId'
45
- @_hash['payment_status'] = 'paymentStatus'
46
- @_hash['transaction_id'] = 'transactionId'
47
- @_hash['amount'] = 'amount'
48
- @_hash['currency'] = 'currency'
49
- @_hash['timestamp'] = 'timestamp'
50
- @_hash['failure_reason'] = 'failureReason'
51
- @_hash
52
- end
53
-
54
- # An array for optional fields
55
- def self.optionals
56
- %w[
57
- amount
58
- currency
59
- timestamp
60
- failure_reason
61
- ]
62
- end
63
-
64
- # An array for nullable fields
65
- def self.nullables
66
- []
67
- end
68
-
69
- def initialize(order_id:, payment_status:, transaction_id:, amount: SKIP,
70
- currency: SKIP, timestamp: SKIP, failure_reason: SKIP,
71
- additional_properties: nil)
72
- # Add additional model properties to the instance
73
- additional_properties = {} if additional_properties.nil?
74
-
75
- @order_id = order_id
76
- @payment_status = payment_status
77
- @transaction_id = transaction_id
78
- @amount = amount unless amount == SKIP
79
- @currency = currency unless currency == SKIP
80
- @timestamp = timestamp unless timestamp == SKIP
81
- @failure_reason = failure_reason unless failure_reason == SKIP
82
- @additional_properties = additional_properties
83
- end
84
-
85
- # Creates an instance of the object from a hash.
86
- def self.from_hash(hash)
87
- return nil unless hash
88
-
89
- # Extract variables from the hash.
90
- order_id = hash.key?('orderId') ? hash['orderId'] : nil
91
- payment_status = hash.key?('paymentStatus') ? hash['paymentStatus'] : nil
92
- transaction_id = hash.key?('transactionId') ? hash['transactionId'] : nil
93
- amount = hash.key?('amount') ? hash['amount'] : SKIP
94
- currency = hash.key?('currency') ? hash['currency'] : SKIP
95
- timestamp = if hash.key?('timestamp')
96
- (DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
97
- else
98
- SKIP
99
- end
100
- failure_reason = hash.key?('failureReason') ? hash['failureReason'] : SKIP
101
-
102
- # Create a new hash for additional properties, removing known properties.
103
- new_hash = hash.reject { |k, _| names.value?(k) }
104
-
105
- additional_properties = APIHelper.get_additional_properties(
106
- new_hash, proc { |value| value }
107
- )
108
-
109
- # Create object from extracted values.
110
- PaymentCallback.new(order_id: order_id,
111
- payment_status: payment_status,
112
- transaction_id: transaction_id,
113
- amount: amount,
114
- currency: currency,
115
- timestamp: timestamp,
116
- failure_reason: failure_reason,
117
- additional_properties: additional_properties)
118
- end
119
-
120
- def to_custom_timestamp
121
- DateTimeHelper.to_rfc3339(timestamp)
122
- end
123
-
124
- # Validates an instance of the object from a given value.
125
- # @param [PaymentCallback | Hash] The value against the validation is performed.
126
- def self.validate(value)
127
- if value.instance_of? self
128
- return (
129
- APIHelper.valid_type?(value.order_id,
130
- ->(val) { val.instance_of? String }) and
131
- APIHelper.valid_type?(value.payment_status,
132
- ->(val) { PaymentStatus.validate(val) }) and
133
- APIHelper.valid_type?(value.transaction_id,
134
- ->(val) { val.instance_of? String })
135
- )
136
- end
137
-
138
- return false unless value.instance_of? Hash
139
-
140
- (
141
- APIHelper.valid_type?(value['orderId'],
142
- ->(val) { val.instance_of? String }) and
143
- APIHelper.valid_type?(value['paymentStatus'],
144
- ->(val) { PaymentStatus.validate(val) }) and
145
- APIHelper.valid_type?(value['transactionId'],
146
- ->(val) { val.instance_of? String })
147
- )
148
- end
149
-
150
- # Provides a human-readable string representation of the object.
151
- def to_s
152
- class_name = self.class.name.split('::').last
153
- "<#{class_name} order_id: #{@order_id}, payment_status: #{@payment_status}, transaction_id:"\
154
- " #{@transaction_id}, amount: #{@amount}, currency: #{@currency}, timestamp: #{@timestamp},"\
155
- " failure_reason: #{@failure_reason}, additional_properties: #{@additional_properties}>"
156
- end
157
-
158
- # Provides a debugging-friendly string with detailed object information.
159
- def inspect
160
- class_name = self.class.name.split('::').last
161
- "<#{class_name} order_id: #{@order_id.inspect}, payment_status: #{@payment_status.inspect},"\
162
- " transaction_id: #{@transaction_id.inspect}, amount: #{@amount.inspect}, currency:"\
163
- " #{@currency.inspect}, timestamp: #{@timestamp.inspect}, failure_reason:"\
164
- " #{@failure_reason.inspect}, additional_properties: #{@additional_properties}>"
165
- end
166
- end
167
- end