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,207 +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 InviteRequest < ApiModelBase
18
- attr_accessor :email
19
-
20
- attr_accessor :role
21
-
22
- class EnumAttributeValidator
23
- attr_reader :datatype
24
- attr_reader :allowable_values
25
-
26
- def initialize(datatype, allowable_values)
27
- @allowable_values = allowable_values.map do |value|
28
- case datatype.to_s
29
- when /Integer/i
30
- value.to_i
31
- when /Float/i
32
- value.to_f
33
- else
34
- value
35
- end
36
- end
37
- end
38
-
39
- def valid?(value)
40
- !value || allowable_values.include?(value)
41
- end
42
- end
43
-
44
- # Attribute mapping from ruby-style variable name to JSON key.
45
- def self.attribute_map
46
- {
47
- :'email' => :'email',
48
- :'role' => :'role'
49
- }
50
- end
51
-
52
- # Returns attribute mapping this model knows about
53
- def self.acceptable_attribute_map
54
- attribute_map
55
- end
56
-
57
- # Returns all the JSON keys this model knows about
58
- def self.acceptable_attributes
59
- acceptable_attribute_map.values
60
- end
61
-
62
- # Attribute type mapping.
63
- def self.openapi_types
64
- {
65
- :'email' => :'String',
66
- :'role' => :'String'
67
- }
68
- end
69
-
70
- # List of attributes with nullable: true
71
- def self.openapi_nullable
72
- Set.new([
73
- ])
74
- end
75
-
76
- # Initializes the object
77
- # @param [Hash] attributes Model attributes in the form of hash
78
- def initialize(attributes = {})
79
- if (!attributes.is_a?(Hash))
80
- fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::InviteRequest` initialize method"
81
- end
82
-
83
- # check to see if the attribute exists and convert string to symbol for hash key
84
- acceptable_attribute_map = self.class.acceptable_attribute_map
85
- attributes = attributes.each_with_object({}) { |(k, v), h|
86
- if (!acceptable_attribute_map.key?(k.to_sym))
87
- fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::InviteRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
- end
89
- h[k.to_sym] = v
90
- }
91
-
92
- if attributes.key?(:'email')
93
- self.email = attributes[:'email']
94
- else
95
- self.email = nil
96
- end
97
-
98
- if attributes.key?(:'role')
99
- self.role = attributes[:'role']
100
- end
101
- end
102
-
103
- # Show invalid properties with the reasons. Usually used together with valid?
104
- # @return Array for valid properties with the reasons
105
- def list_invalid_properties
106
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
107
- invalid_properties = Array.new
108
- if @email.nil?
109
- invalid_properties.push('invalid value for "email", email cannot be nil.')
110
- end
111
-
112
- invalid_properties
113
- end
114
-
115
- # Check to see if the all the properties in the model are valid
116
- # @return true if the model is valid
117
- def valid?
118
- warn '[DEPRECATED] the `valid?` method is obsolete'
119
- return false if @email.nil?
120
- role_validator = EnumAttributeValidator.new('String', ["admin", "member", "viewer"])
121
- return false unless role_validator.valid?(@role)
122
- true
123
- end
124
-
125
- # Custom attribute writer method with validation
126
- # @param [Object] email Value to be assigned
127
- def email=(email)
128
- if email.nil?
129
- fail ArgumentError, 'email cannot be nil'
130
- end
131
-
132
- @email = email
133
- end
134
-
135
- # Custom attribute writer method checking allowed values (enum).
136
- # @param [Object] role Object to be assigned
137
- def role=(role)
138
- validator = EnumAttributeValidator.new('String', ["admin", "member", "viewer"])
139
- unless validator.valid?(role)
140
- fail ArgumentError, "invalid value for \"role\", must be one of #{validator.allowable_values}."
141
- end
142
- @role = role
143
- end
144
-
145
- # Checks equality by comparing each attribute.
146
- # @param [Object] Object to be compared
147
- def ==(o)
148
- return true if self.equal?(o)
149
- self.class == o.class &&
150
- email == o.email &&
151
- role == o.role
152
- end
153
-
154
- # @see the `==` method
155
- # @param [Object] Object to be compared
156
- def eql?(o)
157
- self == o
158
- end
159
-
160
- # Calculates hash code according to all attributes.
161
- # @return [Integer] Hash code
162
- def hash
163
- [email, role].hash
164
- end
165
-
166
- # Builds the object from hash
167
- # @param [Hash] attributes Model attributes in the form of hash
168
- # @return [Object] Returns the model itself
169
- def self.build_from_hash(attributes)
170
- return nil unless attributes.is_a?(Hash)
171
- attributes = attributes.transform_keys(&:to_sym)
172
- transformed_hash = {}
173
- openapi_types.each_pair do |key, type|
174
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
175
- transformed_hash["#{key}"] = nil
176
- elsif type =~ /\AArray<(.*)>/i
177
- # check to ensure the input is an array given that the attribute
178
- # is documented as an array but the input is not
179
- if attributes[attribute_map[key]].is_a?(Array)
180
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
181
- end
182
- elsif !attributes[attribute_map[key]].nil?
183
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
184
- end
185
- end
186
- new(transformed_hash)
187
- end
188
-
189
- # Returns the object in the form of hash
190
- # @return [Hash] Returns the object in the form of hash
191
- def to_hash
192
- hash = {}
193
- self.class.attribute_map.each_pair do |attr, param|
194
- value = self.send(attr)
195
- if value.nil?
196
- is_nullable = self.class.openapi_nullable.include?(attr)
197
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
198
- end
199
-
200
- hash[param] = _to_hash(value)
201
- end
202
- hash
203
- end
204
-
205
- end
206
-
207
- end
@@ -1,183 +0,0 @@
1
- =begin
2
- #HookSniff API
3
-
4
- #Webhook delivery, monitoring, and management API. All endpoints under `/v1` require authentication via `Authorization: Bearer <api_key>` header unless marked as **Public**.
5
-
6
- The version of the OpenAPI document: 1.0.0
7
- Contact: support@hooksniff.vercel.app
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.22.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module OpenapiClient
17
- class InvoiceResponse < ApiModelBase
18
- attr_accessor :id
19
-
20
- attr_accessor :amount_cents
21
-
22
- attr_accessor :currency
23
-
24
- attr_accessor :status
25
-
26
- attr_accessor :created_at
27
-
28
- # Attribute mapping from ruby-style variable name to JSON key.
29
- def self.attribute_map
30
- {
31
- :'id' => :'id',
32
- :'amount_cents' => :'amount_cents',
33
- :'currency' => :'currency',
34
- :'status' => :'status',
35
- :'created_at' => :'created_at'
36
- }
37
- end
38
-
39
- # Returns attribute mapping this model knows about
40
- def self.acceptable_attribute_map
41
- attribute_map
42
- end
43
-
44
- # Returns all the JSON keys this model knows about
45
- def self.acceptable_attributes
46
- acceptable_attribute_map.values
47
- end
48
-
49
- # Attribute type mapping.
50
- def self.openapi_types
51
- {
52
- :'id' => :'String',
53
- :'amount_cents' => :'Integer',
54
- :'currency' => :'String',
55
- :'status' => :'String',
56
- :'created_at' => :'Time'
57
- }
58
- end
59
-
60
- # List of attributes with nullable: true
61
- def self.openapi_nullable
62
- Set.new([
63
- ])
64
- end
65
-
66
- # Initializes the object
67
- # @param [Hash] attributes Model attributes in the form of hash
68
- def initialize(attributes = {})
69
- if (!attributes.is_a?(Hash))
70
- fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::InvoiceResponse` initialize method"
71
- end
72
-
73
- # check to see if the attribute exists and convert string to symbol for hash key
74
- acceptable_attribute_map = self.class.acceptable_attribute_map
75
- attributes = attributes.each_with_object({}) { |(k, v), h|
76
- if (!acceptable_attribute_map.key?(k.to_sym))
77
- fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::InvoiceResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
78
- end
79
- h[k.to_sym] = v
80
- }
81
-
82
- if attributes.key?(:'id')
83
- self.id = attributes[:'id']
84
- end
85
-
86
- if attributes.key?(:'amount_cents')
87
- self.amount_cents = attributes[:'amount_cents']
88
- end
89
-
90
- if attributes.key?(:'currency')
91
- self.currency = attributes[:'currency']
92
- end
93
-
94
- if attributes.key?(:'status')
95
- self.status = attributes[:'status']
96
- end
97
-
98
- if attributes.key?(:'created_at')
99
- self.created_at = attributes[:'created_at']
100
- end
101
- end
102
-
103
- # Show invalid properties with the reasons. Usually used together with valid?
104
- # @return Array for valid properties with the reasons
105
- def list_invalid_properties
106
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
107
- invalid_properties = Array.new
108
- invalid_properties
109
- end
110
-
111
- # Check to see if the all the properties in the model are valid
112
- # @return true if the model is valid
113
- def valid?
114
- warn '[DEPRECATED] the `valid?` method is obsolete'
115
- true
116
- end
117
-
118
- # Checks equality by comparing each attribute.
119
- # @param [Object] Object to be compared
120
- def ==(o)
121
- return true if self.equal?(o)
122
- self.class == o.class &&
123
- id == o.id &&
124
- amount_cents == o.amount_cents &&
125
- currency == o.currency &&
126
- status == o.status &&
127
- created_at == o.created_at
128
- end
129
-
130
- # @see the `==` method
131
- # @param [Object] Object to be compared
132
- def eql?(o)
133
- self == o
134
- end
135
-
136
- # Calculates hash code according to all attributes.
137
- # @return [Integer] Hash code
138
- def hash
139
- [id, amount_cents, currency, status, created_at].hash
140
- end
141
-
142
- # Builds the object from hash
143
- # @param [Hash] attributes Model attributes in the form of hash
144
- # @return [Object] Returns the model itself
145
- def self.build_from_hash(attributes)
146
- return nil unless attributes.is_a?(Hash)
147
- attributes = attributes.transform_keys(&:to_sym)
148
- transformed_hash = {}
149
- openapi_types.each_pair do |key, type|
150
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
151
- transformed_hash["#{key}"] = nil
152
- elsif type =~ /\AArray<(.*)>/i
153
- # check to ensure the input is an array given that the attribute
154
- # is documented as an array but the input is not
155
- if attributes[attribute_map[key]].is_a?(Array)
156
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
157
- end
158
- elsif !attributes[attribute_map[key]].nil?
159
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
160
- end
161
- end
162
- new(transformed_hash)
163
- end
164
-
165
- # Returns the object in the form of hash
166
- # @return [Hash] Returns the object in the form of hash
167
- def to_hash
168
- hash = {}
169
- self.class.attribute_map.each_pair do |attr, param|
170
- value = self.send(attr)
171
- if value.nil?
172
- is_nullable = self.class.openapi_nullable.include?(attr)
173
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
174
- end
175
-
176
- hash[param] = _to_hash(value)
177
- end
178
- hash
179
- end
180
-
181
- end
182
-
183
- end
@@ -1,167 +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 LatencyTrendResponse < ApiModelBase
18
- attr_accessor :range
19
-
20
- attr_accessor :buckets
21
-
22
- attr_accessor :overall_avg_ms
23
-
24
- # Attribute mapping from ruby-style variable name to JSON key.
25
- def self.attribute_map
26
- {
27
- :'range' => :'range',
28
- :'buckets' => :'buckets',
29
- :'overall_avg_ms' => :'overall_avg_ms'
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
- :'range' => :'String',
47
- :'buckets' => :'Array<LatencyTrendResponseBucketsInner>',
48
- :'overall_avg_ms' => :'Float'
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::LatencyTrendResponse` 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::LatencyTrendResponse`. 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?(:'range')
75
- self.range = attributes[:'range']
76
- end
77
-
78
- if attributes.key?(:'buckets')
79
- if (value = attributes[:'buckets']).is_a?(Array)
80
- self.buckets = value
81
- end
82
- end
83
-
84
- if attributes.key?(:'overall_avg_ms')
85
- self.overall_avg_ms = attributes[:'overall_avg_ms']
86
- end
87
- end
88
-
89
- # Show invalid properties with the reasons. Usually used together with valid?
90
- # @return Array for valid properties with the reasons
91
- def list_invalid_properties
92
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
93
- invalid_properties = Array.new
94
- invalid_properties
95
- end
96
-
97
- # Check to see if the all the properties in the model are valid
98
- # @return true if the model is valid
99
- def valid?
100
- warn '[DEPRECATED] the `valid?` method is obsolete'
101
- true
102
- end
103
-
104
- # Checks equality by comparing each attribute.
105
- # @param [Object] Object to be compared
106
- def ==(o)
107
- return true if self.equal?(o)
108
- self.class == o.class &&
109
- range == o.range &&
110
- buckets == o.buckets &&
111
- overall_avg_ms == o.overall_avg_ms
112
- end
113
-
114
- # @see the `==` method
115
- # @param [Object] Object to be compared
116
- def eql?(o)
117
- self == o
118
- end
119
-
120
- # Calculates hash code according to all attributes.
121
- # @return [Integer] Hash code
122
- def hash
123
- [range, buckets, overall_avg_ms].hash
124
- end
125
-
126
- # Builds the object from hash
127
- # @param [Hash] attributes Model attributes in the form of hash
128
- # @return [Object] Returns the model itself
129
- def self.build_from_hash(attributes)
130
- return nil unless attributes.is_a?(Hash)
131
- attributes = attributes.transform_keys(&:to_sym)
132
- transformed_hash = {}
133
- openapi_types.each_pair do |key, type|
134
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
135
- transformed_hash["#{key}"] = nil
136
- elsif type =~ /\AArray<(.*)>/i
137
- # check to ensure the input is an array given that the attribute
138
- # is documented as an array but the input is not
139
- if attributes[attribute_map[key]].is_a?(Array)
140
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
141
- end
142
- elsif !attributes[attribute_map[key]].nil?
143
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
144
- end
145
- end
146
- new(transformed_hash)
147
- end
148
-
149
- # Returns the object in the form of hash
150
- # @return [Hash] Returns the object in the form of hash
151
- def to_hash
152
- hash = {}
153
- self.class.attribute_map.each_pair do |attr, param|
154
- value = self.send(attr)
155
- if value.nil?
156
- is_nullable = self.class.openapi_nullable.include?(attr)
157
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
158
- end
159
-
160
- hash[param] = _to_hash(value)
161
- end
162
- hash
163
- end
164
-
165
- end
166
-
167
- end