wesley-key-sdk 3.0.7 → 4.3.1

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,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
+ # UserStatusNotificationEvent Model.
8
+ class UserStatusNotificationEvent < 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_status_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_status_notification_event_type'] =
20
+ 'userStatusNotificationEventType'
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_status_notification_event_type = 'user.status'
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
+ UserStatusNotificationEvent.new(additional_properties: additional_properties)
58
+ end
59
+
60
+ # Validates an instance of the object from a given value.
61
+ # @param [UserStatusNotificationEvent | 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_status_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['userStatusNotificationEventType'],
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_status_notification_event_type:"\
78
+ " #{@user_status_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_status_notification_event_type:"\
86
+ " #{@user_status_notification_event_type.inspect}, additional_properties:"\
87
+ " #{@additional_properties}>"
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,142 @@
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
+ # Webhook Model.
9
+ class Webhook < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [String]
15
+ attr_accessor :webhook_id
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [DateTime]
19
+ attr_accessor :created_at
20
+
21
+ # TODO: Write general description for this method
22
+ # @return [DateTime]
23
+ attr_accessor :updated_at
24
+
25
+ # Timestamp of the last successful delivery
26
+ # @return [DateTime]
27
+ attr_accessor :last_delivery
28
+
29
+ # Total number of events delivered
30
+ # @return [Integer]
31
+ attr_accessor :delivery_count
32
+
33
+ # A mapping from model property names to API property names.
34
+ def self.names
35
+ @_hash = {} if @_hash.nil?
36
+ @_hash['webhook_id'] = 'webhookId'
37
+ @_hash['created_at'] = 'createdAt'
38
+ @_hash['updated_at'] = 'updatedAt'
39
+ @_hash['last_delivery'] = 'lastDelivery'
40
+ @_hash['delivery_count'] = 'deliveryCount'
41
+ @_hash
42
+ end
43
+
44
+ # An array for optional fields
45
+ def self.optionals
46
+ %w[
47
+ webhook_id
48
+ created_at
49
+ updated_at
50
+ last_delivery
51
+ delivery_count
52
+ ]
53
+ end
54
+
55
+ # An array for nullable fields
56
+ def self.nullables
57
+ []
58
+ end
59
+
60
+ def initialize(webhook_id: SKIP, created_at: SKIP, updated_at: SKIP,
61
+ last_delivery: SKIP, delivery_count: SKIP,
62
+ additional_properties: nil)
63
+ # Add additional model properties to the instance
64
+ additional_properties = {} if additional_properties.nil?
65
+
66
+ @webhook_id = webhook_id unless webhook_id == SKIP
67
+ @created_at = created_at unless created_at == SKIP
68
+ @updated_at = updated_at unless updated_at == SKIP
69
+ @last_delivery = last_delivery unless last_delivery == SKIP
70
+ @delivery_count = delivery_count unless delivery_count == SKIP
71
+ @additional_properties = additional_properties
72
+ end
73
+
74
+ # Creates an instance of the object from a hash.
75
+ def self.from_hash(hash)
76
+ return nil unless hash
77
+
78
+ # Extract variables from the hash.
79
+ webhook_id = hash.key?('webhookId') ? hash['webhookId'] : SKIP
80
+ created_at = if hash.key?('createdAt')
81
+ (DateTimeHelper.from_rfc3339(hash['createdAt']) if hash['createdAt'])
82
+ else
83
+ SKIP
84
+ end
85
+ updated_at = if hash.key?('updatedAt')
86
+ (DateTimeHelper.from_rfc3339(hash['updatedAt']) if hash['updatedAt'])
87
+ else
88
+ SKIP
89
+ end
90
+ last_delivery = if hash.key?('lastDelivery')
91
+ (DateTimeHelper.from_rfc3339(hash['lastDelivery']) if hash['lastDelivery'])
92
+ else
93
+ SKIP
94
+ end
95
+ delivery_count = hash.key?('deliveryCount') ? hash['deliveryCount'] : SKIP
96
+
97
+ # Create a new hash for additional properties, removing known properties.
98
+ new_hash = hash.reject { |k, _| names.value?(k) }
99
+
100
+ additional_properties = APIHelper.get_additional_properties(
101
+ new_hash, proc { |value| value }
102
+ )
103
+
104
+ # Create object from extracted values.
105
+ Webhook.new(webhook_id: webhook_id,
106
+ created_at: created_at,
107
+ updated_at: updated_at,
108
+ last_delivery: last_delivery,
109
+ delivery_count: delivery_count,
110
+ additional_properties: additional_properties)
111
+ end
112
+
113
+ def to_custom_created_at
114
+ DateTimeHelper.to_rfc3339(created_at)
115
+ end
116
+
117
+ def to_custom_updated_at
118
+ DateTimeHelper.to_rfc3339(updated_at)
119
+ end
120
+
121
+ def to_custom_last_delivery
122
+ DateTimeHelper.to_rfc3339(last_delivery)
123
+ end
124
+
125
+ # Provides a human-readable string representation of the object.
126
+ def to_s
127
+ class_name = self.class.name.split('::').last
128
+ "<#{class_name} webhook_id: #{@webhook_id}, created_at: #{@created_at}, updated_at:"\
129
+ " #{@updated_at}, last_delivery: #{@last_delivery}, delivery_count: #{@delivery_count},"\
130
+ " additional_properties: #{@additional_properties}>"
131
+ end
132
+
133
+ # Provides a debugging-friendly string with detailed object information.
134
+ def inspect
135
+ class_name = self.class.name.split('::').last
136
+ "<#{class_name} webhook_id: #{@webhook_id.inspect}, created_at: #{@created_at.inspect},"\
137
+ " updated_at: #{@updated_at.inspect}, last_delivery: #{@last_delivery.inspect},"\
138
+ " delivery_count: #{@delivery_count.inspect}, additional_properties:"\
139
+ " #{@additional_properties}>"
140
+ end
141
+ end
142
+ end
@@ -0,0 +1,103 @@
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
+ # WebhookRegistration Model.
8
+ class WebhookRegistration < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # The endpoint URL that will receive webhook events
13
+ # @return [String]
14
+ attr_accessor :url
15
+
16
+ # List of events to subscribe to
17
+ # @return [Array[Event]]
18
+ attr_accessor :events
19
+
20
+ # Secret key for webhook signature verification
21
+ # @return [String]
22
+ attr_accessor :secret
23
+
24
+ # Whether the webhook is active
25
+ # @return [TrueClass | FalseClass]
26
+ attr_accessor :active
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['url'] = 'url'
32
+ @_hash['events'] = 'events'
33
+ @_hash['secret'] = 'secret'
34
+ @_hash['active'] = 'active'
35
+ @_hash
36
+ end
37
+
38
+ # An array for optional fields
39
+ def self.optionals
40
+ %w[
41
+ secret
42
+ active
43
+ ]
44
+ end
45
+
46
+ # An array for nullable fields
47
+ def self.nullables
48
+ []
49
+ end
50
+
51
+ def initialize(url:, events:, secret: SKIP, active: true,
52
+ additional_properties: nil)
53
+ # Add additional model properties to the instance
54
+ additional_properties = {} if additional_properties.nil?
55
+
56
+ @url = url
57
+ @events = events
58
+ @secret = secret unless secret == SKIP
59
+ @active = active unless active == SKIP
60
+ @additional_properties = additional_properties
61
+ end
62
+
63
+ # Creates an instance of the object from a hash.
64
+ def self.from_hash(hash)
65
+ return nil unless hash
66
+
67
+ # Extract variables from the hash.
68
+ url = hash.key?('url') ? hash['url'] : nil
69
+ events = hash.key?('events') ? hash['events'] : nil
70
+ secret = hash.key?('secret') ? hash['secret'] : SKIP
71
+ active = hash['active'] ||= true
72
+
73
+ # Create a new hash for additional properties, removing known properties.
74
+ new_hash = hash.reject { |k, _| names.value?(k) }
75
+
76
+ additional_properties = APIHelper.get_additional_properties(
77
+ new_hash, proc { |value| value }
78
+ )
79
+
80
+ # Create object from extracted values.
81
+ WebhookRegistration.new(url: url,
82
+ events: events,
83
+ secret: secret,
84
+ active: active,
85
+ additional_properties: additional_properties)
86
+ end
87
+
88
+ # Provides a human-readable string representation of the object.
89
+ def to_s
90
+ class_name = self.class.name.split('::').last
91
+ "<#{class_name} url: #{@url}, events: #{@events}, secret: #{@secret}, active: #{@active},"\
92
+ " additional_properties: #{@additional_properties}>"
93
+ end
94
+
95
+ # Provides a debugging-friendly string with detailed object information.
96
+ def inspect
97
+ class_name = self.class.name.split('::').last
98
+ "<#{class_name} url: #{@url.inspect}, events: #{@events.inspect}, secret:"\
99
+ " #{@secret.inspect}, active: #{@active.inspect}, additional_properties:"\
100
+ " #{@additional_properties}>"
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,105 @@
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
+ # WebhookUpdate Model.
8
+ class WebhookUpdate < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :url
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [Array[String]]
18
+ attr_accessor :events
19
+
20
+ # TODO: Write general description for this method
21
+ # @return [String]
22
+ attr_accessor :secret
23
+
24
+ # TODO: Write general description for this method
25
+ # @return [TrueClass | FalseClass]
26
+ attr_accessor :active
27
+
28
+ # A mapping from model property names to API property names.
29
+ def self.names
30
+ @_hash = {} if @_hash.nil?
31
+ @_hash['url'] = 'url'
32
+ @_hash['events'] = 'events'
33
+ @_hash['secret'] = 'secret'
34
+ @_hash['active'] = 'active'
35
+ @_hash
36
+ end
37
+
38
+ # An array for optional fields
39
+ def self.optionals
40
+ %w[
41
+ url
42
+ events
43
+ secret
44
+ active
45
+ ]
46
+ end
47
+
48
+ # An array for nullable fields
49
+ def self.nullables
50
+ []
51
+ end
52
+
53
+ def initialize(url: SKIP, events: SKIP, secret: SKIP, active: SKIP,
54
+ additional_properties: nil)
55
+ # Add additional model properties to the instance
56
+ additional_properties = {} if additional_properties.nil?
57
+
58
+ @url = url unless url == SKIP
59
+ @events = events unless events == SKIP
60
+ @secret = secret unless secret == SKIP
61
+ @active = active unless active == SKIP
62
+ @additional_properties = additional_properties
63
+ end
64
+
65
+ # Creates an instance of the object from a hash.
66
+ def self.from_hash(hash)
67
+ return nil unless hash
68
+
69
+ # Extract variables from the hash.
70
+ url = hash.key?('url') ? hash['url'] : SKIP
71
+ events = hash.key?('events') ? hash['events'] : SKIP
72
+ secret = hash.key?('secret') ? hash['secret'] : SKIP
73
+ active = hash.key?('active') ? hash['active'] : SKIP
74
+
75
+ # Create a new hash for additional properties, removing known properties.
76
+ new_hash = hash.reject { |k, _| names.value?(k) }
77
+
78
+ additional_properties = APIHelper.get_additional_properties(
79
+ new_hash, proc { |value| value }
80
+ )
81
+
82
+ # Create object from extracted values.
83
+ WebhookUpdate.new(url: url,
84
+ events: events,
85
+ secret: secret,
86
+ active: active,
87
+ additional_properties: additional_properties)
88
+ end
89
+
90
+ # Provides a human-readable string representation of the object.
91
+ def to_s
92
+ class_name = self.class.name.split('::').last
93
+ "<#{class_name} url: #{@url}, events: #{@events}, secret: #{@secret}, active: #{@active},"\
94
+ " additional_properties: #{@additional_properties}>"
95
+ end
96
+
97
+ # Provides a debugging-friendly string with detailed object information.
98
+ def inspect
99
+ class_name = self.class.name.split('::').last
100
+ "<#{class_name} url: #{@url.inspect}, events: #{@events.inspect}, secret:"\
101
+ " #{@secret.inspect}, active: #{@active.inspect}, additional_properties:"\
102
+ " #{@additional_properties}>"
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,11 @@
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
+ # A utility that supports dateTime conversion to different formats
9
+ class DateTimeHelper < CoreLibrary::DateTimeHelper
10
+ end
11
+ end
@@ -1,9 +1,9 @@
1
- # cypress_test_api
1
+ # webhooks_and_callbacks_api
2
2
  #
3
- # This file was automatically generated by APIMATIC v3.0
4
- # ( https://www.apimatic.io ).
3
+ # This file was automatically generated by
4
+ # APIMATIC v3.0 ( https://www.apimatic.io ).
5
5
 
6
- module CypressTestApi
6
+ module WebhooksAndCallbacksApi
7
7
  # A utility to allow users to set the content-type for files
8
8
  class FileWrapper < CoreLibrary::FileWrapper
9
9
  # The constructor.
@@ -0,0 +1,172 @@
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
+ # The `UnionTypeLookUp` class serves as a utility class for
8
+ # storing and managing type combinator templates. It acts as a container for the templates
9
+ # used in handling various oneof/anyof instances within the sdk.
10
+ class UnionTypeLookUp
11
+ include CoreLibrary
12
+ # rubocop:disable Lint/RedundantCopDisableDirective, Style/HashSyntax, Layout/FirstArgumentIndentation
13
+ def self.union_types
14
+ {
15
+ :UserNotificationEventBody => OneOf.new(
16
+ [
17
+ LeafType.new(UserActionNotificationEvent),
18
+ LeafType.new(UserStatusNotificationEvent),
19
+ LeafType.new(UserPreferenceNotificationEvent)
20
+ ]
21
+ ),
22
+
23
+ :SystemNotificationEventBody => OneOf.new(
24
+ [
25
+ LeafType.new(SystemAlertNotificationEvent),
26
+ LeafType.new(SystemMaintenanceNotificationEvent),
27
+ LeafType.new(SystemPerformanceNotificationEvent)
28
+ ]
29
+ ),
30
+
31
+ :InventoryChangeEventBody => OneOf.new(
32
+ [
33
+ LeafType.new(InventoryStockIncreaseEvent),
34
+ LeafType.new(InventoryStockDecreaseEvent),
35
+ LeafType.new(InventoryStockDepletedEvent)
36
+ ]
37
+ ),
38
+
39
+ :RootLevelOneOfPrimitiveEventRootLevelPrimitiveOneOfBody => OneOf.new(
40
+ [
41
+ LeafType.new(RootLevelPrimitiveOneOfEventRequest),
42
+ LeafType.new(Integer),
43
+ LeafType.new(RootLevelPrimitiveOneOfEventRequest1, UnionTypeContext.new(
44
+ is_array: true
45
+ )),
46
+ LeafType.new(Integer, UnionTypeContext.new(
47
+ is_array: true
48
+ ))
49
+ ]
50
+ ),
51
+
52
+ :FulfillmentCallbackDeliveryDetails => OneOf.new(
53
+ [
54
+ LeafType.new(String),
55
+ LeafType.new(DeliveryDetails)
56
+ ],
57
+ UnionTypeContext.new(
58
+ is_optional: true
59
+ )
60
+ ),
61
+
62
+ :OrderCreatedEventDeliveryDetails => OneOf.new(
63
+ [
64
+ LeafType.new(String),
65
+ LeafType.new(DeliveryDetails)
66
+ ],
67
+ UnionTypeContext.new(
68
+ is_optional: true
69
+ )
70
+ ),
71
+
72
+ :Webhooks => OneOf.new(
73
+ [
74
+ LeafType.new(OrderCreatedEvent),
75
+ LeafType.new(OrderUpdatedEvent),
76
+ LeafType.new(PaymentCompletedEvent),
77
+ LeafType.new(PrimitiveCollectionEvent)
78
+ ]
79
+ ),
80
+
81
+ :WebhooksA => OneOf.new(
82
+ [
83
+ LeafType.new(PaymentStatusUpdatedEvent),
84
+ LeafType.new(PaymentStatusCreatedEvent)
85
+ ]
86
+ ),
87
+
88
+ :WebhooksB => OneOf.new(
89
+ [
90
+ OneOf.new(
91
+ [
92
+ LeafType.new(UserActionNotificationEvent),
93
+ LeafType.new(UserStatusNotificationEvent),
94
+ LeafType.new(UserPreferenceNotificationEvent)
95
+ ]
96
+ ),
97
+ OneOf.new(
98
+ [
99
+ LeafType.new(SystemAlertNotificationEvent),
100
+ LeafType.new(SystemMaintenanceNotificationEvent),
101
+ LeafType.new(SystemPerformanceNotificationEvent)
102
+ ]
103
+ ),
104
+ OneOf.new(
105
+ [
106
+ LeafType.new(InventoryStockIncreaseEvent),
107
+ LeafType.new(InventoryStockDecreaseEvent),
108
+ LeafType.new(InventoryStockDepletedEvent)
109
+ ]
110
+ )
111
+ ]
112
+ ),
113
+
114
+ :WebhooksC => OneOf.new(
115
+ [
116
+ LeafType.new(String),
117
+ LeafType.new(Integer),
118
+ LeafType.new(Float, UnionTypeContext.new(
119
+ is_array: true
120
+ )),
121
+ LeafType.new(String, UnionTypeContext.new(
122
+ is_dict: true
123
+ ))
124
+ ]
125
+ ),
126
+
127
+ :WebhooksNoVerification => OneOf.new(
128
+ [
129
+ LeafType.new(AuditLogEvent),
130
+ OneOf.new(
131
+ [
132
+ LeafType.new(RootLevelPrimitiveOneOfEventRequest),
133
+ LeafType.new(Integer),
134
+ LeafType.new(RootLevelPrimitiveOneOfEventRequest1, UnionTypeContext.new(
135
+ is_array: true
136
+ )),
137
+ LeafType.new(Integer, UnionTypeContext.new(
138
+ is_array: true
139
+ ))
140
+ ]
141
+ )
142
+ ]
143
+ ),
144
+
145
+ :CallbacksA => OneOf.new(
146
+ [
147
+ LeafType.new(PaymentCallback),
148
+ LeafType.new(FulfillmentCallback)
149
+ ]
150
+ ),
151
+
152
+ :CallbacksB => OneOf.new(
153
+ [
154
+ LeafType.new(NotificationCallback, UnionTypeContext.new(
155
+ discriminator_value: 'email',
156
+ discriminator: 'notificationType'
157
+ )),
158
+ LeafType.new(NotificationCallback, UnionTypeContext.new(
159
+ discriminator_value: 'sms',
160
+ discriminator: 'notificationType'
161
+ ))
162
+ ]
163
+ )
164
+ }
165
+ end
166
+ # rubocop:enable Lint/RedundantCopDisableDirective, Style/HashSyntax, Layout/FirstArgumentIndentation
167
+
168
+ def self.get(name)
169
+ UnionTypeLookUp.union_types[name]
170
+ end
171
+ end
172
+ end