wesley-key-sdk 3.0.6 → 4.0.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 (107) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +156 -132
  3. data/bin/console +4 -4
  4. data/lib/webhooks_and_callbacks_api/api_helper.rb +10 -0
  5. data/lib/{cypress_test_api/controllers/base_controller.rb → webhooks_and_callbacks_api/apis/base_api.rb} +17 -10
  6. data/lib/webhooks_and_callbacks_api/apis/orders_api.rb +34 -0
  7. data/lib/webhooks_and_callbacks_api/client.rb +76 -0
  8. data/lib/{cypress_test_api → webhooks_and_callbacks_api}/configuration.rb +61 -46
  9. data/lib/webhooks_and_callbacks_api/events/callbacks/callbacks_a_handler.rb +66 -0
  10. data/lib/webhooks_and_callbacks_api/events/callbacks/callbacks_b_handler.rb +78 -0
  11. data/lib/webhooks_and_callbacks_api/events/signature_verification_failure.rb +33 -0
  12. data/lib/webhooks_and_callbacks_api/events/signature_verification_result.rb +14 -0
  13. data/lib/webhooks_and_callbacks_api/events/unknown_event.rb +32 -0
  14. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_a_handler.rb +67 -0
  15. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_b_handler.rb +86 -0
  16. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_c_handler.rb +79 -0
  17. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_handler.rb +67 -0
  18. data/lib/webhooks_and_callbacks_api/events/webhooks/webhooks_no_verification_handler.rb +39 -0
  19. data/lib/{cypress_test_api → webhooks_and_callbacks_api}/exceptions/api_exception.rb +4 -4
  20. data/lib/webhooks_and_callbacks_api/exceptions/error_exception.rb +57 -0
  21. data/lib/webhooks_and_callbacks_api/http/api_response.rb +19 -0
  22. data/lib/webhooks_and_callbacks_api/http/auth/api_key.rb +52 -0
  23. data/lib/webhooks_and_callbacks_api/http/auth/bearer_auth.rb +53 -0
  24. data/lib/webhooks_and_callbacks_api/http/http_call_back.rb +10 -0
  25. data/lib/webhooks_and_callbacks_api/http/http_method_enum.rb +10 -0
  26. data/lib/webhooks_and_callbacks_api/http/http_request.rb +10 -0
  27. data/lib/webhooks_and_callbacks_api/http/http_response.rb +10 -0
  28. data/lib/{cypress_test_api → webhooks_and_callbacks_api}/http/proxy_settings.rb +4 -4
  29. data/lib/webhooks_and_callbacks_api/logging/configuration/api_logging_configuration.rb +186 -0
  30. data/lib/webhooks_and_callbacks_api/logging/sdk_logger.rb +17 -0
  31. data/lib/webhooks_and_callbacks_api/models/address.rb +114 -0
  32. data/lib/webhooks_and_callbacks_api/models/audit_log_event.rb +115 -0
  33. data/lib/{cypress_test_api → webhooks_and_callbacks_api}/models/base_model.rb +4 -4
  34. data/lib/webhooks_and_callbacks_api/models/create_order_request.rb +131 -0
  35. data/lib/webhooks_and_callbacks_api/models/delivery_details.rb +104 -0
  36. data/lib/webhooks_and_callbacks_api/models/email_notification_callback.rb +97 -0
  37. data/lib/webhooks_and_callbacks_api/models/event.rb +52 -0
  38. data/lib/webhooks_and_callbacks_api/models/event_type.rb +26 -0
  39. data/lib/webhooks_and_callbacks_api/models/event_type1.rb +26 -0
  40. data/lib/webhooks_and_callbacks_api/models/event_type2.rb +26 -0
  41. data/lib/webhooks_and_callbacks_api/models/event_type3.rb +26 -0
  42. data/lib/webhooks_and_callbacks_api/models/fulfillment_callback.rb +411 -0
  43. data/lib/webhooks_and_callbacks_api/models/fulfillment_status.rb +40 -0
  44. data/lib/webhooks_and_callbacks_api/models/fulfillment_statuss.rb +40 -0
  45. data/lib/webhooks_and_callbacks_api/models/inventory_stock_decrease_event.rb +90 -0
  46. data/lib/webhooks_and_callbacks_api/models/inventory_stock_depleted_event.rb +90 -0
  47. data/lib/webhooks_and_callbacks_api/models/inventory_stock_increase_event.rb +90 -0
  48. data/lib/webhooks_and_callbacks_api/models/notification_callback.rb +119 -0
  49. data/lib/{cypress_test_api/models/o_auth_scope_o_auth_acg_enum.rb → webhooks_and_callbacks_api/models/oauth_scope_oauth_acg.rb} +19 -19
  50. data/lib/webhooks_and_callbacks_api/models/order.rb +161 -0
  51. data/lib/webhooks_and_callbacks_api/models/order_created_event.rb +314 -0
  52. data/lib/webhooks_and_callbacks_api/models/order_item.rb +102 -0
  53. data/lib/webhooks_and_callbacks_api/models/order_updated_event.rb +100 -0
  54. data/lib/webhooks_and_callbacks_api/models/package.rb +95 -0
  55. data/lib/webhooks_and_callbacks_api/models/payment_callback.rb +167 -0
  56. data/lib/webhooks_and_callbacks_api/models/payment_completed_event.rb +98 -0
  57. data/lib/webhooks_and_callbacks_api/models/payment_status.rb +40 -0
  58. data/lib/webhooks_and_callbacks_api/models/payment_status_created_event.rb +89 -0
  59. data/lib/webhooks_and_callbacks_api/models/payment_status_updated_event.rb +89 -0
  60. data/lib/webhooks_and_callbacks_api/models/primitive_collection_event.rb +98 -0
  61. data/lib/webhooks_and_callbacks_api/models/root_level_primitive_one_of_event_request.rb +40 -0
  62. data/lib/webhooks_and_callbacks_api/models/root_level_primitive_one_of_event_request1.rb +40 -0
  63. data/lib/webhooks_and_callbacks_api/models/sms_notification_callback.rb +95 -0
  64. data/lib/webhooks_and_callbacks_api/models/status.rb +44 -0
  65. data/lib/webhooks_and_callbacks_api/models/status1.rb +36 -0
  66. data/lib/webhooks_and_callbacks_api/models/status2.rb +36 -0
  67. data/lib/webhooks_and_callbacks_api/models/system_alert_notification_event.rb +90 -0
  68. data/lib/webhooks_and_callbacks_api/models/system_maintenance_notification_event.rb +90 -0
  69. data/lib/webhooks_and_callbacks_api/models/system_performance_notification_event.rb +90 -0
  70. data/lib/webhooks_and_callbacks_api/models/user_action_notification_event.rb +90 -0
  71. data/lib/webhooks_and_callbacks_api/models/user_preference_notification_event.rb +90 -0
  72. data/lib/webhooks_and_callbacks_api/models/user_status_notification_event.rb +90 -0
  73. data/lib/webhooks_and_callbacks_api/models/webhook.rb +142 -0
  74. data/lib/webhooks_and_callbacks_api/models/webhook_registration.rb +103 -0
  75. data/lib/webhooks_and_callbacks_api/models/webhook_update.rb +105 -0
  76. data/lib/webhooks_and_callbacks_api/utilities/date_time_helper.rb +11 -0
  77. data/lib/{cypress_test_api → webhooks_and_callbacks_api}/utilities/file_wrapper.rb +4 -4
  78. data/lib/webhooks_and_callbacks_api/utilities/union_type_lookup.rb +172 -0
  79. data/lib/webhooks_and_callbacks_api.rb +122 -0
  80. metadata +78 -64
  81. data/lib/cypress_test_api/api_helper.rb +0 -10
  82. data/lib/cypress_test_api/client.rb +0 -58
  83. data/lib/cypress_test_api/controllers/api_controller.rb +0 -102
  84. data/lib/cypress_test_api/http/http_call_back.rb +0 -10
  85. data/lib/cypress_test_api/http/http_method_enum.rb +0 -10
  86. data/lib/cypress_test_api/http/http_request.rb +0 -10
  87. data/lib/cypress_test_api/http/http_response.rb +0 -10
  88. data/lib/cypress_test_api/models/custom_enum.rb +0 -40
  89. data/lib/cypress_test_api/models/deer.rb +0 -68
  90. data/lib/cypress_test_api/models/item.rb +0 -166
  91. data/lib/cypress_test_api/models/item_response.rb +0 -80
  92. data/lib/cypress_test_api/models/lion.rb +0 -68
  93. data/lib/cypress_test_api/models/message.rb +0 -68
  94. data/lib/cypress_test_api/models/message2.rb +0 -71
  95. data/lib/cypress_test_api/models/multiple_arrays_request.rb +0 -70
  96. data/lib/cypress_test_api/models/nac_tag.rb +0 -265
  97. data/lib/cypress_test_api/models/response_http400.rb +0 -62
  98. data/lib/cypress_test_api/models/response_http404.rb +0 -62
  99. data/lib/cypress_test_api/models/status11_enum.rb +0 -40
  100. data/lib/cypress_test_api/models/status1_enum.rb +0 -40
  101. data/lib/cypress_test_api/models/status_enum.rb +0 -40
  102. data/lib/cypress_test_api/models/tokens_request.rb +0 -60
  103. data/lib/cypress_test_api/utilities/date_time_helper.rb +0 -11
  104. data/lib/cypress_test_api.rb +0 -55
  105. data/test/controllers/controller_test_base.rb +0 -23
  106. data/test/controllers/test_api_controller.rb +0 -40
  107. data/test/http_response_catcher.rb +0 -19
@@ -0,0 +1,95 @@
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
+ # SmsNotificationCallback Model.
8
+ class SmsNotificationCallback < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :message_id
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_accessor :phone_number
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [Status2]
22
+ attr_accessor :status
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['message_id'] = 'messageId'
28
+ @_hash['phone_number'] = 'phoneNumber'
29
+ @_hash['status'] = 'status'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ %w[
36
+ message_id
37
+ phone_number
38
+ status
39
+ ]
40
+ end
41
+
42
+ # An array for nullable fields
43
+ def self.nullables
44
+ []
45
+ end
46
+
47
+ def initialize(message_id: SKIP, phone_number: SKIP, status: SKIP,
48
+ additional_properties: nil)
49
+ # Add additional model properties to the instance
50
+ additional_properties = {} if additional_properties.nil?
51
+
52
+ @message_id = message_id unless message_id == SKIP
53
+ @phone_number = phone_number unless phone_number == SKIP
54
+ @status = status unless status == SKIP
55
+ @additional_properties = additional_properties
56
+ end
57
+
58
+ # Creates an instance of the object from a hash.
59
+ def self.from_hash(hash)
60
+ return nil unless hash
61
+
62
+ # Extract variables from the hash.
63
+ message_id = hash.key?('messageId') ? hash['messageId'] : SKIP
64
+ phone_number = hash.key?('phoneNumber') ? hash['phoneNumber'] : SKIP
65
+ status = hash.key?('status') ? hash['status'] : SKIP
66
+
67
+ # Create a new hash for additional properties, removing known properties.
68
+ new_hash = hash.reject { |k, _| names.value?(k) }
69
+
70
+ additional_properties = APIHelper.get_additional_properties(
71
+ new_hash, proc { |value| value }
72
+ )
73
+
74
+ # Create object from extracted values.
75
+ SmsNotificationCallback.new(message_id: message_id,
76
+ phone_number: phone_number,
77
+ status: status,
78
+ additional_properties: additional_properties)
79
+ end
80
+
81
+ # Provides a human-readable string representation of the object.
82
+ def to_s
83
+ class_name = self.class.name.split('::').last
84
+ "<#{class_name} message_id: #{@message_id}, phone_number: #{@phone_number}, status:"\
85
+ " #{@status}, additional_properties: #{@additional_properties}>"
86
+ end
87
+
88
+ # Provides a debugging-friendly string with detailed object information.
89
+ def inspect
90
+ class_name = self.class.name.split('::').last
91
+ "<#{class_name} message_id: #{@message_id.inspect}, phone_number: #{@phone_number.inspect},"\
92
+ " status: #{@status.inspect}, additional_properties: #{@additional_properties}>"
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,44 @@
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
+ # Status.
8
+ class Status
9
+ STATUS = [
10
+ # TODO: Write general description for PENDING
11
+ PENDING = 'pending'.freeze,
12
+
13
+ # TODO: Write general description for PROCESSING
14
+ PROCESSING = 'processing'.freeze,
15
+
16
+ # TODO: Write general description for COMPLETED
17
+ COMPLETED = 'completed'.freeze,
18
+
19
+ # TODO: Write general description for CANCELLED
20
+ CANCELLED = 'cancelled'.freeze
21
+ ].freeze
22
+
23
+ def self.validate(value)
24
+ return false if value.nil?
25
+
26
+ STATUS.include?(value)
27
+ end
28
+
29
+ def self.from_value(value, default_value = PENDING)
30
+ return default_value if value.nil?
31
+
32
+ str = value.to_s.strip
33
+
34
+ case str.downcase
35
+ when 'pending' then PENDING
36
+ when 'processing' then PROCESSING
37
+ when 'completed' then COMPLETED
38
+ when 'cancelled' then CANCELLED
39
+ else
40
+ default_value
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,36 @@
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
+ # Status1.
8
+ class Status1
9
+ STATUS1 = [
10
+ # TODO: Write general description for SENT
11
+ SENT = 'sent'.freeze,
12
+
13
+ # TODO: Write general description for FAILED
14
+ FAILED = 'failed'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ STATUS1.include?(value)
21
+ end
22
+
23
+ def self.from_value(value, default_value = SENT)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'sent' then SENT
30
+ when 'failed' then FAILED
31
+ else
32
+ default_value
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,36 @@
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
+ # Status2.
8
+ class Status2
9
+ STATUS2 = [
10
+ # TODO: Write general description for DELIVERED
11
+ DELIVERED = 'delivered'.freeze,
12
+
13
+ # TODO: Write general description for FAILED
14
+ FAILED = 'failed'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ STATUS2.include?(value)
21
+ end
22
+
23
+ def self.from_value(value, default_value = DELIVERED)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'delivered' then DELIVERED
30
+ when 'failed' then FAILED
31
+ else
32
+ default_value
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,90 @@
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
+ # SystemAlertNotificationEvent Model.
8
+ class SystemAlertNotificationEvent < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_reader :system_alert_notification_event_type
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['system_alert_notification_event_type'] =
20
+ 'systemAlertNotificationEventType'
21
+ @_hash
22
+ end
23
+
24
+ # An array for optional fields
25
+ def self.optionals
26
+ []
27
+ end
28
+
29
+ # An array for nullable fields
30
+ def self.nullables
31
+ []
32
+ end
33
+
34
+ def initialize(additional_properties: nil)
35
+ # Add additional model properties to the instance
36
+ additional_properties = {} if additional_properties.nil?
37
+
38
+ @system_alert_notification_event_type = 'system.alert'
39
+ @additional_properties = additional_properties
40
+ end
41
+
42
+ # Creates an instance of the object from a hash.
43
+ def self.from_hash(hash)
44
+ return nil unless hash
45
+
46
+ # Extract variables from the hash.
47
+
48
+
49
+ # Create a new hash for additional properties, removing known properties.
50
+ new_hash = hash.reject { |k, _| names.value?(k) }
51
+
52
+ additional_properties = APIHelper.get_additional_properties(
53
+ new_hash, proc { |value| value }
54
+ )
55
+
56
+ # Create object from extracted values.
57
+ SystemAlertNotificationEvent.new(additional_properties: additional_properties)
58
+ end
59
+
60
+ # Validates an instance of the object from a given value.
61
+ # @param [SystemAlertNotificationEvent | Hash] The value against the validation is performed.
62
+ def self.validate(value)
63
+ if value.instance_of? self
64
+ return APIHelper.valid_type?(value.system_alert_notification_event_type,
65
+ ->(val) { val.instance_of? String })
66
+ end
67
+
68
+ return false unless value.instance_of? Hash
69
+
70
+ APIHelper.valid_type?(value['systemAlertNotificationEventType'],
71
+ ->(val) { val.instance_of? String })
72
+ end
73
+
74
+ # Provides a human-readable string representation of the object.
75
+ def to_s
76
+ class_name = self.class.name.split('::').last
77
+ "<#{class_name} system_alert_notification_event_type:"\
78
+ " #{@system_alert_notification_event_type}, additional_properties:"\
79
+ " #{@additional_properties}>"
80
+ end
81
+
82
+ # Provides a debugging-friendly string with detailed object information.
83
+ def inspect
84
+ class_name = self.class.name.split('::').last
85
+ "<#{class_name} system_alert_notification_event_type:"\
86
+ " #{@system_alert_notification_event_type.inspect}, additional_properties:"\
87
+ " #{@additional_properties}>"
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,90 @@
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
+ # SystemMaintenanceNotificationEvent Model.
8
+ class SystemMaintenanceNotificationEvent < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_reader :system_maintenance_notification_event_type
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['system_maintenance_notification_event_type'] =
20
+ 'systemMaintenanceNotificationEventType'
21
+ @_hash
22
+ end
23
+
24
+ # An array for optional fields
25
+ def self.optionals
26
+ []
27
+ end
28
+
29
+ # An array for nullable fields
30
+ def self.nullables
31
+ []
32
+ end
33
+
34
+ def initialize(additional_properties: nil)
35
+ # Add additional model properties to the instance
36
+ additional_properties = {} if additional_properties.nil?
37
+
38
+ @system_maintenance_notification_event_type = 'system.maintenance'
39
+ @additional_properties = additional_properties
40
+ end
41
+
42
+ # Creates an instance of the object from a hash.
43
+ def self.from_hash(hash)
44
+ return nil unless hash
45
+
46
+ # Extract variables from the hash.
47
+
48
+
49
+ # Create a new hash for additional properties, removing known properties.
50
+ new_hash = hash.reject { |k, _| names.value?(k) }
51
+
52
+ additional_properties = APIHelper.get_additional_properties(
53
+ new_hash, proc { |value| value }
54
+ )
55
+
56
+ # Create object from extracted values.
57
+ SystemMaintenanceNotificationEvent.new(additional_properties: additional_properties)
58
+ end
59
+
60
+ # Validates an instance of the object from a given value.
61
+ # @param [SystemMaintenanceNotificationEvent | Hash] The value against the validation is performed.
62
+ def self.validate(value)
63
+ if value.instance_of? self
64
+ return APIHelper.valid_type?(value.system_maintenance_notification_event_type,
65
+ ->(val) { val.instance_of? String })
66
+ end
67
+
68
+ return false unless value.instance_of? Hash
69
+
70
+ APIHelper.valid_type?(value['systemMaintenanceNotificationEventType'],
71
+ ->(val) { val.instance_of? String })
72
+ end
73
+
74
+ # Provides a human-readable string representation of the object.
75
+ def to_s
76
+ class_name = self.class.name.split('::').last
77
+ "<#{class_name} system_maintenance_notification_event_type:"\
78
+ " #{@system_maintenance_notification_event_type}, additional_properties:"\
79
+ " #{@additional_properties}>"
80
+ end
81
+
82
+ # Provides a debugging-friendly string with detailed object information.
83
+ def inspect
84
+ class_name = self.class.name.split('::').last
85
+ "<#{class_name} system_maintenance_notification_event_type:"\
86
+ " #{@system_maintenance_notification_event_type.inspect}, additional_properties:"\
87
+ " #{@additional_properties}>"
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,90 @@
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
+ # SystemPerformanceNotificationEvent Model.
8
+ class SystemPerformanceNotificationEvent < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_reader :system_performance_notification_event_type
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['system_performance_notification_event_type'] =
20
+ 'systemPerformanceNotificationEventType'
21
+ @_hash
22
+ end
23
+
24
+ # An array for optional fields
25
+ def self.optionals
26
+ []
27
+ end
28
+
29
+ # An array for nullable fields
30
+ def self.nullables
31
+ []
32
+ end
33
+
34
+ def initialize(additional_properties: nil)
35
+ # Add additional model properties to the instance
36
+ additional_properties = {} if additional_properties.nil?
37
+
38
+ @system_performance_notification_event_type = 'system.performance'
39
+ @additional_properties = additional_properties
40
+ end
41
+
42
+ # Creates an instance of the object from a hash.
43
+ def self.from_hash(hash)
44
+ return nil unless hash
45
+
46
+ # Extract variables from the hash.
47
+
48
+
49
+ # Create a new hash for additional properties, removing known properties.
50
+ new_hash = hash.reject { |k, _| names.value?(k) }
51
+
52
+ additional_properties = APIHelper.get_additional_properties(
53
+ new_hash, proc { |value| value }
54
+ )
55
+
56
+ # Create object from extracted values.
57
+ SystemPerformanceNotificationEvent.new(additional_properties: additional_properties)
58
+ end
59
+
60
+ # Validates an instance of the object from a given value.
61
+ # @param [SystemPerformanceNotificationEvent | Hash] The value against the validation is performed.
62
+ def self.validate(value)
63
+ if value.instance_of? self
64
+ return APIHelper.valid_type?(value.system_performance_notification_event_type,
65
+ ->(val) { val.instance_of? String })
66
+ end
67
+
68
+ return false unless value.instance_of? Hash
69
+
70
+ APIHelper.valid_type?(value['systemPerformanceNotificationEventType'],
71
+ ->(val) { val.instance_of? String })
72
+ end
73
+
74
+ # Provides a human-readable string representation of the object.
75
+ def to_s
76
+ class_name = self.class.name.split('::').last
77
+ "<#{class_name} system_performance_notification_event_type:"\
78
+ " #{@system_performance_notification_event_type}, additional_properties:"\
79
+ " #{@additional_properties}>"
80
+ end
81
+
82
+ # Provides a debugging-friendly string with detailed object information.
83
+ def inspect
84
+ class_name = self.class.name.split('::').last
85
+ "<#{class_name} system_performance_notification_event_type:"\
86
+ " #{@system_performance_notification_event_type.inspect}, additional_properties:"\
87
+ " #{@additional_properties}>"
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,90 @@
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
+ # UserActionNotificationEvent Model.
8
+ class UserActionNotificationEvent < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_reader :user_action_notification_event_type
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['user_action_notification_event_type'] =
20
+ 'userActionNotificationEventType'
21
+ @_hash
22
+ end
23
+
24
+ # An array for optional fields
25
+ def self.optionals
26
+ []
27
+ end
28
+
29
+ # An array for nullable fields
30
+ def self.nullables
31
+ []
32
+ end
33
+
34
+ def initialize(additional_properties: nil)
35
+ # Add additional model properties to the instance
36
+ additional_properties = {} if additional_properties.nil?
37
+
38
+ @user_action_notification_event_type = 'user.action'
39
+ @additional_properties = additional_properties
40
+ end
41
+
42
+ # Creates an instance of the object from a hash.
43
+ def self.from_hash(hash)
44
+ return nil unless hash
45
+
46
+ # Extract variables from the hash.
47
+
48
+
49
+ # Create a new hash for additional properties, removing known properties.
50
+ new_hash = hash.reject { |k, _| names.value?(k) }
51
+
52
+ additional_properties = APIHelper.get_additional_properties(
53
+ new_hash, proc { |value| value }
54
+ )
55
+
56
+ # Create object from extracted values.
57
+ UserActionNotificationEvent.new(additional_properties: additional_properties)
58
+ end
59
+
60
+ # Validates an instance of the object from a given value.
61
+ # @param [UserActionNotificationEvent | Hash] The value against the validation is performed.
62
+ def self.validate(value)
63
+ if value.instance_of? self
64
+ return APIHelper.valid_type?(value.user_action_notification_event_type,
65
+ ->(val) { val.instance_of? String })
66
+ end
67
+
68
+ return false unless value.instance_of? Hash
69
+
70
+ APIHelper.valid_type?(value['userActionNotificationEventType'],
71
+ ->(val) { val.instance_of? String })
72
+ end
73
+
74
+ # Provides a human-readable string representation of the object.
75
+ def to_s
76
+ class_name = self.class.name.split('::').last
77
+ "<#{class_name} user_action_notification_event_type:"\
78
+ " #{@user_action_notification_event_type}, additional_properties:"\
79
+ " #{@additional_properties}>"
80
+ end
81
+
82
+ # Provides a debugging-friendly string with detailed object information.
83
+ def inspect
84
+ class_name = self.class.name.split('::').last
85
+ "<#{class_name} user_action_notification_event_type:"\
86
+ " #{@user_action_notification_event_type.inspect}, additional_properties:"\
87
+ " #{@additional_properties}>"
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,90 @@
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
+ # UserPreferenceNotificationEvent Model.
8
+ class UserPreferenceNotificationEvent < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_reader :user_preference_notification_event_type
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['user_preference_notification_event_type'] =
20
+ 'userPreferenceNotificationEventType'
21
+ @_hash
22
+ end
23
+
24
+ # An array for optional fields
25
+ def self.optionals
26
+ []
27
+ end
28
+
29
+ # An array for nullable fields
30
+ def self.nullables
31
+ []
32
+ end
33
+
34
+ def initialize(additional_properties: nil)
35
+ # Add additional model properties to the instance
36
+ additional_properties = {} if additional_properties.nil?
37
+
38
+ @user_preference_notification_event_type = 'user.preference'
39
+ @additional_properties = additional_properties
40
+ end
41
+
42
+ # Creates an instance of the object from a hash.
43
+ def self.from_hash(hash)
44
+ return nil unless hash
45
+
46
+ # Extract variables from the hash.
47
+
48
+
49
+ # Create a new hash for additional properties, removing known properties.
50
+ new_hash = hash.reject { |k, _| names.value?(k) }
51
+
52
+ additional_properties = APIHelper.get_additional_properties(
53
+ new_hash, proc { |value| value }
54
+ )
55
+
56
+ # Create object from extracted values.
57
+ UserPreferenceNotificationEvent.new(additional_properties: additional_properties)
58
+ end
59
+
60
+ # Validates an instance of the object from a given value.
61
+ # @param [UserPreferenceNotificationEvent | Hash] The value against the validation is performed.
62
+ def self.validate(value)
63
+ if value.instance_of? self
64
+ return APIHelper.valid_type?(value.user_preference_notification_event_type,
65
+ ->(val) { val.instance_of? String })
66
+ end
67
+
68
+ return false unless value.instance_of? Hash
69
+
70
+ APIHelper.valid_type?(value['userPreferenceNotificationEventType'],
71
+ ->(val) { val.instance_of? String })
72
+ end
73
+
74
+ # Provides a human-readable string representation of the object.
75
+ def to_s
76
+ class_name = self.class.name.split('::').last
77
+ "<#{class_name} user_preference_notification_event_type:"\
78
+ " #{@user_preference_notification_event_type}, additional_properties:"\
79
+ " #{@additional_properties}>"
80
+ end
81
+
82
+ # Provides a debugging-friendly string with detailed object information.
83
+ def inspect
84
+ class_name = self.class.name.split('::').last
85
+ "<#{class_name} user_preference_notification_event_type:"\
86
+ " #{@user_preference_notification_event_type.inspect}, additional_properties:"\
87
+ " #{@additional_properties}>"
88
+ end
89
+ end
90
+ end