hooksniff 0.1.0 → 0.3.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 (144) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -1
  3. data/lib/openapi_client/api/admin_api.rb +452 -0
  4. data/lib/openapi_client/api/alerts_api.rb +322 -0
  5. data/lib/openapi_client/api/analytics_api.rb +208 -0
  6. data/lib/openapi_client/api/api_keys_api.rb +252 -0
  7. data/lib/openapi_client/api/audit_log_api.rb +140 -0
  8. data/lib/openapi_client/api/auth_api.rb +1080 -0
  9. data/lib/openapi_client/api/billing_api.rb +500 -0
  10. data/lib/openapi_client/api/contact_api.rb +88 -0
  11. data/lib/openapi_client/api/custom_domains_api.rb +253 -0
  12. data/lib/openapi_client/api/customer_portal_api.rb +700 -0
  13. data/lib/openapi_client/api/delivery_details_api.rb +146 -0
  14. data/lib/openapi_client/api/devices_api.rb +202 -0
  15. data/lib/openapi_client/api/embed_api.rb +128 -0
  16. data/lib/openapi_client/api/endpoints_api.rb +468 -0
  17. data/lib/openapi_client/api/events_api.rb +75 -0
  18. data/lib/openapi_client/api/health_api.rb +193 -0
  19. data/lib/openapi_client/api/inbound_api.rb +170 -0
  20. data/lib/openapi_client/api/notifications_api.rb +309 -0
  21. data/lib/openapi_client/api/o_auth_api.rb +181 -0
  22. data/lib/openapi_client/api/outbound_ips_api.rb +77 -0
  23. data/lib/openapi_client/api/playground_api.rb +143 -0
  24. data/lib/openapi_client/api/rate_limits_api.rb +252 -0
  25. data/lib/openapi_client/api/routing_api.rb +393 -0
  26. data/lib/openapi_client/api/schemas_api.rb +268 -0
  27. data/lib/openapi_client/api/search_api.rb +96 -0
  28. data/lib/openapi_client/api/simulator_api.rb +82 -0
  29. data/lib/openapi_client/api/sso_api.rb +241 -0
  30. data/lib/openapi_client/api/stats_api.rb +77 -0
  31. data/lib/openapi_client/api/stream_api.rb +88 -0
  32. data/lib/openapi_client/api/teams_api.rb +476 -0
  33. data/lib/openapi_client/api/templates_api.rb +213 -0
  34. data/lib/openapi_client/api/transforms_api.rb +368 -0
  35. data/lib/openapi_client/api/webhooks_api.rb +534 -0
  36. data/lib/openapi_client/api_client.rb +397 -0
  37. data/lib/openapi_client/api_error.rb +58 -0
  38. data/lib/openapi_client/api_model_base.rb +88 -0
  39. data/lib/openapi_client/configuration.rb +312 -0
  40. data/lib/openapi_client/models/admin_revenue_get200_response_inner.rb +165 -0
  41. data/lib/openapi_client/models/admin_sdk_update_post_request.rb +156 -0
  42. data/lib/openapi_client/models/admin_users_id_plan_put_request.rb +181 -0
  43. data/lib/openapi_client/models/admin_users_id_status_put_request.rb +147 -0
  44. data/lib/openapi_client/models/alert_rule.rb +237 -0
  45. data/lib/openapi_client/models/api_key_info.rb +185 -0
  46. data/lib/openapi_client/models/apply_template_request.rb +173 -0
  47. data/lib/openapi_client/models/apply_template_response.rb +156 -0
  48. data/lib/openapi_client/models/auth2fa_enable_post200_response.rb +156 -0
  49. data/lib/openapi_client/models/auth_login_post200_response.rb +104 -0
  50. data/lib/openapi_client/models/auth_response.rb +167 -0
  51. data/lib/openapi_client/models/batch_replay_request.rb +166 -0
  52. data/lib/openapi_client/models/batch_response.rb +160 -0
  53. data/lib/openapi_client/models/batch_response_errors_inner.rb +156 -0
  54. data/lib/openapi_client/models/batch_webhook_request.rb +166 -0
  55. data/lib/openapi_client/models/billing_portal_post200_response.rb +147 -0
  56. data/lib/openapi_client/models/change_password_request.rb +199 -0
  57. data/lib/openapi_client/models/change_role_request.rb +188 -0
  58. data/lib/openapi_client/models/confirm2fa_request.rb +182 -0
  59. data/lib/openapi_client/models/contact_request.rb +242 -0
  60. data/lib/openapi_client/models/contact_response.rb +156 -0
  61. data/lib/openapi_client/models/create_alert_request.rb +277 -0
  62. data/lib/openapi_client/models/create_api_key_response.rb +175 -0
  63. data/lib/openapi_client/models/create_endpoint_request.rb +288 -0
  64. data/lib/openapi_client/models/create_team_request.rb +164 -0
  65. data/lib/openapi_client/models/create_transform_rule_request.rb +216 -0
  66. data/lib/openapi_client/models/create_webhook_request.rb +201 -0
  67. data/lib/openapi_client/models/custom_domains_post_request.rb +147 -0
  68. data/lib/openapi_client/models/customer_response.rb +256 -0
  69. data/lib/openapi_client/models/delivery.rb +246 -0
  70. data/lib/openapi_client/models/delivery_attempt.rb +205 -0
  71. data/lib/openapi_client/models/delivery_list_response.rb +176 -0
  72. data/lib/openapi_client/models/delivery_trend_response.rb +158 -0
  73. data/lib/openapi_client/models/delivery_trend_response_buckets_inner.rb +174 -0
  74. data/lib/openapi_client/models/device_token_response.rb +174 -0
  75. data/lib/openapi_client/models/disable2fa_request.rb +164 -0
  76. data/lib/openapi_client/models/enable2fa_request.rb +164 -0
  77. data/lib/openapi_client/models/endpoint.rb +321 -0
  78. data/lib/openapi_client/models/endpoint_health.rb +183 -0
  79. data/lib/openapi_client/models/endpoints_endpoint_id_transforms_test_post_request.rb +156 -0
  80. data/lib/openapi_client/models/endpoints_id_rotate_secret_post200_response.rb +156 -0
  81. data/lib/openapi_client/models/error.rb +165 -0
  82. data/lib/openapi_client/models/forgot_password_request.rb +164 -0
  83. data/lib/openapi_client/models/invite_request.rb +207 -0
  84. data/lib/openapi_client/models/invoice_response.rb +183 -0
  85. data/lib/openapi_client/models/latency_trend_response.rb +167 -0
  86. data/lib/openapi_client/models/latency_trend_response_buckets_inner.rb +165 -0
  87. data/lib/openapi_client/models/login_request.rb +190 -0
  88. data/lib/openapi_client/models/notification.rb +193 -0
  89. data/lib/openapi_client/models/notification_list_response.rb +167 -0
  90. data/lib/openapi_client/models/notification_preferences.rb +201 -0
  91. data/lib/openapi_client/models/notifications_unread_count_get200_response.rb +147 -0
  92. data/lib/openapi_client/models/outbound_ips_response.rb +158 -0
  93. data/lib/openapi_client/models/paginated_users.rb +176 -0
  94. data/lib/openapi_client/models/playground_get200_response.rb +160 -0
  95. data/lib/openapi_client/models/portal_notifications_put200_response.rb +156 -0
  96. data/lib/openapi_client/models/portal_profile.rb +184 -0
  97. data/lib/openapi_client/models/refresh_token_request.rb +164 -0
  98. data/lib/openapi_client/models/register_device_request.rb +208 -0
  99. data/lib/openapi_client/models/register_request.rb +201 -0
  100. data/lib/openapi_client/models/register_schema_request.rb +191 -0
  101. data/lib/openapi_client/models/resend_verification_request.rb +164 -0
  102. data/lib/openapi_client/models/reset_password_request.rb +199 -0
  103. data/lib/openapi_client/models/retry_policy.rb +216 -0
  104. data/lib/openapi_client/models/routing_info.rb +193 -0
  105. data/lib/openapi_client/models/search_result.rb +158 -0
  106. data/lib/openapi_client/models/simulator_post_request.rb +165 -0
  107. data/lib/openapi_client/models/sso_config_post_request.rb +190 -0
  108. data/lib/openapi_client/models/stats_response.rb +210 -0
  109. data/lib/openapi_client/models/stream_params.rb +201 -0
  110. data/lib/openapi_client/models/subscription_response.rb +201 -0
  111. data/lib/openapi_client/models/success_rate_response.rb +183 -0
  112. data/lib/openapi_client/models/system_stats.rb +185 -0
  113. data/lib/openapi_client/models/system_stats_plan_breakdown_inner.rb +156 -0
  114. data/lib/openapi_client/models/system_status.rb +210 -0
  115. data/lib/openapi_client/models/system_status_components_inner.rb +184 -0
  116. data/lib/openapi_client/models/team.rb +165 -0
  117. data/lib/openapi_client/models/team_detail_response.rb +169 -0
  118. data/lib/openapi_client/models/team_invite.rb +174 -0
  119. data/lib/openapi_client/models/team_member.rb +193 -0
  120. data/lib/openapi_client/models/test_webhook_request.rb +199 -0
  121. data/lib/openapi_client/models/test_webhook_response.rb +174 -0
  122. data/lib/openapi_client/models/transform_rule.rb +201 -0
  123. data/lib/openapi_client/models/two_factor_required_response.rb +165 -0
  124. data/lib/openapi_client/models/update_endpoint_request.rb +278 -0
  125. data/lib/openapi_client/models/update_notification_preferences.rb +195 -0
  126. data/lib/openapi_client/models/update_profile_request.rb +190 -0
  127. data/lib/openapi_client/models/update_routing_request.rb +190 -0
  128. data/lib/openapi_client/models/upgrade_request.rb +209 -0
  129. data/lib/openapi_client/models/upgrade_response.rb +166 -0
  130. data/lib/openapi_client/models/usage_response.rb +201 -0
  131. data/lib/openapi_client/models/user_summary.rb +193 -0
  132. data/lib/openapi_client/models/validate_event_request.rb +164 -0
  133. data/lib/openapi_client/models/verify2fa_request.rb +208 -0
  134. data/lib/openapi_client/models/verify_email_request.rb +164 -0
  135. data/lib/openapi_client/models/webhook_template.rb +183 -0
  136. data/lib/openapi_client/version.rb +15 -0
  137. data/lib/openapi_client.rb +169 -0
  138. metadata +139 -10
  139. data/lib/hooksniff/client.rb +0 -213
  140. data/lib/hooksniff/errors.rb +0 -43
  141. data/lib/hooksniff/models.rb +0 -136
  142. data/lib/hooksniff/verification.rb +0 -134
  143. data/lib/hooksniff/version.rb +0 -5
  144. data/lib/hooksniff.rb +0 -19
@@ -0,0 +1,158 @@
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 DeliveryTrendResponse < ApiModelBase
18
+ attr_accessor :range
19
+
20
+ attr_accessor :buckets
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'range' => :'range',
26
+ :'buckets' => :'buckets'
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
+ :'range' => :'String',
44
+ :'buckets' => :'Array<DeliveryTrendResponseBucketsInner>'
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::DeliveryTrendResponse` 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::DeliveryTrendResponse`. 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?(:'range')
71
+ self.range = attributes[:'range']
72
+ end
73
+
74
+ if attributes.key?(:'buckets')
75
+ if (value = attributes[:'buckets']).is_a?(Array)
76
+ self.buckets = value
77
+ end
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ invalid_properties = Array.new
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ range == o.range &&
102
+ buckets == o.buckets
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [range, buckets].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ attributes = attributes.transform_keys(&:to_sym)
123
+ transformed_hash = {}
124
+ openapi_types.each_pair do |key, type|
125
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = nil
127
+ elsif type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[attribute_map[key]].is_a?(Array)
131
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
132
+ end
133
+ elsif !attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
135
+ end
136
+ end
137
+ new(transformed_hash)
138
+ end
139
+
140
+ # Returns the object in the form of hash
141
+ # @return [Hash] Returns the object in the form of hash
142
+ def to_hash
143
+ hash = {}
144
+ self.class.attribute_map.each_pair do |attr, param|
145
+ value = self.send(attr)
146
+ if value.nil?
147
+ is_nullable = self.class.openapi_nullable.include?(attr)
148
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
149
+ end
150
+
151
+ hash[param] = _to_hash(value)
152
+ end
153
+ hash
154
+ end
155
+
156
+ end
157
+
158
+ end
@@ -0,0 +1,174 @@
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 DeliveryTrendResponseBucketsInner < ApiModelBase
18
+ attr_accessor :timestamp
19
+
20
+ attr_accessor :successful
21
+
22
+ attr_accessor :failed
23
+
24
+ attr_accessor :total
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'timestamp' => :'timestamp',
30
+ :'successful' => :'successful',
31
+ :'failed' => :'failed',
32
+ :'total' => :'total'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'timestamp' => :'String',
50
+ :'successful' => :'Integer',
51
+ :'failed' => :'Integer',
52
+ :'total' => :'Integer'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::DeliveryTrendResponseBucketsInner` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::DeliveryTrendResponseBucketsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'timestamp')
79
+ self.timestamp = attributes[:'timestamp']
80
+ end
81
+
82
+ if attributes.key?(:'successful')
83
+ self.successful = attributes[:'successful']
84
+ end
85
+
86
+ if attributes.key?(:'failed')
87
+ self.failed = attributes[:'failed']
88
+ end
89
+
90
+ if attributes.key?(:'total')
91
+ self.total = attributes[:'total']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ warn '[DEPRECATED] the `valid?` method is obsolete'
107
+ true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ timestamp == o.timestamp &&
116
+ successful == o.successful &&
117
+ failed == o.failed &&
118
+ total == o.total
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Integer] Hash code
129
+ def hash
130
+ [timestamp, successful, failed, total].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def self.build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ attributes = attributes.transform_keys(&:to_sym)
139
+ transformed_hash = {}
140
+ openapi_types.each_pair do |key, type|
141
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = nil
143
+ elsif type =~ /\AArray<(.*)>/i
144
+ # check to ensure the input is an array given that the attribute
145
+ # is documented as an array but the input is not
146
+ if attributes[attribute_map[key]].is_a?(Array)
147
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
148
+ end
149
+ elsif !attributes[attribute_map[key]].nil?
150
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
151
+ end
152
+ end
153
+ new(transformed_hash)
154
+ end
155
+
156
+ # Returns the object in the form of hash
157
+ # @return [Hash] Returns the object in the form of hash
158
+ def to_hash
159
+ hash = {}
160
+ self.class.attribute_map.each_pair do |attr, param|
161
+ value = self.send(attr)
162
+ if value.nil?
163
+ is_nullable = self.class.openapi_nullable.include?(attr)
164
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
165
+ end
166
+
167
+ hash[param] = _to_hash(value)
168
+ end
169
+ hash
170
+ end
171
+
172
+ end
173
+
174
+ end
@@ -0,0 +1,174 @@
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 DeviceTokenResponse < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :token
21
+
22
+ attr_accessor :platform
23
+
24
+ attr_accessor :created_at
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'id' => :'id',
30
+ :'token' => :'token',
31
+ :'platform' => :'platform',
32
+ :'created_at' => :'created_at'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'id' => :'String',
50
+ :'token' => :'String',
51
+ :'platform' => :'String',
52
+ :'created_at' => :'Time'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::DeviceTokenResponse` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::DeviceTokenResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'id')
79
+ self.id = attributes[:'id']
80
+ end
81
+
82
+ if attributes.key?(:'token')
83
+ self.token = attributes[:'token']
84
+ end
85
+
86
+ if attributes.key?(:'platform')
87
+ self.platform = attributes[:'platform']
88
+ end
89
+
90
+ if attributes.key?(:'created_at')
91
+ self.created_at = attributes[:'created_at']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ warn '[DEPRECATED] the `valid?` method is obsolete'
107
+ true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ id == o.id &&
116
+ token == o.token &&
117
+ platform == o.platform &&
118
+ created_at == o.created_at
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Integer] Hash code
129
+ def hash
130
+ [id, token, platform, created_at].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def self.build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ attributes = attributes.transform_keys(&:to_sym)
139
+ transformed_hash = {}
140
+ openapi_types.each_pair do |key, type|
141
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = nil
143
+ elsif type =~ /\AArray<(.*)>/i
144
+ # check to ensure the input is an array given that the attribute
145
+ # is documented as an array but the input is not
146
+ if attributes[attribute_map[key]].is_a?(Array)
147
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
148
+ end
149
+ elsif !attributes[attribute_map[key]].nil?
150
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
151
+ end
152
+ end
153
+ new(transformed_hash)
154
+ end
155
+
156
+ # Returns the object in the form of hash
157
+ # @return [Hash] Returns the object in the form of hash
158
+ def to_hash
159
+ hash = {}
160
+ self.class.attribute_map.each_pair do |attr, param|
161
+ value = self.send(attr)
162
+ if value.nil?
163
+ is_nullable = self.class.openapi_nullable.include?(attr)
164
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
165
+ end
166
+
167
+ hash[param] = _to_hash(value)
168
+ end
169
+ hash
170
+ end
171
+
172
+ end
173
+
174
+ end
@@ -0,0 +1,164 @@
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 Disable2faRequest < ApiModelBase
18
+ attr_accessor :password
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'password' => :'password'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'password' => :'String'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::Disable2faRequest` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Disable2faRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'password')
67
+ self.password = attributes[:'password']
68
+ else
69
+ self.password = nil
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ if @password.nil?
79
+ invalid_properties.push('invalid value for "password", password cannot be nil.')
80
+ end
81
+
82
+ invalid_properties
83
+ end
84
+
85
+ # Check to see if the all the properties in the model are valid
86
+ # @return true if the model is valid
87
+ def valid?
88
+ warn '[DEPRECATED] the `valid?` method is obsolete'
89
+ return false if @password.nil?
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] password Value to be assigned
95
+ def password=(password)
96
+ if password.nil?
97
+ fail ArgumentError, 'password cannot be nil'
98
+ end
99
+
100
+ @password = password
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ password == o.password
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [password].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ transformed_hash = {}
130
+ openapi_types.each_pair do |key, type|
131
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = nil
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[attribute_map[key]].is_a?(Array)
137
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
138
+ end
139
+ elsif !attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
+ end
142
+ end
143
+ new(transformed_hash)
144
+ end
145
+
146
+ # Returns the object in the form of hash
147
+ # @return [Hash] Returns the object in the form of hash
148
+ def to_hash
149
+ hash = {}
150
+ self.class.attribute_map.each_pair do |attr, param|
151
+ value = self.send(attr)
152
+ if value.nil?
153
+ is_nullable = self.class.openapi_nullable.include?(attr)
154
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
155
+ end
156
+
157
+ hash[param] = _to_hash(value)
158
+ end
159
+ hash
160
+ end
161
+
162
+ end
163
+
164
+ end