hooksniff 0.3.0 → 1.1.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 (214) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -0
  3. data/Gemfile.lock +56 -0
  4. data/README.md +23 -199
  5. data/Rakefile +2 -0
  6. data/hooksniff.gemspec +48 -0
  7. data/lib/hooksniff/api/authentication.rb +36 -0
  8. data/lib/hooksniff/api/endpoint.rb +102 -0
  9. data/lib/hooksniff/api/event_type.rb +66 -0
  10. data/lib/hooksniff/api/health.rb +16 -0
  11. data/lib/hooksniff/api/integration.rb +42 -0
  12. data/lib/hooksniff/api/message.rb +48 -0
  13. data/lib/hooksniff/api/message_attempt.rb +38 -0
  14. data/lib/hooksniff/api/statistics.rb +37 -0
  15. data/lib/hooksniff/api/stream.rb +45 -0
  16. data/lib/{openapi_client → hooksniff}/api_error.rb +8 -18
  17. data/lib/hooksniff/background_task.rb +21 -0
  18. data/lib/hooksniff/connector.rb +33 -0
  19. data/lib/hooksniff/environment.rb +53 -0
  20. data/lib/hooksniff/errors.rb +129 -0
  21. data/lib/hooksniff/hooksniff.rb +52 -0
  22. data/lib/hooksniff/hooksniff_http_client.rb +128 -0
  23. data/lib/hooksniff/http_error_out.rb +18 -0
  24. data/lib/hooksniff/http_validation_error.rb +18 -0
  25. data/lib/hooksniff/inbound.rb +25 -0
  26. data/lib/hooksniff/internal.rb +7 -0
  27. data/lib/hooksniff/message_poller.rb +32 -0
  28. data/lib/hooksniff/models/endpoint_created_event.rb +50 -0
  29. data/lib/hooksniff/models/endpoint_created_event_data.rb +63 -0
  30. data/lib/hooksniff/models/endpoint_deleted_event.rb +50 -0
  31. data/lib/hooksniff/models/endpoint_deleted_event_data.rb +63 -0
  32. data/lib/hooksniff/models/endpoint_disabled_event.rb +53 -0
  33. data/lib/hooksniff/models/endpoint_disabled_event_data.rb +69 -0
  34. data/lib/hooksniff/models/endpoint_enabled_event.rb +50 -0
  35. data/lib/hooksniff/models/endpoint_enabled_event_data.rb +63 -0
  36. data/lib/hooksniff/models/endpoint_headers_in.rb +46 -0
  37. data/lib/hooksniff/models/endpoint_headers_out.rb +52 -0
  38. data/lib/hooksniff/models/endpoint_headers_patch_in.rb +53 -0
  39. data/lib/hooksniff/models/endpoint_in.rb +102 -0
  40. data/lib/hooksniff/models/endpoint_out.rb +104 -0
  41. data/lib/hooksniff/models/endpoint_patch.rb +97 -0
  42. data/lib/hooksniff/models/endpoint_secret_out.rb +50 -0
  43. data/lib/hooksniff/models/endpoint_secret_rotate_in.rb +53 -0
  44. data/lib/hooksniff/models/endpoint_update.rb +90 -0
  45. data/lib/hooksniff/models/endpoint_updated_event.rb +50 -0
  46. data/lib/hooksniff/models/endpoint_updated_event_data.rb +63 -0
  47. data/lib/hooksniff/models/event_in.rb +50 -0
  48. data/lib/hooksniff/models/event_out.rb +53 -0
  49. data/lib/hooksniff/models/event_type_in.rb +80 -0
  50. data/lib/hooksniff/models/event_type_out.rb +87 -0
  51. data/lib/hooksniff/models/event_type_patch.rb +66 -0
  52. data/lib/hooksniff/models/event_type_update.rb +67 -0
  53. data/lib/hooksniff/models/list_response_endpoint_out.rb +58 -0
  54. data/lib/hooksniff/models/list_response_event_type_out.rb +58 -0
  55. data/lib/hooksniff/models/list_response_message_attempt_out.rb +58 -0
  56. data/lib/hooksniff/models/list_response_message_out.rb +58 -0
  57. data/lib/hooksniff/models/message_attempt_exhausted_event.rb +53 -0
  58. data/lib/hooksniff/models/message_attempt_exhausted_event_data.rb +70 -0
  59. data/lib/hooksniff/models/message_attempt_failed_data.rb +56 -0
  60. data/lib/hooksniff/models/message_attempt_failing_event.rb +54 -0
  61. data/lib/hooksniff/models/message_attempt_failing_event_data.rb +70 -0
  62. data/lib/hooksniff/models/message_attempt_log.rb +112 -0
  63. data/lib/hooksniff/models/message_attempt_log_event.rb +53 -0
  64. data/lib/hooksniff/models/message_attempt_out.rb +96 -0
  65. data/lib/hooksniff/models/message_attempt_trigger_type.rb +33 -0
  66. data/lib/hooksniff/models/message_endpoint_out.rb +112 -0
  67. data/lib/hooksniff/models/message_in.rb +99 -0
  68. data/lib/hooksniff/models/message_out.rb +71 -0
  69. data/lib/hooksniff/models/message_status.rb +39 -0
  70. data/lib/hooksniff/models/message_status_text.rb +32 -0
  71. data/lib/hooksniff/models/ordering.rb +30 -0
  72. data/lib/hooksniff/models/status_code_class.rb +41 -0
  73. data/lib/hooksniff/operational_webhook.rb +12 -0
  74. data/lib/hooksniff/util.rb +69 -0
  75. data/lib/hooksniff/validation_error.rb +28 -0
  76. data/lib/hooksniff/version.rb +5 -0
  77. data/lib/hooksniff/webhook.rb +84 -0
  78. data/lib/hooksniff.rb +78 -0
  79. data/test/test_hooksniff.rb +86 -0
  80. metadata +131 -159
  81. data/lib/openapi_client/api/admin_api.rb +0 -452
  82. data/lib/openapi_client/api/alerts_api.rb +0 -322
  83. data/lib/openapi_client/api/analytics_api.rb +0 -208
  84. data/lib/openapi_client/api/api_keys_api.rb +0 -252
  85. data/lib/openapi_client/api/audit_log_api.rb +0 -140
  86. data/lib/openapi_client/api/auth_api.rb +0 -1080
  87. data/lib/openapi_client/api/billing_api.rb +0 -500
  88. data/lib/openapi_client/api/contact_api.rb +0 -88
  89. data/lib/openapi_client/api/custom_domains_api.rb +0 -253
  90. data/lib/openapi_client/api/customer_portal_api.rb +0 -700
  91. data/lib/openapi_client/api/delivery_details_api.rb +0 -146
  92. data/lib/openapi_client/api/devices_api.rb +0 -202
  93. data/lib/openapi_client/api/embed_api.rb +0 -128
  94. data/lib/openapi_client/api/endpoints_api.rb +0 -468
  95. data/lib/openapi_client/api/events_api.rb +0 -75
  96. data/lib/openapi_client/api/health_api.rb +0 -193
  97. data/lib/openapi_client/api/inbound_api.rb +0 -170
  98. data/lib/openapi_client/api/notifications_api.rb +0 -309
  99. data/lib/openapi_client/api/o_auth_api.rb +0 -181
  100. data/lib/openapi_client/api/outbound_ips_api.rb +0 -77
  101. data/lib/openapi_client/api/playground_api.rb +0 -143
  102. data/lib/openapi_client/api/rate_limits_api.rb +0 -252
  103. data/lib/openapi_client/api/routing_api.rb +0 -393
  104. data/lib/openapi_client/api/schemas_api.rb +0 -268
  105. data/lib/openapi_client/api/search_api.rb +0 -96
  106. data/lib/openapi_client/api/simulator_api.rb +0 -82
  107. data/lib/openapi_client/api/sso_api.rb +0 -241
  108. data/lib/openapi_client/api/stats_api.rb +0 -77
  109. data/lib/openapi_client/api/stream_api.rb +0 -88
  110. data/lib/openapi_client/api/teams_api.rb +0 -476
  111. data/lib/openapi_client/api/templates_api.rb +0 -213
  112. data/lib/openapi_client/api/transforms_api.rb +0 -368
  113. data/lib/openapi_client/api/webhooks_api.rb +0 -534
  114. data/lib/openapi_client/api_client.rb +0 -397
  115. data/lib/openapi_client/api_model_base.rb +0 -88
  116. data/lib/openapi_client/configuration.rb +0 -312
  117. data/lib/openapi_client/models/admin_revenue_get200_response_inner.rb +0 -165
  118. data/lib/openapi_client/models/admin_sdk_update_post_request.rb +0 -156
  119. data/lib/openapi_client/models/admin_users_id_plan_put_request.rb +0 -181
  120. data/lib/openapi_client/models/admin_users_id_status_put_request.rb +0 -147
  121. data/lib/openapi_client/models/alert_rule.rb +0 -237
  122. data/lib/openapi_client/models/api_key_info.rb +0 -185
  123. data/lib/openapi_client/models/apply_template_request.rb +0 -173
  124. data/lib/openapi_client/models/apply_template_response.rb +0 -156
  125. data/lib/openapi_client/models/auth2fa_enable_post200_response.rb +0 -156
  126. data/lib/openapi_client/models/auth_login_post200_response.rb +0 -104
  127. data/lib/openapi_client/models/auth_response.rb +0 -167
  128. data/lib/openapi_client/models/batch_replay_request.rb +0 -166
  129. data/lib/openapi_client/models/batch_response.rb +0 -160
  130. data/lib/openapi_client/models/batch_response_errors_inner.rb +0 -156
  131. data/lib/openapi_client/models/batch_webhook_request.rb +0 -166
  132. data/lib/openapi_client/models/billing_portal_post200_response.rb +0 -147
  133. data/lib/openapi_client/models/change_password_request.rb +0 -199
  134. data/lib/openapi_client/models/change_role_request.rb +0 -188
  135. data/lib/openapi_client/models/confirm2fa_request.rb +0 -182
  136. data/lib/openapi_client/models/contact_request.rb +0 -242
  137. data/lib/openapi_client/models/contact_response.rb +0 -156
  138. data/lib/openapi_client/models/create_alert_request.rb +0 -277
  139. data/lib/openapi_client/models/create_api_key_response.rb +0 -175
  140. data/lib/openapi_client/models/create_endpoint_request.rb +0 -288
  141. data/lib/openapi_client/models/create_team_request.rb +0 -164
  142. data/lib/openapi_client/models/create_transform_rule_request.rb +0 -216
  143. data/lib/openapi_client/models/create_webhook_request.rb +0 -201
  144. data/lib/openapi_client/models/custom_domains_post_request.rb +0 -147
  145. data/lib/openapi_client/models/customer_response.rb +0 -256
  146. data/lib/openapi_client/models/delivery.rb +0 -246
  147. data/lib/openapi_client/models/delivery_attempt.rb +0 -205
  148. data/lib/openapi_client/models/delivery_list_response.rb +0 -176
  149. data/lib/openapi_client/models/delivery_trend_response.rb +0 -158
  150. data/lib/openapi_client/models/delivery_trend_response_buckets_inner.rb +0 -174
  151. data/lib/openapi_client/models/device_token_response.rb +0 -174
  152. data/lib/openapi_client/models/disable2fa_request.rb +0 -164
  153. data/lib/openapi_client/models/enable2fa_request.rb +0 -164
  154. data/lib/openapi_client/models/endpoint.rb +0 -321
  155. data/lib/openapi_client/models/endpoint_health.rb +0 -183
  156. data/lib/openapi_client/models/endpoints_endpoint_id_transforms_test_post_request.rb +0 -156
  157. data/lib/openapi_client/models/endpoints_id_rotate_secret_post200_response.rb +0 -156
  158. data/lib/openapi_client/models/error.rb +0 -165
  159. data/lib/openapi_client/models/forgot_password_request.rb +0 -164
  160. data/lib/openapi_client/models/invite_request.rb +0 -207
  161. data/lib/openapi_client/models/invoice_response.rb +0 -183
  162. data/lib/openapi_client/models/latency_trend_response.rb +0 -167
  163. data/lib/openapi_client/models/latency_trend_response_buckets_inner.rb +0 -165
  164. data/lib/openapi_client/models/login_request.rb +0 -190
  165. data/lib/openapi_client/models/notification.rb +0 -193
  166. data/lib/openapi_client/models/notification_list_response.rb +0 -167
  167. data/lib/openapi_client/models/notification_preferences.rb +0 -201
  168. data/lib/openapi_client/models/notifications_unread_count_get200_response.rb +0 -147
  169. data/lib/openapi_client/models/outbound_ips_response.rb +0 -158
  170. data/lib/openapi_client/models/paginated_users.rb +0 -176
  171. data/lib/openapi_client/models/playground_get200_response.rb +0 -160
  172. data/lib/openapi_client/models/portal_notifications_put200_response.rb +0 -156
  173. data/lib/openapi_client/models/portal_profile.rb +0 -184
  174. data/lib/openapi_client/models/refresh_token_request.rb +0 -164
  175. data/lib/openapi_client/models/register_device_request.rb +0 -208
  176. data/lib/openapi_client/models/register_request.rb +0 -201
  177. data/lib/openapi_client/models/register_schema_request.rb +0 -191
  178. data/lib/openapi_client/models/resend_verification_request.rb +0 -164
  179. data/lib/openapi_client/models/reset_password_request.rb +0 -199
  180. data/lib/openapi_client/models/retry_policy.rb +0 -216
  181. data/lib/openapi_client/models/routing_info.rb +0 -193
  182. data/lib/openapi_client/models/search_result.rb +0 -158
  183. data/lib/openapi_client/models/simulator_post_request.rb +0 -165
  184. data/lib/openapi_client/models/sso_config_post_request.rb +0 -190
  185. data/lib/openapi_client/models/stats_response.rb +0 -210
  186. data/lib/openapi_client/models/stream_params.rb +0 -201
  187. data/lib/openapi_client/models/subscription_response.rb +0 -201
  188. data/lib/openapi_client/models/success_rate_response.rb +0 -183
  189. data/lib/openapi_client/models/system_stats.rb +0 -185
  190. data/lib/openapi_client/models/system_stats_plan_breakdown_inner.rb +0 -156
  191. data/lib/openapi_client/models/system_status.rb +0 -210
  192. data/lib/openapi_client/models/system_status_components_inner.rb +0 -184
  193. data/lib/openapi_client/models/team.rb +0 -165
  194. data/lib/openapi_client/models/team_detail_response.rb +0 -169
  195. data/lib/openapi_client/models/team_invite.rb +0 -174
  196. data/lib/openapi_client/models/team_member.rb +0 -193
  197. data/lib/openapi_client/models/test_webhook_request.rb +0 -199
  198. data/lib/openapi_client/models/test_webhook_response.rb +0 -174
  199. data/lib/openapi_client/models/transform_rule.rb +0 -201
  200. data/lib/openapi_client/models/two_factor_required_response.rb +0 -165
  201. data/lib/openapi_client/models/update_endpoint_request.rb +0 -278
  202. data/lib/openapi_client/models/update_notification_preferences.rb +0 -195
  203. data/lib/openapi_client/models/update_profile_request.rb +0 -190
  204. data/lib/openapi_client/models/update_routing_request.rb +0 -190
  205. data/lib/openapi_client/models/upgrade_request.rb +0 -209
  206. data/lib/openapi_client/models/upgrade_response.rb +0 -166
  207. data/lib/openapi_client/models/usage_response.rb +0 -201
  208. data/lib/openapi_client/models/user_summary.rb +0 -193
  209. data/lib/openapi_client/models/validate_event_request.rb +0 -164
  210. data/lib/openapi_client/models/verify2fa_request.rb +0 -208
  211. data/lib/openapi_client/models/verify_email_request.rb +0 -164
  212. data/lib/openapi_client/models/webhook_template.rb +0 -183
  213. data/lib/openapi_client/version.rb +0 -15
  214. data/lib/openapi_client.rb +0 -169
@@ -1,199 +0,0 @@
1
- =begin
2
- #HookSniff API
3
-
4
- #Webhook delivery, monitoring, and management API. All endpoints under `/v1` require authentication via `Authorization: Bearer <api_key>` header unless marked as **Public**.
5
-
6
- The version of the OpenAPI document: 1.0.0
7
- Contact: support@hooksniff.vercel.app
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.22.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module OpenapiClient
17
- class TestWebhookRequest < ApiModelBase
18
- attr_accessor :endpoint_id
19
-
20
- attr_accessor :payload
21
-
22
- attr_accessor :event
23
-
24
- # Attribute mapping from ruby-style variable name to JSON key.
25
- def self.attribute_map
26
- {
27
- :'endpoint_id' => :'endpoint_id',
28
- :'payload' => :'payload',
29
- :'event' => :'event'
30
- }
31
- end
32
-
33
- # Returns attribute mapping this model knows about
34
- def self.acceptable_attribute_map
35
- attribute_map
36
- end
37
-
38
- # Returns all the JSON keys this model knows about
39
- def self.acceptable_attributes
40
- acceptable_attribute_map.values
41
- end
42
-
43
- # Attribute type mapping.
44
- def self.openapi_types
45
- {
46
- :'endpoint_id' => :'String',
47
- :'payload' => :'Object',
48
- :'event' => :'String'
49
- }
50
- end
51
-
52
- # List of attributes with nullable: true
53
- def self.openapi_nullable
54
- Set.new([
55
- ])
56
- end
57
-
58
- # Initializes the object
59
- # @param [Hash] attributes Model attributes in the form of hash
60
- def initialize(attributes = {})
61
- if (!attributes.is_a?(Hash))
62
- fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::TestWebhookRequest` initialize method"
63
- end
64
-
65
- # check to see if the attribute exists and convert string to symbol for hash key
66
- acceptable_attribute_map = self.class.acceptable_attribute_map
67
- attributes = attributes.each_with_object({}) { |(k, v), h|
68
- if (!acceptable_attribute_map.key?(k.to_sym))
69
- fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestWebhookRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
- end
71
- h[k.to_sym] = v
72
- }
73
-
74
- if attributes.key?(:'endpoint_id')
75
- self.endpoint_id = attributes[:'endpoint_id']
76
- else
77
- self.endpoint_id = nil
78
- end
79
-
80
- if attributes.key?(:'payload')
81
- self.payload = attributes[:'payload']
82
- else
83
- self.payload = nil
84
- end
85
-
86
- if attributes.key?(:'event')
87
- self.event = attributes[:'event']
88
- end
89
- end
90
-
91
- # Show invalid properties with the reasons. Usually used together with valid?
92
- # @return Array for valid properties with the reasons
93
- def list_invalid_properties
94
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
- invalid_properties = Array.new
96
- if @endpoint_id.nil?
97
- invalid_properties.push('invalid value for "endpoint_id", endpoint_id cannot be nil.')
98
- end
99
-
100
- if @payload.nil?
101
- invalid_properties.push('invalid value for "payload", payload cannot be nil.')
102
- end
103
-
104
- invalid_properties
105
- end
106
-
107
- # Check to see if the all the properties in the model are valid
108
- # @return true if the model is valid
109
- def valid?
110
- warn '[DEPRECATED] the `valid?` method is obsolete'
111
- return false if @endpoint_id.nil?
112
- return false if @payload.nil?
113
- true
114
- end
115
-
116
- # Custom attribute writer method with validation
117
- # @param [Object] endpoint_id Value to be assigned
118
- def endpoint_id=(endpoint_id)
119
- if endpoint_id.nil?
120
- fail ArgumentError, 'endpoint_id cannot be nil'
121
- end
122
-
123
- @endpoint_id = endpoint_id
124
- end
125
-
126
- # Custom attribute writer method with validation
127
- # @param [Object] payload Value to be assigned
128
- def payload=(payload)
129
- if payload.nil?
130
- fail ArgumentError, 'payload cannot be nil'
131
- end
132
-
133
- @payload = payload
134
- end
135
-
136
- # Checks equality by comparing each attribute.
137
- # @param [Object] Object to be compared
138
- def ==(o)
139
- return true if self.equal?(o)
140
- self.class == o.class &&
141
- endpoint_id == o.endpoint_id &&
142
- payload == o.payload &&
143
- event == o.event
144
- end
145
-
146
- # @see the `==` method
147
- # @param [Object] Object to be compared
148
- def eql?(o)
149
- self == o
150
- end
151
-
152
- # Calculates hash code according to all attributes.
153
- # @return [Integer] Hash code
154
- def hash
155
- [endpoint_id, payload, event].hash
156
- end
157
-
158
- # Builds the object from hash
159
- # @param [Hash] attributes Model attributes in the form of hash
160
- # @return [Object] Returns the model itself
161
- def self.build_from_hash(attributes)
162
- return nil unless attributes.is_a?(Hash)
163
- attributes = attributes.transform_keys(&:to_sym)
164
- transformed_hash = {}
165
- openapi_types.each_pair do |key, type|
166
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
167
- transformed_hash["#{key}"] = nil
168
- elsif type =~ /\AArray<(.*)>/i
169
- # check to ensure the input is an array given that the attribute
170
- # is documented as an array but the input is not
171
- if attributes[attribute_map[key]].is_a?(Array)
172
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
173
- end
174
- elsif !attributes[attribute_map[key]].nil?
175
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
176
- end
177
- end
178
- new(transformed_hash)
179
- end
180
-
181
- # Returns the object in the form of hash
182
- # @return [Hash] Returns the object in the form of hash
183
- def to_hash
184
- hash = {}
185
- self.class.attribute_map.each_pair do |attr, param|
186
- value = self.send(attr)
187
- if value.nil?
188
- is_nullable = self.class.openapi_nullable.include?(attr)
189
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
- end
191
-
192
- hash[param] = _to_hash(value)
193
- end
194
- hash
195
- end
196
-
197
- end
198
-
199
- end
@@ -1,174 +0,0 @@
1
- =begin
2
- #HookSniff API
3
-
4
- #Webhook delivery, monitoring, and management API. All endpoints under `/v1` require authentication via `Authorization: Bearer <api_key>` header unless marked as **Public**.
5
-
6
- The version of the OpenAPI document: 1.0.0
7
- Contact: support@hooksniff.vercel.app
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.22.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module OpenapiClient
17
- class TestWebhookResponse < ApiModelBase
18
- attr_accessor :success
19
-
20
- attr_accessor :status_code
21
-
22
- attr_accessor :duration_ms
23
-
24
- attr_accessor :response_body
25
-
26
- # Attribute mapping from ruby-style variable name to JSON key.
27
- def self.attribute_map
28
- {
29
- :'success' => :'success',
30
- :'status_code' => :'status_code',
31
- :'duration_ms' => :'duration_ms',
32
- :'response_body' => :'response_body'
33
- }
34
- end
35
-
36
- # Returns attribute mapping this model knows about
37
- def self.acceptable_attribute_map
38
- attribute_map
39
- end
40
-
41
- # Returns all the JSON keys this model knows about
42
- def self.acceptable_attributes
43
- acceptable_attribute_map.values
44
- end
45
-
46
- # Attribute type mapping.
47
- def self.openapi_types
48
- {
49
- :'success' => :'Boolean',
50
- :'status_code' => :'Integer',
51
- :'duration_ms' => :'Integer',
52
- :'response_body' => :'String'
53
- }
54
- end
55
-
56
- # List of attributes with nullable: true
57
- def self.openapi_nullable
58
- Set.new([
59
- ])
60
- end
61
-
62
- # Initializes the object
63
- # @param [Hash] attributes Model attributes in the form of hash
64
- def initialize(attributes = {})
65
- if (!attributes.is_a?(Hash))
66
- fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::TestWebhookResponse` initialize method"
67
- end
68
-
69
- # check to see if the attribute exists and convert string to symbol for hash key
70
- acceptable_attribute_map = self.class.acceptable_attribute_map
71
- attributes = attributes.each_with_object({}) { |(k, v), h|
72
- if (!acceptable_attribute_map.key?(k.to_sym))
73
- fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TestWebhookResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
- end
75
- h[k.to_sym] = v
76
- }
77
-
78
- if attributes.key?(:'success')
79
- self.success = attributes[:'success']
80
- end
81
-
82
- if attributes.key?(:'status_code')
83
- self.status_code = attributes[:'status_code']
84
- end
85
-
86
- if attributes.key?(:'duration_ms')
87
- self.duration_ms = attributes[:'duration_ms']
88
- end
89
-
90
- if attributes.key?(:'response_body')
91
- self.response_body = attributes[:'response_body']
92
- end
93
- end
94
-
95
- # Show invalid properties with the reasons. Usually used together with valid?
96
- # @return Array for valid properties with the reasons
97
- def list_invalid_properties
98
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
- invalid_properties = Array.new
100
- invalid_properties
101
- end
102
-
103
- # Check to see if the all the properties in the model are valid
104
- # @return true if the model is valid
105
- def valid?
106
- warn '[DEPRECATED] the `valid?` method is obsolete'
107
- true
108
- end
109
-
110
- # Checks equality by comparing each attribute.
111
- # @param [Object] Object to be compared
112
- def ==(o)
113
- return true if self.equal?(o)
114
- self.class == o.class &&
115
- success == o.success &&
116
- status_code == o.status_code &&
117
- duration_ms == o.duration_ms &&
118
- response_body == o.response_body
119
- end
120
-
121
- # @see the `==` method
122
- # @param [Object] Object to be compared
123
- def eql?(o)
124
- self == o
125
- end
126
-
127
- # Calculates hash code according to all attributes.
128
- # @return [Integer] Hash code
129
- def hash
130
- [success, status_code, duration_ms, response_body].hash
131
- end
132
-
133
- # Builds the object from hash
134
- # @param [Hash] attributes Model attributes in the form of hash
135
- # @return [Object] Returns the model itself
136
- def self.build_from_hash(attributes)
137
- return nil unless attributes.is_a?(Hash)
138
- attributes = attributes.transform_keys(&:to_sym)
139
- transformed_hash = {}
140
- openapi_types.each_pair do |key, type|
141
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
142
- transformed_hash["#{key}"] = nil
143
- elsif type =~ /\AArray<(.*)>/i
144
- # check to ensure the input is an array given that the attribute
145
- # is documented as an array but the input is not
146
- if attributes[attribute_map[key]].is_a?(Array)
147
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
148
- end
149
- elsif !attributes[attribute_map[key]].nil?
150
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
151
- end
152
- end
153
- new(transformed_hash)
154
- end
155
-
156
- # Returns the object in the form of hash
157
- # @return [Hash] Returns the object in the form of hash
158
- def to_hash
159
- hash = {}
160
- self.class.attribute_map.each_pair do |attr, param|
161
- value = self.send(attr)
162
- if value.nil?
163
- is_nullable = self.class.openapi_nullable.include?(attr)
164
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
165
- end
166
-
167
- hash[param] = _to_hash(value)
168
- end
169
- hash
170
- end
171
-
172
- end
173
-
174
- end
@@ -1,201 +0,0 @@
1
- =begin
2
- #HookSniff API
3
-
4
- #Webhook delivery, monitoring, and management API. All endpoints under `/v1` require authentication via `Authorization: Bearer <api_key>` header unless marked as **Public**.
5
-
6
- The version of the OpenAPI document: 1.0.0
7
- Contact: support@hooksniff.vercel.app
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.22.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module OpenapiClient
17
- class TransformRule < ApiModelBase
18
- attr_accessor :id
19
-
20
- attr_accessor :endpoint_id
21
-
22
- attr_accessor :name
23
-
24
- attr_accessor :rule_type
25
-
26
- attr_accessor :config
27
-
28
- attr_accessor :is_active
29
-
30
- attr_accessor :created_at
31
-
32
- # Attribute mapping from ruby-style variable name to JSON key.
33
- def self.attribute_map
34
- {
35
- :'id' => :'id',
36
- :'endpoint_id' => :'endpoint_id',
37
- :'name' => :'name',
38
- :'rule_type' => :'rule_type',
39
- :'config' => :'config',
40
- :'is_active' => :'is_active',
41
- :'created_at' => :'created_at'
42
- }
43
- end
44
-
45
- # Returns attribute mapping this model knows about
46
- def self.acceptable_attribute_map
47
- attribute_map
48
- end
49
-
50
- # Returns all the JSON keys this model knows about
51
- def self.acceptable_attributes
52
- acceptable_attribute_map.values
53
- end
54
-
55
- # Attribute type mapping.
56
- def self.openapi_types
57
- {
58
- :'id' => :'String',
59
- :'endpoint_id' => :'String',
60
- :'name' => :'String',
61
- :'rule_type' => :'String',
62
- :'config' => :'Object',
63
- :'is_active' => :'Boolean',
64
- :'created_at' => :'Time'
65
- }
66
- end
67
-
68
- # List of attributes with nullable: true
69
- def self.openapi_nullable
70
- Set.new([
71
- ])
72
- end
73
-
74
- # Initializes the object
75
- # @param [Hash] attributes Model attributes in the form of hash
76
- def initialize(attributes = {})
77
- if (!attributes.is_a?(Hash))
78
- fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::TransformRule` initialize method"
79
- end
80
-
81
- # check to see if the attribute exists and convert string to symbol for hash key
82
- acceptable_attribute_map = self.class.acceptable_attribute_map
83
- attributes = attributes.each_with_object({}) { |(k, v), h|
84
- if (!acceptable_attribute_map.key?(k.to_sym))
85
- fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TransformRule`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
86
- end
87
- h[k.to_sym] = v
88
- }
89
-
90
- if attributes.key?(:'id')
91
- self.id = attributes[:'id']
92
- end
93
-
94
- if attributes.key?(:'endpoint_id')
95
- self.endpoint_id = attributes[:'endpoint_id']
96
- end
97
-
98
- if attributes.key?(:'name')
99
- self.name = attributes[:'name']
100
- end
101
-
102
- if attributes.key?(:'rule_type')
103
- self.rule_type = attributes[:'rule_type']
104
- end
105
-
106
- if attributes.key?(:'config')
107
- self.config = attributes[:'config']
108
- end
109
-
110
- if attributes.key?(:'is_active')
111
- self.is_active = attributes[:'is_active']
112
- end
113
-
114
- if attributes.key?(:'created_at')
115
- self.created_at = attributes[:'created_at']
116
- end
117
- end
118
-
119
- # Show invalid properties with the reasons. Usually used together with valid?
120
- # @return Array for valid properties with the reasons
121
- def list_invalid_properties
122
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
123
- invalid_properties = Array.new
124
- invalid_properties
125
- end
126
-
127
- # Check to see if the all the properties in the model are valid
128
- # @return true if the model is valid
129
- def valid?
130
- warn '[DEPRECATED] the `valid?` method is obsolete'
131
- true
132
- end
133
-
134
- # Checks equality by comparing each attribute.
135
- # @param [Object] Object to be compared
136
- def ==(o)
137
- return true if self.equal?(o)
138
- self.class == o.class &&
139
- id == o.id &&
140
- endpoint_id == o.endpoint_id &&
141
- name == o.name &&
142
- rule_type == o.rule_type &&
143
- config == o.config &&
144
- is_active == o.is_active &&
145
- created_at == o.created_at
146
- end
147
-
148
- # @see the `==` method
149
- # @param [Object] Object to be compared
150
- def eql?(o)
151
- self == o
152
- end
153
-
154
- # Calculates hash code according to all attributes.
155
- # @return [Integer] Hash code
156
- def hash
157
- [id, endpoint_id, name, rule_type, config, is_active, created_at].hash
158
- end
159
-
160
- # Builds the object from hash
161
- # @param [Hash] attributes Model attributes in the form of hash
162
- # @return [Object] Returns the model itself
163
- def self.build_from_hash(attributes)
164
- return nil unless attributes.is_a?(Hash)
165
- attributes = attributes.transform_keys(&:to_sym)
166
- transformed_hash = {}
167
- openapi_types.each_pair do |key, type|
168
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
169
- transformed_hash["#{key}"] = nil
170
- elsif type =~ /\AArray<(.*)>/i
171
- # check to ensure the input is an array given that the attribute
172
- # is documented as an array but the input is not
173
- if attributes[attribute_map[key]].is_a?(Array)
174
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
175
- end
176
- elsif !attributes[attribute_map[key]].nil?
177
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
178
- end
179
- end
180
- new(transformed_hash)
181
- end
182
-
183
- # Returns the object in the form of hash
184
- # @return [Hash] Returns the object in the form of hash
185
- def to_hash
186
- hash = {}
187
- self.class.attribute_map.each_pair do |attr, param|
188
- value = self.send(attr)
189
- if value.nil?
190
- is_nullable = self.class.openapi_nullable.include?(attr)
191
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
- end
193
-
194
- hash[param] = _to_hash(value)
195
- end
196
- hash
197
- end
198
-
199
- end
200
-
201
- end