hooksniff 0.3.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) 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/message.rb +48 -0
  12. data/lib/hooksniff/api/message_attempt.rb +38 -0
  13. data/lib/hooksniff/api/statistics.rb +37 -0
  14. data/lib/{openapi_client → hooksniff}/api_error.rb +8 -18
  15. data/lib/hooksniff/errors.rb +129 -0
  16. data/lib/hooksniff/hooksniff.rb +36 -0
  17. data/lib/hooksniff/hooksniff_http_client.rb +128 -0
  18. data/lib/hooksniff/http_error_out.rb +18 -0
  19. data/lib/hooksniff/http_validation_error.rb +18 -0
  20. data/lib/hooksniff/internal.rb +7 -0
  21. data/lib/hooksniff/models/aggregate_event_types_out.rb +59 -0
  22. data/lib/hooksniff/models/endpoint_created_event.rb +50 -0
  23. data/lib/hooksniff/models/endpoint_created_event_data.rb +63 -0
  24. data/lib/hooksniff/models/endpoint_deleted_event.rb +50 -0
  25. data/lib/hooksniff/models/endpoint_deleted_event_data.rb +63 -0
  26. data/lib/hooksniff/models/endpoint_disabled_event.rb +53 -0
  27. data/lib/hooksniff/models/endpoint_disabled_event_data.rb +69 -0
  28. data/lib/hooksniff/models/endpoint_enabled_event.rb +50 -0
  29. data/lib/hooksniff/models/endpoint_enabled_event_data.rb +63 -0
  30. data/lib/hooksniff/models/endpoint_headers_in.rb +46 -0
  31. data/lib/hooksniff/models/endpoint_headers_out.rb +52 -0
  32. data/lib/hooksniff/models/endpoint_headers_patch_in.rb +53 -0
  33. data/lib/hooksniff/models/endpoint_in.rb +102 -0
  34. data/lib/hooksniff/models/endpoint_out.rb +104 -0
  35. data/lib/hooksniff/models/endpoint_patch.rb +97 -0
  36. data/lib/hooksniff/models/endpoint_secret_out.rb +50 -0
  37. data/lib/hooksniff/models/endpoint_secret_rotate_in.rb +53 -0
  38. data/lib/hooksniff/models/endpoint_update.rb +90 -0
  39. data/lib/hooksniff/models/endpoint_updated_event.rb +50 -0
  40. data/lib/hooksniff/models/endpoint_updated_event_data.rb +63 -0
  41. data/lib/hooksniff/models/event_in.rb +50 -0
  42. data/lib/hooksniff/models/event_out.rb +53 -0
  43. data/lib/hooksniff/models/event_type_in.rb +80 -0
  44. data/lib/hooksniff/models/event_type_out.rb +87 -0
  45. data/lib/hooksniff/models/event_type_patch.rb +66 -0
  46. data/lib/hooksniff/models/event_type_update.rb +67 -0
  47. data/lib/hooksniff/models/list_response_endpoint_out.rb +58 -0
  48. data/lib/hooksniff/models/list_response_event_type_out.rb +58 -0
  49. data/lib/hooksniff/models/list_response_message_attempt_out.rb +58 -0
  50. data/lib/hooksniff/models/list_response_message_out.rb +58 -0
  51. data/lib/hooksniff/models/message_attempt_exhausted_event.rb +53 -0
  52. data/lib/hooksniff/models/message_attempt_exhausted_event_data.rb +70 -0
  53. data/lib/hooksniff/models/message_attempt_failed_data.rb +56 -0
  54. data/lib/hooksniff/models/message_attempt_failing_event.rb +54 -0
  55. data/lib/hooksniff/models/message_attempt_failing_event_data.rb +70 -0
  56. data/lib/hooksniff/models/message_attempt_log.rb +112 -0
  57. data/lib/hooksniff/models/message_attempt_log_event.rb +53 -0
  58. data/lib/hooksniff/models/message_attempt_out.rb +96 -0
  59. data/lib/hooksniff/models/message_attempt_recovered_event.rb +53 -0
  60. data/lib/hooksniff/models/message_attempt_recovered_event_data.rb +70 -0
  61. data/lib/hooksniff/models/message_attempt_trigger_type.rb +33 -0
  62. data/lib/hooksniff/models/message_endpoint_out.rb +112 -0
  63. data/lib/hooksniff/models/message_in.rb +100 -0
  64. data/lib/hooksniff/models/message_out.rb +71 -0
  65. data/lib/hooksniff/models/message_status.rb +39 -0
  66. data/lib/hooksniff/models/message_status_text.rb +32 -0
  67. data/lib/hooksniff/models/ordering.rb +30 -0
  68. data/lib/hooksniff/models/status_code_class.rb +41 -0
  69. data/lib/hooksniff/util.rb +69 -0
  70. data/lib/hooksniff/validation_error.rb +28 -0
  71. data/lib/hooksniff/version.rb +5 -0
  72. data/lib/hooksniff/webhook.rb +84 -0
  73. data/lib/hooksniff.rb +78 -0
  74. data/test/test_hooksniff.rb +86 -0
  75. metadata +127 -163
  76. data/lib/openapi_client/api/admin_api.rb +0 -452
  77. data/lib/openapi_client/api/alerts_api.rb +0 -322
  78. data/lib/openapi_client/api/analytics_api.rb +0 -208
  79. data/lib/openapi_client/api/api_keys_api.rb +0 -252
  80. data/lib/openapi_client/api/audit_log_api.rb +0 -140
  81. data/lib/openapi_client/api/auth_api.rb +0 -1080
  82. data/lib/openapi_client/api/billing_api.rb +0 -500
  83. data/lib/openapi_client/api/contact_api.rb +0 -88
  84. data/lib/openapi_client/api/custom_domains_api.rb +0 -253
  85. data/lib/openapi_client/api/customer_portal_api.rb +0 -700
  86. data/lib/openapi_client/api/delivery_details_api.rb +0 -146
  87. data/lib/openapi_client/api/devices_api.rb +0 -202
  88. data/lib/openapi_client/api/embed_api.rb +0 -128
  89. data/lib/openapi_client/api/endpoints_api.rb +0 -468
  90. data/lib/openapi_client/api/events_api.rb +0 -75
  91. data/lib/openapi_client/api/health_api.rb +0 -193
  92. data/lib/openapi_client/api/inbound_api.rb +0 -170
  93. data/lib/openapi_client/api/notifications_api.rb +0 -309
  94. data/lib/openapi_client/api/o_auth_api.rb +0 -181
  95. data/lib/openapi_client/api/outbound_ips_api.rb +0 -77
  96. data/lib/openapi_client/api/playground_api.rb +0 -143
  97. data/lib/openapi_client/api/rate_limits_api.rb +0 -252
  98. data/lib/openapi_client/api/routing_api.rb +0 -393
  99. data/lib/openapi_client/api/schemas_api.rb +0 -268
  100. data/lib/openapi_client/api/search_api.rb +0 -96
  101. data/lib/openapi_client/api/simulator_api.rb +0 -82
  102. data/lib/openapi_client/api/sso_api.rb +0 -241
  103. data/lib/openapi_client/api/stats_api.rb +0 -77
  104. data/lib/openapi_client/api/stream_api.rb +0 -88
  105. data/lib/openapi_client/api/teams_api.rb +0 -476
  106. data/lib/openapi_client/api/templates_api.rb +0 -213
  107. data/lib/openapi_client/api/transforms_api.rb +0 -368
  108. data/lib/openapi_client/api/webhooks_api.rb +0 -534
  109. data/lib/openapi_client/api_client.rb +0 -397
  110. data/lib/openapi_client/api_model_base.rb +0 -88
  111. data/lib/openapi_client/configuration.rb +0 -312
  112. data/lib/openapi_client/models/admin_revenue_get200_response_inner.rb +0 -165
  113. data/lib/openapi_client/models/admin_sdk_update_post_request.rb +0 -156
  114. data/lib/openapi_client/models/admin_users_id_plan_put_request.rb +0 -181
  115. data/lib/openapi_client/models/admin_users_id_status_put_request.rb +0 -147
  116. data/lib/openapi_client/models/alert_rule.rb +0 -237
  117. data/lib/openapi_client/models/api_key_info.rb +0 -185
  118. data/lib/openapi_client/models/apply_template_request.rb +0 -173
  119. data/lib/openapi_client/models/apply_template_response.rb +0 -156
  120. data/lib/openapi_client/models/auth2fa_enable_post200_response.rb +0 -156
  121. data/lib/openapi_client/models/auth_login_post200_response.rb +0 -104
  122. data/lib/openapi_client/models/auth_response.rb +0 -167
  123. data/lib/openapi_client/models/batch_replay_request.rb +0 -166
  124. data/lib/openapi_client/models/batch_response.rb +0 -160
  125. data/lib/openapi_client/models/batch_response_errors_inner.rb +0 -156
  126. data/lib/openapi_client/models/batch_webhook_request.rb +0 -166
  127. data/lib/openapi_client/models/billing_portal_post200_response.rb +0 -147
  128. data/lib/openapi_client/models/change_password_request.rb +0 -199
  129. data/lib/openapi_client/models/change_role_request.rb +0 -188
  130. data/lib/openapi_client/models/confirm2fa_request.rb +0 -182
  131. data/lib/openapi_client/models/contact_request.rb +0 -242
  132. data/lib/openapi_client/models/contact_response.rb +0 -156
  133. data/lib/openapi_client/models/create_alert_request.rb +0 -277
  134. data/lib/openapi_client/models/create_api_key_response.rb +0 -175
  135. data/lib/openapi_client/models/create_endpoint_request.rb +0 -288
  136. data/lib/openapi_client/models/create_team_request.rb +0 -164
  137. data/lib/openapi_client/models/create_transform_rule_request.rb +0 -216
  138. data/lib/openapi_client/models/create_webhook_request.rb +0 -201
  139. data/lib/openapi_client/models/custom_domains_post_request.rb +0 -147
  140. data/lib/openapi_client/models/customer_response.rb +0 -256
  141. data/lib/openapi_client/models/delivery.rb +0 -246
  142. data/lib/openapi_client/models/delivery_attempt.rb +0 -205
  143. data/lib/openapi_client/models/delivery_list_response.rb +0 -176
  144. data/lib/openapi_client/models/delivery_trend_response.rb +0 -158
  145. data/lib/openapi_client/models/delivery_trend_response_buckets_inner.rb +0 -174
  146. data/lib/openapi_client/models/device_token_response.rb +0 -174
  147. data/lib/openapi_client/models/disable2fa_request.rb +0 -164
  148. data/lib/openapi_client/models/enable2fa_request.rb +0 -164
  149. data/lib/openapi_client/models/endpoint.rb +0 -321
  150. data/lib/openapi_client/models/endpoint_health.rb +0 -183
  151. data/lib/openapi_client/models/endpoints_endpoint_id_transforms_test_post_request.rb +0 -156
  152. data/lib/openapi_client/models/endpoints_id_rotate_secret_post200_response.rb +0 -156
  153. data/lib/openapi_client/models/error.rb +0 -165
  154. data/lib/openapi_client/models/forgot_password_request.rb +0 -164
  155. data/lib/openapi_client/models/invite_request.rb +0 -207
  156. data/lib/openapi_client/models/invoice_response.rb +0 -183
  157. data/lib/openapi_client/models/latency_trend_response.rb +0 -167
  158. data/lib/openapi_client/models/latency_trend_response_buckets_inner.rb +0 -165
  159. data/lib/openapi_client/models/login_request.rb +0 -190
  160. data/lib/openapi_client/models/notification.rb +0 -193
  161. data/lib/openapi_client/models/notification_list_response.rb +0 -167
  162. data/lib/openapi_client/models/notification_preferences.rb +0 -201
  163. data/lib/openapi_client/models/notifications_unread_count_get200_response.rb +0 -147
  164. data/lib/openapi_client/models/outbound_ips_response.rb +0 -158
  165. data/lib/openapi_client/models/paginated_users.rb +0 -176
  166. data/lib/openapi_client/models/playground_get200_response.rb +0 -160
  167. data/lib/openapi_client/models/portal_notifications_put200_response.rb +0 -156
  168. data/lib/openapi_client/models/portal_profile.rb +0 -184
  169. data/lib/openapi_client/models/refresh_token_request.rb +0 -164
  170. data/lib/openapi_client/models/register_device_request.rb +0 -208
  171. data/lib/openapi_client/models/register_request.rb +0 -201
  172. data/lib/openapi_client/models/register_schema_request.rb +0 -191
  173. data/lib/openapi_client/models/resend_verification_request.rb +0 -164
  174. data/lib/openapi_client/models/reset_password_request.rb +0 -199
  175. data/lib/openapi_client/models/retry_policy.rb +0 -216
  176. data/lib/openapi_client/models/routing_info.rb +0 -193
  177. data/lib/openapi_client/models/search_result.rb +0 -158
  178. data/lib/openapi_client/models/simulator_post_request.rb +0 -165
  179. data/lib/openapi_client/models/sso_config_post_request.rb +0 -190
  180. data/lib/openapi_client/models/stats_response.rb +0 -210
  181. data/lib/openapi_client/models/stream_params.rb +0 -201
  182. data/lib/openapi_client/models/subscription_response.rb +0 -201
  183. data/lib/openapi_client/models/success_rate_response.rb +0 -183
  184. data/lib/openapi_client/models/system_stats.rb +0 -185
  185. data/lib/openapi_client/models/system_stats_plan_breakdown_inner.rb +0 -156
  186. data/lib/openapi_client/models/system_status.rb +0 -210
  187. data/lib/openapi_client/models/system_status_components_inner.rb +0 -184
  188. data/lib/openapi_client/models/team.rb +0 -165
  189. data/lib/openapi_client/models/team_detail_response.rb +0 -169
  190. data/lib/openapi_client/models/team_invite.rb +0 -174
  191. data/lib/openapi_client/models/team_member.rb +0 -193
  192. data/lib/openapi_client/models/test_webhook_request.rb +0 -199
  193. data/lib/openapi_client/models/test_webhook_response.rb +0 -174
  194. data/lib/openapi_client/models/transform_rule.rb +0 -201
  195. data/lib/openapi_client/models/two_factor_required_response.rb +0 -165
  196. data/lib/openapi_client/models/update_endpoint_request.rb +0 -278
  197. data/lib/openapi_client/models/update_notification_preferences.rb +0 -195
  198. data/lib/openapi_client/models/update_profile_request.rb +0 -190
  199. data/lib/openapi_client/models/update_routing_request.rb +0 -190
  200. data/lib/openapi_client/models/upgrade_request.rb +0 -209
  201. data/lib/openapi_client/models/upgrade_response.rb +0 -166
  202. data/lib/openapi_client/models/usage_response.rb +0 -201
  203. data/lib/openapi_client/models/user_summary.rb +0 -193
  204. data/lib/openapi_client/models/validate_event_request.rb +0 -164
  205. data/lib/openapi_client/models/verify2fa_request.rb +0 -208
  206. data/lib/openapi_client/models/verify_email_request.rb +0 -164
  207. data/lib/openapi_client/models/webhook_template.rb +0 -183
  208. data/lib/openapi_client/version.rb +0 -15
  209. data/lib/openapi_client.rb +0 -169
@@ -0,0 +1,97 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module HookSniff
6
+ class EndpointPatch
7
+ attr_accessor :channels
8
+ attr_accessor :description
9
+ attr_accessor :disabled
10
+ attr_accessor :filter_types
11
+ attr_accessor :metadata
12
+ # Deprecated, use `throttleRate` instead.
13
+ attr_accessor :rate_limit
14
+ # The endpoint's verification secret.
15
+ #
16
+ # Format: `base64` encoded random bytes optionally prefixed with `whsec_`.
17
+ # It is recommended to not set this and let the server generate the secret.
18
+ attr_accessor :secret
19
+ # Maximum messages per second to send to this endpoint.
20
+ #
21
+ # Outgoing messages will be throttled to this rate.
22
+ attr_accessor :throttle_rate
23
+ # The Endpoint's UID.
24
+ attr_accessor :uid
25
+ attr_accessor :url
26
+ attr_accessor :version
27
+
28
+ ALL_FIELD ||= [
29
+ "channels",
30
+ "description",
31
+ "disabled",
32
+ "filter_types",
33
+ "metadata",
34
+ "rate_limit",
35
+ "secret",
36
+ "throttle_rate",
37
+ "uid",
38
+ "url",
39
+ "version"
40
+ ].freeze
41
+ private_constant :ALL_FIELD
42
+
43
+ def initialize(attributes = {})
44
+ unless attributes.is_a?(Hash)
45
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `HookSniff::EndpointPatch` new method")
46
+ end
47
+
48
+ attributes.each do |k, v|
49
+ unless ALL_FIELD.include?(k.to_s)
50
+ fail(ArgumentError, "The field #{k} is not part of HookSniff::EndpointPatch")
51
+ end
52
+
53
+ instance_variable_set("@#{k}", v)
54
+ instance_variable_set("@__#{k}_is_defined", true)
55
+ end
56
+ end
57
+
58
+ def self.deserialize(attributes = {})
59
+ attributes = attributes.transform_keys(&:to_s)
60
+ attrs = Hash.new
61
+ attrs["channels"] = attributes["channels"]
62
+ attrs["description"] = attributes["description"]
63
+ attrs["disabled"] = attributes["disabled"]
64
+ attrs["filter_types"] = attributes["filterTypes"]
65
+ attrs["metadata"] = attributes["metadata"]
66
+ attrs["rate_limit"] = attributes["rateLimit"]
67
+ attrs["secret"] = attributes["secret"]
68
+ attrs["throttle_rate"] = attributes["throttleRate"]
69
+ attrs["uid"] = attributes["uid"]
70
+ attrs["url"] = attributes["url"]
71
+ attrs["version"] = attributes["version"]
72
+ new(attrs)
73
+ end
74
+
75
+ def serialize
76
+ out = Hash.new
77
+ out["channels"] = HookSniff::serialize_primitive(@channels) if @__channels_is_defined
78
+ out["description"] = HookSniff::serialize_primitive(@description) if @description
79
+ out["disabled"] = HookSniff::serialize_primitive(@disabled) if @disabled
80
+ out["filterTypes"] = HookSniff::serialize_primitive(@filter_types) if @__filter_types_is_defined
81
+ out["metadata"] = HookSniff::serialize_primitive(@metadata) if @metadata
82
+ out["rateLimit"] = HookSniff::serialize_primitive(@rate_limit) if @__rate_limit_is_defined
83
+ out["secret"] = HookSniff::serialize_primitive(@secret) if @__secret_is_defined
84
+ out["throttleRate"] = HookSniff::serialize_primitive(@throttle_rate) if @__throttle_rate_is_defined
85
+ out["uid"] = HookSniff::serialize_primitive(@uid) if @__uid_is_defined
86
+ out["url"] = HookSniff::serialize_primitive(@url) if @url
87
+ out["version"] = HookSniff::serialize_primitive(@version) if @version
88
+ out
89
+ end
90
+
91
+ # Serializes the object to a json string
92
+ # @return String
93
+ def to_json
94
+ JSON.dump(serialize)
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module HookSniff
6
+ class EndpointSecretOut
7
+ # The endpoint's verification secret.
8
+ #
9
+ # Format: `base64` encoded random bytes optionally prefixed with `whsec_`.
10
+ # It is recommended to not set this and let the server generate the secret.
11
+ attr_accessor :key
12
+
13
+ ALL_FIELD ||= ["key"].freeze
14
+ private_constant :ALL_FIELD
15
+
16
+ def initialize(attributes = {})
17
+ unless attributes.is_a?(Hash)
18
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `HookSniff::EndpointSecretOut` new method")
19
+ end
20
+
21
+ attributes.each do |k, v|
22
+ unless ALL_FIELD.include?(k.to_s)
23
+ fail(ArgumentError, "The field #{k} is not part of HookSniff::EndpointSecretOut")
24
+ end
25
+
26
+ instance_variable_set("@#{k}", v)
27
+ instance_variable_set("@__#{k}_is_defined", true)
28
+ end
29
+ end
30
+
31
+ def self.deserialize(attributes = {})
32
+ attributes = attributes.transform_keys(&:to_s)
33
+ attrs = Hash.new
34
+ attrs["key"] = attributes["key"]
35
+ new(attrs)
36
+ end
37
+
38
+ def serialize
39
+ out = Hash.new
40
+ out["key"] = HookSniff::serialize_primitive(@key) if @key
41
+ out
42
+ end
43
+
44
+ # Serializes the object to a json string
45
+ # @return String
46
+ def to_json
47
+ JSON.dump(serialize)
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module HookSniff
6
+ class EndpointSecretRotateIn
7
+ # The endpoint's verification secret.
8
+ #
9
+ # Format: `base64` encoded random bytes optionally prefixed with `whsec_`.
10
+ # It is recommended to not set this and let the server generate the secret.
11
+ attr_accessor :key
12
+
13
+ ALL_FIELD ||= ["key"].freeze
14
+ private_constant :ALL_FIELD
15
+
16
+ def initialize(attributes = {})
17
+ unless attributes.is_a?(Hash)
18
+ fail(
19
+ ArgumentError,
20
+ "The input argument (attributes) must be a hash in `HookSniff::EndpointSecretRotateIn` new method"
21
+ )
22
+ end
23
+
24
+ attributes.each do |k, v|
25
+ unless ALL_FIELD.include?(k.to_s)
26
+ fail(ArgumentError, "The field #{k} is not part of HookSniff::EndpointSecretRotateIn")
27
+ end
28
+
29
+ instance_variable_set("@#{k}", v)
30
+ instance_variable_set("@__#{k}_is_defined", true)
31
+ end
32
+ end
33
+
34
+ def self.deserialize(attributes = {})
35
+ attributes = attributes.transform_keys(&:to_s)
36
+ attrs = Hash.new
37
+ attrs["key"] = attributes["key"]
38
+ new(attrs)
39
+ end
40
+
41
+ def serialize
42
+ out = Hash.new
43
+ out["key"] = HookSniff::serialize_primitive(@key) if @key
44
+ out
45
+ end
46
+
47
+ # Serializes the object to a json string
48
+ # @return String
49
+ def to_json
50
+ JSON.dump(serialize)
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,90 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module HookSniff
6
+ class EndpointUpdate
7
+ # List of message channels this endpoint listens to (omit for all).
8
+ attr_accessor :channels
9
+ attr_accessor :description
10
+ attr_accessor :disabled
11
+ attr_accessor :filter_types
12
+ attr_accessor :metadata
13
+ # Deprecated, use `throttleRate` instead.
14
+ attr_accessor :rate_limit
15
+ # Maximum messages per second to send to this endpoint.
16
+ #
17
+ # Outgoing messages will be throttled to this rate.
18
+ attr_accessor :throttle_rate
19
+ # Optional unique identifier for the endpoint.
20
+ attr_accessor :uid
21
+ attr_accessor :url
22
+ attr_accessor :version
23
+
24
+ ALL_FIELD ||= [
25
+ "channels",
26
+ "description",
27
+ "disabled",
28
+ "filter_types",
29
+ "metadata",
30
+ "rate_limit",
31
+ "throttle_rate",
32
+ "uid",
33
+ "url",
34
+ "version"
35
+ ].freeze
36
+ private_constant :ALL_FIELD
37
+
38
+ def initialize(attributes = {})
39
+ unless attributes.is_a?(Hash)
40
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `HookSniff::EndpointUpdate` new method")
41
+ end
42
+
43
+ attributes.each do |k, v|
44
+ unless ALL_FIELD.include?(k.to_s)
45
+ fail(ArgumentError, "The field #{k} is not part of HookSniff::EndpointUpdate")
46
+ end
47
+
48
+ instance_variable_set("@#{k}", v)
49
+ instance_variable_set("@__#{k}_is_defined", true)
50
+ end
51
+ end
52
+
53
+ def self.deserialize(attributes = {})
54
+ attributes = attributes.transform_keys(&:to_s)
55
+ attrs = Hash.new
56
+ attrs["channels"] = attributes["channels"]
57
+ attrs["description"] = attributes["description"]
58
+ attrs["disabled"] = attributes["disabled"]
59
+ attrs["filter_types"] = attributes["filterTypes"]
60
+ attrs["metadata"] = attributes["metadata"]
61
+ attrs["rate_limit"] = attributes["rateLimit"]
62
+ attrs["throttle_rate"] = attributes["throttleRate"]
63
+ attrs["uid"] = attributes["uid"]
64
+ attrs["url"] = attributes["url"]
65
+ attrs["version"] = attributes["version"]
66
+ new(attrs)
67
+ end
68
+
69
+ def serialize
70
+ out = Hash.new
71
+ out["channels"] = HookSniff::serialize_primitive(@channels) if @channels
72
+ out["description"] = HookSniff::serialize_primitive(@description) if @description
73
+ out["disabled"] = HookSniff::serialize_primitive(@disabled) if @disabled
74
+ out["filterTypes"] = HookSniff::serialize_primitive(@filter_types) if @filter_types
75
+ out["metadata"] = HookSniff::serialize_primitive(@metadata) if @metadata
76
+ out["rateLimit"] = HookSniff::serialize_primitive(@rate_limit) if @rate_limit
77
+ out["throttleRate"] = HookSniff::serialize_primitive(@throttle_rate) if @throttle_rate
78
+ out["uid"] = HookSniff::serialize_primitive(@uid) if @uid
79
+ out["url"] = HookSniff::serialize_primitive(@url) if @url
80
+ out["version"] = HookSniff::serialize_primitive(@version) if @version
81
+ out
82
+ end
83
+
84
+ # Serializes the object to a json string
85
+ # @return String
86
+ def to_json
87
+ JSON.dump(serialize)
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module HookSniff
6
+ # Sent when an endpoint is updated.
7
+ class EndpointUpdatedEvent
8
+ attr_accessor :data
9
+ attr_accessor :type
10
+
11
+ ALL_FIELD ||= ["data", "type"].freeze
12
+ private_constant :ALL_FIELD
13
+
14
+ def initialize(attributes = {})
15
+ unless attributes.is_a?(Hash)
16
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `HookSniff::EndpointUpdatedEvent` new method")
17
+ end
18
+
19
+ attributes.each do |k, v|
20
+ unless ALL_FIELD.include?(k.to_s)
21
+ fail(ArgumentError, "The field #{k} is not part of HookSniff::EndpointUpdatedEvent")
22
+ end
23
+
24
+ instance_variable_set("@#{k}", v)
25
+ instance_variable_set("@__#{k}_is_defined", true)
26
+ end
27
+ end
28
+
29
+ def self.deserialize(attributes = {})
30
+ attributes = attributes.transform_keys(&:to_s)
31
+ attrs = Hash.new
32
+ attrs["data"] = HookSniff::EndpointUpdatedEventData.deserialize(attributes["data"])
33
+ attrs["type"] = attributes["type"]
34
+ new(attrs)
35
+ end
36
+
37
+ def serialize
38
+ out = Hash.new
39
+ out["data"] = HookSniff::serialize_schema_ref(@data) if @data
40
+ out["type"] = HookSniff::serialize_primitive(@type) if @type
41
+ out
42
+ end
43
+
44
+ # Serializes the object to a json string
45
+ # @return String
46
+ def to_json
47
+ JSON.dump(serialize)
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module HookSniff
6
+ # Sent when an endpoint is created, updated, or deleted
7
+ class EndpointUpdatedEventData
8
+ # The Application's ID.
9
+ attr_accessor :app_id
10
+ # The Application's UID.
11
+ attr_accessor :app_uid
12
+ # The Endpoint's ID.
13
+ attr_accessor :endpoint_id
14
+ # The Endpoint's UID.
15
+ attr_accessor :endpoint_uid
16
+
17
+ ALL_FIELD ||= ["app_id", "app_uid", "endpoint_id", "endpoint_uid"].freeze
18
+ private_constant :ALL_FIELD
19
+
20
+ def initialize(attributes = {})
21
+ unless attributes.is_a?(Hash)
22
+ fail(
23
+ ArgumentError,
24
+ "The input argument (attributes) must be a hash in `HookSniff::EndpointUpdatedEventData` new method"
25
+ )
26
+ end
27
+
28
+ attributes.each do |k, v|
29
+ unless ALL_FIELD.include?(k.to_s)
30
+ fail(ArgumentError, "The field #{k} is not part of HookSniff::EndpointUpdatedEventData")
31
+ end
32
+
33
+ instance_variable_set("@#{k}", v)
34
+ instance_variable_set("@__#{k}_is_defined", true)
35
+ end
36
+ end
37
+
38
+ def self.deserialize(attributes = {})
39
+ attributes = attributes.transform_keys(&:to_s)
40
+ attrs = Hash.new
41
+ attrs["app_id"] = attributes["appId"]
42
+ attrs["app_uid"] = attributes["appUid"]
43
+ attrs["endpoint_id"] = attributes["endpointId"]
44
+ attrs["endpoint_uid"] = attributes["endpointUid"]
45
+ new(attrs)
46
+ end
47
+
48
+ def serialize
49
+ out = Hash.new
50
+ out["appId"] = HookSniff::serialize_primitive(@app_id) if @app_id
51
+ out["appUid"] = HookSniff::serialize_primitive(@app_uid) if @app_uid
52
+ out["endpointId"] = HookSniff::serialize_primitive(@endpoint_id) if @endpoint_id
53
+ out["endpointUid"] = HookSniff::serialize_primitive(@endpoint_uid) if @endpoint_uid
54
+ out
55
+ end
56
+
57
+ # Serializes the object to a json string
58
+ # @return String
59
+ def to_json
60
+ JSON.dump(serialize)
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module HookSniff
6
+ class EventIn
7
+ # The event type's name
8
+ attr_accessor :event_type
9
+ attr_accessor :payload
10
+
11
+ ALL_FIELD ||= ["event_type", "payload"].freeze
12
+ private_constant :ALL_FIELD
13
+
14
+ def initialize(attributes = {})
15
+ unless attributes.is_a?(Hash)
16
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `HookSniff::EventIn` new method")
17
+ end
18
+
19
+ attributes.each do |k, v|
20
+ unless ALL_FIELD.include?(k.to_s)
21
+ fail(ArgumentError, "The field #{k} is not part of HookSniff::EventIn")
22
+ end
23
+
24
+ instance_variable_set("@#{k}", v)
25
+ instance_variable_set("@__#{k}_is_defined", true)
26
+ end
27
+ end
28
+
29
+ def self.deserialize(attributes = {})
30
+ attributes = attributes.transform_keys(&:to_s)
31
+ attrs = Hash.new
32
+ attrs["event_type"] = attributes["eventType"]
33
+ attrs["payload"] = attributes["payload"]
34
+ new(attrs)
35
+ end
36
+
37
+ def serialize
38
+ out = Hash.new
39
+ out["eventType"] = HookSniff::serialize_primitive(@event_type) if @event_type
40
+ out["payload"] = HookSniff::serialize_primitive(@payload) if @payload
41
+ out
42
+ end
43
+
44
+ # Serializes the object to a json string
45
+ # @return String
46
+ def to_json
47
+ JSON.dump(serialize)
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module HookSniff
6
+ class EventOut
7
+ # The event type's name
8
+ attr_accessor :event_type
9
+ attr_accessor :payload
10
+ attr_accessor :timestamp
11
+
12
+ ALL_FIELD ||= ["event_type", "payload", "timestamp"].freeze
13
+ private_constant :ALL_FIELD
14
+
15
+ def initialize(attributes = {})
16
+ unless attributes.is_a?(Hash)
17
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `HookSniff::EventOut` new method")
18
+ end
19
+
20
+ attributes.each do |k, v|
21
+ unless ALL_FIELD.include?(k.to_s)
22
+ fail(ArgumentError, "The field #{k} is not part of HookSniff::EventOut")
23
+ end
24
+
25
+ instance_variable_set("@#{k}", v)
26
+ instance_variable_set("@__#{k}_is_defined", true)
27
+ end
28
+ end
29
+
30
+ def self.deserialize(attributes = {})
31
+ attributes = attributes.transform_keys(&:to_s)
32
+ attrs = Hash.new
33
+ attrs["event_type"] = attributes["eventType"]
34
+ attrs["payload"] = attributes["payload"]
35
+ attrs["timestamp"] = DateTime.rfc3339(attributes["timestamp"]).to_time
36
+ new(attrs)
37
+ end
38
+
39
+ def serialize
40
+ out = Hash.new
41
+ out["eventType"] = HookSniff::serialize_primitive(@event_type) if @event_type
42
+ out["payload"] = HookSniff::serialize_primitive(@payload) if @payload
43
+ out["timestamp"] = HookSniff::serialize_primitive(@timestamp) if @timestamp
44
+ out
45
+ end
46
+
47
+ # Serializes the object to a json string
48
+ # @return String
49
+ def to_json
50
+ JSON.dump(serialize)
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module HookSniff
6
+ class EventTypeIn
7
+ attr_accessor :archived
8
+ attr_accessor :deprecated
9
+ attr_accessor :description
10
+ # Deprecated, use `featureFlags` instead.
11
+ attr_accessor :feature_flag
12
+ attr_accessor :feature_flags
13
+ # The event type group's name
14
+ attr_accessor :group_name
15
+ # The event type's name
16
+ attr_accessor :name
17
+ # The schema for the event type for a specific version as a JSON schema.
18
+ attr_accessor :schemas
19
+
20
+ ALL_FIELD ||= [
21
+ "archived",
22
+ "deprecated",
23
+ "description",
24
+ "feature_flag",
25
+ "feature_flags",
26
+ "group_name",
27
+ "name",
28
+ "schemas"
29
+ ].freeze
30
+ private_constant :ALL_FIELD
31
+
32
+ def initialize(attributes = {})
33
+ unless attributes.is_a?(Hash)
34
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `HookSniff::EventTypeIn` new method")
35
+ end
36
+
37
+ attributes.each do |k, v|
38
+ unless ALL_FIELD.include?(k.to_s)
39
+ fail(ArgumentError, "The field #{k} is not part of HookSniff::EventTypeIn")
40
+ end
41
+
42
+ instance_variable_set("@#{k}", v)
43
+ instance_variable_set("@__#{k}_is_defined", true)
44
+ end
45
+ end
46
+
47
+ def self.deserialize(attributes = {})
48
+ attributes = attributes.transform_keys(&:to_s)
49
+ attrs = Hash.new
50
+ attrs["archived"] = attributes["archived"]
51
+ attrs["deprecated"] = attributes["deprecated"]
52
+ attrs["description"] = attributes["description"]
53
+ attrs["feature_flag"] = attributes["featureFlag"]
54
+ attrs["feature_flags"] = attributes["featureFlags"]
55
+ attrs["group_name"] = attributes["groupName"]
56
+ attrs["name"] = attributes["name"]
57
+ attrs["schemas"] = attributes["schemas"]
58
+ new(attrs)
59
+ end
60
+
61
+ def serialize
62
+ out = Hash.new
63
+ out["archived"] = HookSniff::serialize_primitive(@archived) if @archived
64
+ out["deprecated"] = HookSniff::serialize_primitive(@deprecated) if @deprecated
65
+ out["description"] = HookSniff::serialize_primitive(@description) if @description
66
+ out["featureFlag"] = HookSniff::serialize_primitive(@feature_flag) if @feature_flag
67
+ out["featureFlags"] = HookSniff::serialize_primitive(@feature_flags) if @feature_flags
68
+ out["groupName"] = HookSniff::serialize_primitive(@group_name) if @group_name
69
+ out["name"] = HookSniff::serialize_primitive(@name) if @name
70
+ out["schemas"] = HookSniff::serialize_primitive(@schemas) if @schemas
71
+ out
72
+ end
73
+
74
+ # Serializes the object to a json string
75
+ # @return String
76
+ def to_json
77
+ JSON.dump(serialize)
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,87 @@
1
+ # frozen_string_literal: true
2
+ # This file is @generated
3
+ require "json"
4
+
5
+ module HookSniff
6
+ class EventTypeOut
7
+ attr_accessor :archived
8
+ attr_accessor :created_at
9
+ attr_accessor :deprecated
10
+ attr_accessor :description
11
+ attr_accessor :feature_flag
12
+ attr_accessor :feature_flags
13
+ # The event type group's name
14
+ attr_accessor :group_name
15
+ # The event type's name
16
+ attr_accessor :name
17
+ # The schema for the event type for a specific version as a JSON schema.
18
+ attr_accessor :schemas
19
+ attr_accessor :updated_at
20
+
21
+ ALL_FIELD ||= [
22
+ "archived",
23
+ "created_at",
24
+ "deprecated",
25
+ "description",
26
+ "feature_flag",
27
+ "feature_flags",
28
+ "group_name",
29
+ "name",
30
+ "schemas",
31
+ "updated_at"
32
+ ].freeze
33
+ private_constant :ALL_FIELD
34
+
35
+ def initialize(attributes = {})
36
+ unless attributes.is_a?(Hash)
37
+ fail(ArgumentError, "The input argument (attributes) must be a hash in `HookSniff::EventTypeOut` new method")
38
+ end
39
+
40
+ attributes.each do |k, v|
41
+ unless ALL_FIELD.include?(k.to_s)
42
+ fail(ArgumentError, "The field #{k} is not part of HookSniff::EventTypeOut")
43
+ end
44
+
45
+ instance_variable_set("@#{k}", v)
46
+ instance_variable_set("@__#{k}_is_defined", true)
47
+ end
48
+ end
49
+
50
+ def self.deserialize(attributes = {})
51
+ attributes = attributes.transform_keys(&:to_s)
52
+ attrs = Hash.new
53
+ attrs["archived"] = attributes["archived"]
54
+ attrs["created_at"] = DateTime.rfc3339(attributes["createdAt"]).to_time
55
+ attrs["deprecated"] = attributes["deprecated"]
56
+ attrs["description"] = attributes["description"]
57
+ attrs["feature_flag"] = attributes["featureFlag"]
58
+ attrs["feature_flags"] = attributes["featureFlags"]
59
+ attrs["group_name"] = attributes["groupName"]
60
+ attrs["name"] = attributes["name"]
61
+ attrs["schemas"] = attributes["schemas"]
62
+ attrs["updated_at"] = DateTime.rfc3339(attributes["updatedAt"]).to_time
63
+ new(attrs)
64
+ end
65
+
66
+ def serialize
67
+ out = Hash.new
68
+ out["archived"] = HookSniff::serialize_primitive(@archived) if @archived
69
+ out["createdAt"] = HookSniff::serialize_primitive(@created_at) if @created_at
70
+ out["deprecated"] = HookSniff::serialize_primitive(@deprecated) if @deprecated
71
+ out["description"] = HookSniff::serialize_primitive(@description) if @description
72
+ out["featureFlag"] = HookSniff::serialize_primitive(@feature_flag) if @feature_flag
73
+ out["featureFlags"] = HookSniff::serialize_primitive(@feature_flags) if @feature_flags
74
+ out["groupName"] = HookSniff::serialize_primitive(@group_name) if @group_name
75
+ out["name"] = HookSniff::serialize_primitive(@name) if @name
76
+ out["schemas"] = HookSniff::serialize_primitive(@schemas) if @schemas
77
+ out["updatedAt"] = HookSniff::serialize_primitive(@updated_at) if @updated_at
78
+ out
79
+ end
80
+
81
+ # Serializes the object to a json string
82
+ # @return String
83
+ def to_json
84
+ JSON.dump(serialize)
85
+ end
86
+ end
87
+ end