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