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