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,164 +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 Enable2faRequest < ApiModelBase
18
- attr_accessor :password
19
-
20
- # Attribute mapping from ruby-style variable name to JSON key.
21
- def self.attribute_map
22
- {
23
- :'password' => :'password'
24
- }
25
- end
26
-
27
- # Returns attribute mapping this model knows about
28
- def self.acceptable_attribute_map
29
- attribute_map
30
- end
31
-
32
- # Returns all the JSON keys this model knows about
33
- def self.acceptable_attributes
34
- acceptable_attribute_map.values
35
- end
36
-
37
- # Attribute type mapping.
38
- def self.openapi_types
39
- {
40
- :'password' => :'String'
41
- }
42
- end
43
-
44
- # List of attributes with nullable: true
45
- def self.openapi_nullable
46
- Set.new([
47
- ])
48
- end
49
-
50
- # Initializes the object
51
- # @param [Hash] attributes Model attributes in the form of hash
52
- def initialize(attributes = {})
53
- if (!attributes.is_a?(Hash))
54
- fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::Enable2faRequest` initialize method"
55
- end
56
-
57
- # check to see if the attribute exists and convert string to symbol for hash key
58
- acceptable_attribute_map = self.class.acceptable_attribute_map
59
- attributes = attributes.each_with_object({}) { |(k, v), h|
60
- if (!acceptable_attribute_map.key?(k.to_sym))
61
- fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Enable2faRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
- end
63
- h[k.to_sym] = v
64
- }
65
-
66
- if attributes.key?(:'password')
67
- self.password = attributes[:'password']
68
- else
69
- self.password = nil
70
- end
71
- end
72
-
73
- # Show invalid properties with the reasons. Usually used together with valid?
74
- # @return Array for valid properties with the reasons
75
- def list_invalid_properties
76
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
- invalid_properties = Array.new
78
- if @password.nil?
79
- invalid_properties.push('invalid value for "password", password cannot be nil.')
80
- end
81
-
82
- invalid_properties
83
- end
84
-
85
- # Check to see if the all the properties in the model are valid
86
- # @return true if the model is valid
87
- def valid?
88
- warn '[DEPRECATED] the `valid?` method is obsolete'
89
- return false if @password.nil?
90
- true
91
- end
92
-
93
- # Custom attribute writer method with validation
94
- # @param [Object] password Value to be assigned
95
- def password=(password)
96
- if password.nil?
97
- fail ArgumentError, 'password cannot be nil'
98
- end
99
-
100
- @password = password
101
- end
102
-
103
- # Checks equality by comparing each attribute.
104
- # @param [Object] Object to be compared
105
- def ==(o)
106
- return true if self.equal?(o)
107
- self.class == o.class &&
108
- password == o.password
109
- end
110
-
111
- # @see the `==` method
112
- # @param [Object] Object to be compared
113
- def eql?(o)
114
- self == o
115
- end
116
-
117
- # Calculates hash code according to all attributes.
118
- # @return [Integer] Hash code
119
- def hash
120
- [password].hash
121
- end
122
-
123
- # Builds the object from hash
124
- # @param [Hash] attributes Model attributes in the form of hash
125
- # @return [Object] Returns the model itself
126
- def self.build_from_hash(attributes)
127
- return nil unless attributes.is_a?(Hash)
128
- attributes = attributes.transform_keys(&:to_sym)
129
- transformed_hash = {}
130
- openapi_types.each_pair do |key, type|
131
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
- transformed_hash["#{key}"] = nil
133
- elsif type =~ /\AArray<(.*)>/i
134
- # check to ensure the input is an array given that the attribute
135
- # is documented as an array but the input is not
136
- if attributes[attribute_map[key]].is_a?(Array)
137
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
- end
139
- elsif !attributes[attribute_map[key]].nil?
140
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
- end
142
- end
143
- new(transformed_hash)
144
- end
145
-
146
- # Returns the object in the form of hash
147
- # @return [Hash] Returns the object in the form of hash
148
- def to_hash
149
- hash = {}
150
- self.class.attribute_map.each_pair do |attr, param|
151
- value = self.send(attr)
152
- if value.nil?
153
- is_nullable = self.class.openapi_nullable.include?(attr)
154
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
155
- end
156
-
157
- hash[param] = _to_hash(value)
158
- end
159
- hash
160
- end
161
-
162
- end
163
-
164
- end
@@ -1,321 +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 Endpoint < ApiModelBase
18
- attr_accessor :id
19
-
20
- attr_accessor :url
21
-
22
- attr_accessor :description
23
-
24
- attr_accessor :is_active
25
-
26
- attr_accessor :retry_policy
27
-
28
- attr_accessor :created_at
29
-
30
- # CIDR blocks or exact IPs
31
- attr_accessor :allowed_ips
32
-
33
- # Wildcard patterns (e.g. \"order.*\")
34
- attr_accessor :event_filter
35
-
36
- attr_accessor :custom_headers
37
-
38
- attr_accessor :routing_strategy
39
-
40
- attr_accessor :fallback_url
41
-
42
- attr_accessor :avg_response_ms
43
-
44
- attr_accessor :failure_streak
45
-
46
- attr_accessor :format
47
-
48
- class EnumAttributeValidator
49
- attr_reader :datatype
50
- attr_reader :allowable_values
51
-
52
- def initialize(datatype, allowable_values)
53
- @allowable_values = allowable_values.map do |value|
54
- case datatype.to_s
55
- when /Integer/i
56
- value.to_i
57
- when /Float/i
58
- value.to_f
59
- else
60
- value
61
- end
62
- end
63
- end
64
-
65
- def valid?(value)
66
- !value || allowable_values.include?(value)
67
- end
68
- end
69
-
70
- # Attribute mapping from ruby-style variable name to JSON key.
71
- def self.attribute_map
72
- {
73
- :'id' => :'id',
74
- :'url' => :'url',
75
- :'description' => :'description',
76
- :'is_active' => :'is_active',
77
- :'retry_policy' => :'retry_policy',
78
- :'created_at' => :'created_at',
79
- :'allowed_ips' => :'allowed_ips',
80
- :'event_filter' => :'event_filter',
81
- :'custom_headers' => :'custom_headers',
82
- :'routing_strategy' => :'routing_strategy',
83
- :'fallback_url' => :'fallback_url',
84
- :'avg_response_ms' => :'avg_response_ms',
85
- :'failure_streak' => :'failure_streak',
86
- :'format' => :'format'
87
- }
88
- end
89
-
90
- # Returns attribute mapping this model knows about
91
- def self.acceptable_attribute_map
92
- attribute_map
93
- end
94
-
95
- # Returns all the JSON keys this model knows about
96
- def self.acceptable_attributes
97
- acceptable_attribute_map.values
98
- end
99
-
100
- # Attribute type mapping.
101
- def self.openapi_types
102
- {
103
- :'id' => :'String',
104
- :'url' => :'String',
105
- :'description' => :'String',
106
- :'is_active' => :'Boolean',
107
- :'retry_policy' => :'RetryPolicy',
108
- :'created_at' => :'Time',
109
- :'allowed_ips' => :'Array<String>',
110
- :'event_filter' => :'Array<String>',
111
- :'custom_headers' => :'Object',
112
- :'routing_strategy' => :'String',
113
- :'fallback_url' => :'String',
114
- :'avg_response_ms' => :'Integer',
115
- :'failure_streak' => :'Integer',
116
- :'format' => :'String'
117
- }
118
- end
119
-
120
- # List of attributes with nullable: true
121
- def self.openapi_nullable
122
- Set.new([
123
- :'description',
124
- :'allowed_ips',
125
- :'event_filter',
126
- :'custom_headers',
127
- :'fallback_url',
128
- ])
129
- end
130
-
131
- # Initializes the object
132
- # @param [Hash] attributes Model attributes in the form of hash
133
- def initialize(attributes = {})
134
- if (!attributes.is_a?(Hash))
135
- fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::Endpoint` initialize method"
136
- end
137
-
138
- # check to see if the attribute exists and convert string to symbol for hash key
139
- acceptable_attribute_map = self.class.acceptable_attribute_map
140
- attributes = attributes.each_with_object({}) { |(k, v), h|
141
- if (!acceptable_attribute_map.key?(k.to_sym))
142
- fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Endpoint`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
143
- end
144
- h[k.to_sym] = v
145
- }
146
-
147
- if attributes.key?(:'id')
148
- self.id = attributes[:'id']
149
- end
150
-
151
- if attributes.key?(:'url')
152
- self.url = attributes[:'url']
153
- end
154
-
155
- if attributes.key?(:'description')
156
- self.description = attributes[:'description']
157
- end
158
-
159
- if attributes.key?(:'is_active')
160
- self.is_active = attributes[:'is_active']
161
- end
162
-
163
- if attributes.key?(:'retry_policy')
164
- self.retry_policy = attributes[:'retry_policy']
165
- end
166
-
167
- if attributes.key?(:'created_at')
168
- self.created_at = attributes[:'created_at']
169
- end
170
-
171
- if attributes.key?(:'allowed_ips')
172
- if (value = attributes[:'allowed_ips']).is_a?(Array)
173
- self.allowed_ips = value
174
- end
175
- end
176
-
177
- if attributes.key?(:'event_filter')
178
- if (value = attributes[:'event_filter']).is_a?(Array)
179
- self.event_filter = value
180
- end
181
- end
182
-
183
- if attributes.key?(:'custom_headers')
184
- self.custom_headers = attributes[:'custom_headers']
185
- end
186
-
187
- if attributes.key?(:'routing_strategy')
188
- self.routing_strategy = attributes[:'routing_strategy']
189
- end
190
-
191
- if attributes.key?(:'fallback_url')
192
- self.fallback_url = attributes[:'fallback_url']
193
- end
194
-
195
- if attributes.key?(:'avg_response_ms')
196
- self.avg_response_ms = attributes[:'avg_response_ms']
197
- end
198
-
199
- if attributes.key?(:'failure_streak')
200
- self.failure_streak = attributes[:'failure_streak']
201
- end
202
-
203
- if attributes.key?(:'format')
204
- self.format = attributes[:'format']
205
- end
206
- end
207
-
208
- # Show invalid properties with the reasons. Usually used together with valid?
209
- # @return Array for valid properties with the reasons
210
- def list_invalid_properties
211
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
212
- invalid_properties = Array.new
213
- invalid_properties
214
- end
215
-
216
- # Check to see if the all the properties in the model are valid
217
- # @return true if the model is valid
218
- def valid?
219
- warn '[DEPRECATED] the `valid?` method is obsolete'
220
- routing_strategy_validator = EnumAttributeValidator.new('String', ["round-robin", "latency", "failover"])
221
- return false unless routing_strategy_validator.valid?(@routing_strategy)
222
- format_validator = EnumAttributeValidator.new('String', ["standard", "cloudevents"])
223
- return false unless format_validator.valid?(@format)
224
- true
225
- end
226
-
227
- # Custom attribute writer method checking allowed values (enum).
228
- # @param [Object] routing_strategy Object to be assigned
229
- def routing_strategy=(routing_strategy)
230
- validator = EnumAttributeValidator.new('String', ["round-robin", "latency", "failover"])
231
- unless validator.valid?(routing_strategy)
232
- fail ArgumentError, "invalid value for \"routing_strategy\", must be one of #{validator.allowable_values}."
233
- end
234
- @routing_strategy = routing_strategy
235
- end
236
-
237
- # Custom attribute writer method checking allowed values (enum).
238
- # @param [Object] format Object to be assigned
239
- def format=(format)
240
- validator = EnumAttributeValidator.new('String', ["standard", "cloudevents"])
241
- unless validator.valid?(format)
242
- fail ArgumentError, "invalid value for \"format\", must be one of #{validator.allowable_values}."
243
- end
244
- @format = format
245
- end
246
-
247
- # Checks equality by comparing each attribute.
248
- # @param [Object] Object to be compared
249
- def ==(o)
250
- return true if self.equal?(o)
251
- self.class == o.class &&
252
- id == o.id &&
253
- url == o.url &&
254
- description == o.description &&
255
- is_active == o.is_active &&
256
- retry_policy == o.retry_policy &&
257
- created_at == o.created_at &&
258
- allowed_ips == o.allowed_ips &&
259
- event_filter == o.event_filter &&
260
- custom_headers == o.custom_headers &&
261
- routing_strategy == o.routing_strategy &&
262
- fallback_url == o.fallback_url &&
263
- avg_response_ms == o.avg_response_ms &&
264
- failure_streak == o.failure_streak &&
265
- format == o.format
266
- end
267
-
268
- # @see the `==` method
269
- # @param [Object] Object to be compared
270
- def eql?(o)
271
- self == o
272
- end
273
-
274
- # Calculates hash code according to all attributes.
275
- # @return [Integer] Hash code
276
- def hash
277
- [id, url, description, is_active, retry_policy, created_at, allowed_ips, event_filter, custom_headers, routing_strategy, fallback_url, avg_response_ms, failure_streak, format].hash
278
- end
279
-
280
- # Builds the object from hash
281
- # @param [Hash] attributes Model attributes in the form of hash
282
- # @return [Object] Returns the model itself
283
- def self.build_from_hash(attributes)
284
- return nil unless attributes.is_a?(Hash)
285
- attributes = attributes.transform_keys(&:to_sym)
286
- transformed_hash = {}
287
- openapi_types.each_pair do |key, type|
288
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
289
- transformed_hash["#{key}"] = nil
290
- elsif type =~ /\AArray<(.*)>/i
291
- # check to ensure the input is an array given that the attribute
292
- # is documented as an array but the input is not
293
- if attributes[attribute_map[key]].is_a?(Array)
294
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
295
- end
296
- elsif !attributes[attribute_map[key]].nil?
297
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
298
- end
299
- end
300
- new(transformed_hash)
301
- end
302
-
303
- # Returns the object in the form of hash
304
- # @return [Hash] Returns the object in the form of hash
305
- def to_hash
306
- hash = {}
307
- self.class.attribute_map.each_pair do |attr, param|
308
- value = self.send(attr)
309
- if value.nil?
310
- is_nullable = self.class.openapi_nullable.include?(attr)
311
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
312
- end
313
-
314
- hash[param] = _to_hash(value)
315
- end
316
- hash
317
- end
318
-
319
- end
320
-
321
- end
@@ -1,183 +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 EndpointHealth < ApiModelBase
18
- attr_accessor :endpoint_id
19
-
20
- attr_accessor :is_healthy
21
-
22
- attr_accessor :failure_streak
23
-
24
- attr_accessor :avg_response_ms
25
-
26
- attr_accessor :last_failure_at
27
-
28
- # Attribute mapping from ruby-style variable name to JSON key.
29
- def self.attribute_map
30
- {
31
- :'endpoint_id' => :'endpoint_id',
32
- :'is_healthy' => :'is_healthy',
33
- :'failure_streak' => :'failure_streak',
34
- :'avg_response_ms' => :'avg_response_ms',
35
- :'last_failure_at' => :'last_failure_at'
36
- }
37
- end
38
-
39
- # Returns attribute mapping this model knows about
40
- def self.acceptable_attribute_map
41
- attribute_map
42
- end
43
-
44
- # Returns all the JSON keys this model knows about
45
- def self.acceptable_attributes
46
- acceptable_attribute_map.values
47
- end
48
-
49
- # Attribute type mapping.
50
- def self.openapi_types
51
- {
52
- :'endpoint_id' => :'String',
53
- :'is_healthy' => :'Boolean',
54
- :'failure_streak' => :'Integer',
55
- :'avg_response_ms' => :'Integer',
56
- :'last_failure_at' => :'Time'
57
- }
58
- end
59
-
60
- # List of attributes with nullable: true
61
- def self.openapi_nullable
62
- Set.new([
63
- ])
64
- end
65
-
66
- # Initializes the object
67
- # @param [Hash] attributes Model attributes in the form of hash
68
- def initialize(attributes = {})
69
- if (!attributes.is_a?(Hash))
70
- fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::EndpointHealth` initialize method"
71
- end
72
-
73
- # check to see if the attribute exists and convert string to symbol for hash key
74
- acceptable_attribute_map = self.class.acceptable_attribute_map
75
- attributes = attributes.each_with_object({}) { |(k, v), h|
76
- if (!acceptable_attribute_map.key?(k.to_sym))
77
- fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::EndpointHealth`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
78
- end
79
- h[k.to_sym] = v
80
- }
81
-
82
- if attributes.key?(:'endpoint_id')
83
- self.endpoint_id = attributes[:'endpoint_id']
84
- end
85
-
86
- if attributes.key?(:'is_healthy')
87
- self.is_healthy = attributes[:'is_healthy']
88
- end
89
-
90
- if attributes.key?(:'failure_streak')
91
- self.failure_streak = attributes[:'failure_streak']
92
- end
93
-
94
- if attributes.key?(:'avg_response_ms')
95
- self.avg_response_ms = attributes[:'avg_response_ms']
96
- end
97
-
98
- if attributes.key?(:'last_failure_at')
99
- self.last_failure_at = attributes[:'last_failure_at']
100
- end
101
- end
102
-
103
- # Show invalid properties with the reasons. Usually used together with valid?
104
- # @return Array for valid properties with the reasons
105
- def list_invalid_properties
106
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
107
- invalid_properties = Array.new
108
- invalid_properties
109
- end
110
-
111
- # Check to see if the all the properties in the model are valid
112
- # @return true if the model is valid
113
- def valid?
114
- warn '[DEPRECATED] the `valid?` method is obsolete'
115
- true
116
- end
117
-
118
- # Checks equality by comparing each attribute.
119
- # @param [Object] Object to be compared
120
- def ==(o)
121
- return true if self.equal?(o)
122
- self.class == o.class &&
123
- endpoint_id == o.endpoint_id &&
124
- is_healthy == o.is_healthy &&
125
- failure_streak == o.failure_streak &&
126
- avg_response_ms == o.avg_response_ms &&
127
- last_failure_at == o.last_failure_at
128
- end
129
-
130
- # @see the `==` method
131
- # @param [Object] Object to be compared
132
- def eql?(o)
133
- self == o
134
- end
135
-
136
- # Calculates hash code according to all attributes.
137
- # @return [Integer] Hash code
138
- def hash
139
- [endpoint_id, is_healthy, failure_streak, avg_response_ms, last_failure_at].hash
140
- end
141
-
142
- # Builds the object from hash
143
- # @param [Hash] attributes Model attributes in the form of hash
144
- # @return [Object] Returns the model itself
145
- def self.build_from_hash(attributes)
146
- return nil unless attributes.is_a?(Hash)
147
- attributes = attributes.transform_keys(&:to_sym)
148
- transformed_hash = {}
149
- openapi_types.each_pair do |key, type|
150
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
151
- transformed_hash["#{key}"] = nil
152
- elsif type =~ /\AArray<(.*)>/i
153
- # check to ensure the input is an array given that the attribute
154
- # is documented as an array but the input is not
155
- if attributes[attribute_map[key]].is_a?(Array)
156
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
157
- end
158
- elsif !attributes[attribute_map[key]].nil?
159
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
160
- end
161
- end
162
- new(transformed_hash)
163
- end
164
-
165
- # Returns the object in the form of hash
166
- # @return [Hash] Returns the object in the form of hash
167
- def to_hash
168
- hash = {}
169
- self.class.attribute_map.each_pair do |attr, param|
170
- value = self.send(attr)
171
- if value.nil?
172
- is_nullable = self.class.openapi_nullable.include?(attr)
173
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
174
- end
175
-
176
- hash[param] = _to_hash(value)
177
- end
178
- hash
179
- end
180
-
181
- end
182
-
183
- end