hooksniff 0.3.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +7 -0
- data/Gemfile.lock +56 -0
- data/README.md +23 -199
- data/Rakefile +2 -0
- data/hooksniff.gemspec +48 -0
- data/lib/hooksniff/api/authentication.rb +36 -0
- data/lib/hooksniff/api/endpoint.rb +102 -0
- data/lib/hooksniff/api/event_type.rb +66 -0
- data/lib/hooksniff/api/health.rb +16 -0
- data/lib/hooksniff/api/integration.rb +42 -0
- data/lib/hooksniff/api/message.rb +48 -0
- data/lib/hooksniff/api/message_attempt.rb +38 -0
- data/lib/hooksniff/api/statistics.rb +37 -0
- data/lib/hooksniff/api/stream.rb +45 -0
- data/lib/{openapi_client → hooksniff}/api_error.rb +8 -18
- data/lib/hooksniff/background_task.rb +21 -0
- data/lib/hooksniff/connector.rb +33 -0
- data/lib/hooksniff/environment.rb +53 -0
- data/lib/hooksniff/errors.rb +129 -0
- data/lib/hooksniff/hooksniff.rb +52 -0
- data/lib/hooksniff/hooksniff_http_client.rb +128 -0
- data/lib/hooksniff/http_error_out.rb +18 -0
- data/lib/hooksniff/http_validation_error.rb +18 -0
- data/lib/hooksniff/inbound.rb +25 -0
- data/lib/hooksniff/internal.rb +7 -0
- data/lib/hooksniff/message_poller.rb +32 -0
- data/lib/hooksniff/models/endpoint_created_event.rb +50 -0
- data/lib/hooksniff/models/endpoint_created_event_data.rb +63 -0
- data/lib/hooksniff/models/endpoint_deleted_event.rb +50 -0
- data/lib/hooksniff/models/endpoint_deleted_event_data.rb +63 -0
- data/lib/hooksniff/models/endpoint_disabled_event.rb +53 -0
- data/lib/hooksniff/models/endpoint_disabled_event_data.rb +69 -0
- data/lib/hooksniff/models/endpoint_enabled_event.rb +50 -0
- data/lib/hooksniff/models/endpoint_enabled_event_data.rb +63 -0
- data/lib/hooksniff/models/endpoint_headers_in.rb +46 -0
- data/lib/hooksniff/models/endpoint_headers_out.rb +52 -0
- data/lib/hooksniff/models/endpoint_headers_patch_in.rb +53 -0
- data/lib/hooksniff/models/endpoint_in.rb +102 -0
- data/lib/hooksniff/models/endpoint_out.rb +104 -0
- data/lib/hooksniff/models/endpoint_patch.rb +97 -0
- data/lib/hooksniff/models/endpoint_secret_out.rb +50 -0
- data/lib/hooksniff/models/endpoint_secret_rotate_in.rb +53 -0
- data/lib/hooksniff/models/endpoint_update.rb +90 -0
- data/lib/hooksniff/models/endpoint_updated_event.rb +50 -0
- data/lib/hooksniff/models/endpoint_updated_event_data.rb +63 -0
- data/lib/hooksniff/models/event_in.rb +50 -0
- data/lib/hooksniff/models/event_out.rb +53 -0
- data/lib/hooksniff/models/event_type_in.rb +80 -0
- data/lib/hooksniff/models/event_type_out.rb +87 -0
- data/lib/hooksniff/models/event_type_patch.rb +66 -0
- data/lib/hooksniff/models/event_type_update.rb +67 -0
- data/lib/hooksniff/models/list_response_endpoint_out.rb +58 -0
- data/lib/hooksniff/models/list_response_event_type_out.rb +58 -0
- data/lib/hooksniff/models/list_response_message_attempt_out.rb +58 -0
- data/lib/hooksniff/models/list_response_message_out.rb +58 -0
- data/lib/hooksniff/models/message_attempt_exhausted_event.rb +53 -0
- data/lib/hooksniff/models/message_attempt_exhausted_event_data.rb +70 -0
- data/lib/hooksniff/models/message_attempt_failed_data.rb +56 -0
- data/lib/hooksniff/models/message_attempt_failing_event.rb +54 -0
- data/lib/hooksniff/models/message_attempt_failing_event_data.rb +70 -0
- data/lib/hooksniff/models/message_attempt_log.rb +112 -0
- data/lib/hooksniff/models/message_attempt_log_event.rb +53 -0
- data/lib/hooksniff/models/message_attempt_out.rb +96 -0
- data/lib/hooksniff/models/message_attempt_trigger_type.rb +33 -0
- data/lib/hooksniff/models/message_endpoint_out.rb +112 -0
- data/lib/hooksniff/models/message_in.rb +99 -0
- data/lib/hooksniff/models/message_out.rb +71 -0
- data/lib/hooksniff/models/message_status.rb +39 -0
- data/lib/hooksniff/models/message_status_text.rb +32 -0
- data/lib/hooksniff/models/ordering.rb +30 -0
- data/lib/hooksniff/models/status_code_class.rb +41 -0
- data/lib/hooksniff/operational_webhook.rb +12 -0
- data/lib/hooksniff/util.rb +69 -0
- data/lib/hooksniff/validation_error.rb +28 -0
- data/lib/hooksniff/version.rb +5 -0
- data/lib/hooksniff/webhook.rb +84 -0
- data/lib/hooksniff.rb +78 -0
- data/test/test_hooksniff.rb +86 -0
- metadata +131 -159
- data/lib/openapi_client/api/admin_api.rb +0 -452
- data/lib/openapi_client/api/alerts_api.rb +0 -322
- data/lib/openapi_client/api/analytics_api.rb +0 -208
- data/lib/openapi_client/api/api_keys_api.rb +0 -252
- data/lib/openapi_client/api/audit_log_api.rb +0 -140
- data/lib/openapi_client/api/auth_api.rb +0 -1080
- data/lib/openapi_client/api/billing_api.rb +0 -500
- data/lib/openapi_client/api/contact_api.rb +0 -88
- data/lib/openapi_client/api/custom_domains_api.rb +0 -253
- data/lib/openapi_client/api/customer_portal_api.rb +0 -700
- data/lib/openapi_client/api/delivery_details_api.rb +0 -146
- data/lib/openapi_client/api/devices_api.rb +0 -202
- data/lib/openapi_client/api/embed_api.rb +0 -128
- data/lib/openapi_client/api/endpoints_api.rb +0 -468
- data/lib/openapi_client/api/events_api.rb +0 -75
- data/lib/openapi_client/api/health_api.rb +0 -193
- data/lib/openapi_client/api/inbound_api.rb +0 -170
- data/lib/openapi_client/api/notifications_api.rb +0 -309
- data/lib/openapi_client/api/o_auth_api.rb +0 -181
- data/lib/openapi_client/api/outbound_ips_api.rb +0 -77
- data/lib/openapi_client/api/playground_api.rb +0 -143
- data/lib/openapi_client/api/rate_limits_api.rb +0 -252
- data/lib/openapi_client/api/routing_api.rb +0 -393
- data/lib/openapi_client/api/schemas_api.rb +0 -268
- data/lib/openapi_client/api/search_api.rb +0 -96
- data/lib/openapi_client/api/simulator_api.rb +0 -82
- data/lib/openapi_client/api/sso_api.rb +0 -241
- data/lib/openapi_client/api/stats_api.rb +0 -77
- data/lib/openapi_client/api/stream_api.rb +0 -88
- data/lib/openapi_client/api/teams_api.rb +0 -476
- data/lib/openapi_client/api/templates_api.rb +0 -213
- data/lib/openapi_client/api/transforms_api.rb +0 -368
- data/lib/openapi_client/api/webhooks_api.rb +0 -534
- data/lib/openapi_client/api_client.rb +0 -397
- data/lib/openapi_client/api_model_base.rb +0 -88
- data/lib/openapi_client/configuration.rb +0 -312
- data/lib/openapi_client/models/admin_revenue_get200_response_inner.rb +0 -165
- data/lib/openapi_client/models/admin_sdk_update_post_request.rb +0 -156
- data/lib/openapi_client/models/admin_users_id_plan_put_request.rb +0 -181
- data/lib/openapi_client/models/admin_users_id_status_put_request.rb +0 -147
- data/lib/openapi_client/models/alert_rule.rb +0 -237
- data/lib/openapi_client/models/api_key_info.rb +0 -185
- data/lib/openapi_client/models/apply_template_request.rb +0 -173
- data/lib/openapi_client/models/apply_template_response.rb +0 -156
- data/lib/openapi_client/models/auth2fa_enable_post200_response.rb +0 -156
- data/lib/openapi_client/models/auth_login_post200_response.rb +0 -104
- data/lib/openapi_client/models/auth_response.rb +0 -167
- data/lib/openapi_client/models/batch_replay_request.rb +0 -166
- data/lib/openapi_client/models/batch_response.rb +0 -160
- data/lib/openapi_client/models/batch_response_errors_inner.rb +0 -156
- data/lib/openapi_client/models/batch_webhook_request.rb +0 -166
- data/lib/openapi_client/models/billing_portal_post200_response.rb +0 -147
- data/lib/openapi_client/models/change_password_request.rb +0 -199
- data/lib/openapi_client/models/change_role_request.rb +0 -188
- data/lib/openapi_client/models/confirm2fa_request.rb +0 -182
- data/lib/openapi_client/models/contact_request.rb +0 -242
- data/lib/openapi_client/models/contact_response.rb +0 -156
- data/lib/openapi_client/models/create_alert_request.rb +0 -277
- data/lib/openapi_client/models/create_api_key_response.rb +0 -175
- data/lib/openapi_client/models/create_endpoint_request.rb +0 -288
- data/lib/openapi_client/models/create_team_request.rb +0 -164
- data/lib/openapi_client/models/create_transform_rule_request.rb +0 -216
- data/lib/openapi_client/models/create_webhook_request.rb +0 -201
- data/lib/openapi_client/models/custom_domains_post_request.rb +0 -147
- data/lib/openapi_client/models/customer_response.rb +0 -256
- data/lib/openapi_client/models/delivery.rb +0 -246
- data/lib/openapi_client/models/delivery_attempt.rb +0 -205
- data/lib/openapi_client/models/delivery_list_response.rb +0 -176
- data/lib/openapi_client/models/delivery_trend_response.rb +0 -158
- data/lib/openapi_client/models/delivery_trend_response_buckets_inner.rb +0 -174
- data/lib/openapi_client/models/device_token_response.rb +0 -174
- data/lib/openapi_client/models/disable2fa_request.rb +0 -164
- data/lib/openapi_client/models/enable2fa_request.rb +0 -164
- data/lib/openapi_client/models/endpoint.rb +0 -321
- data/lib/openapi_client/models/endpoint_health.rb +0 -183
- data/lib/openapi_client/models/endpoints_endpoint_id_transforms_test_post_request.rb +0 -156
- data/lib/openapi_client/models/endpoints_id_rotate_secret_post200_response.rb +0 -156
- data/lib/openapi_client/models/error.rb +0 -165
- data/lib/openapi_client/models/forgot_password_request.rb +0 -164
- data/lib/openapi_client/models/invite_request.rb +0 -207
- data/lib/openapi_client/models/invoice_response.rb +0 -183
- data/lib/openapi_client/models/latency_trend_response.rb +0 -167
- data/lib/openapi_client/models/latency_trend_response_buckets_inner.rb +0 -165
- data/lib/openapi_client/models/login_request.rb +0 -190
- data/lib/openapi_client/models/notification.rb +0 -193
- data/lib/openapi_client/models/notification_list_response.rb +0 -167
- data/lib/openapi_client/models/notification_preferences.rb +0 -201
- data/lib/openapi_client/models/notifications_unread_count_get200_response.rb +0 -147
- data/lib/openapi_client/models/outbound_ips_response.rb +0 -158
- data/lib/openapi_client/models/paginated_users.rb +0 -176
- data/lib/openapi_client/models/playground_get200_response.rb +0 -160
- data/lib/openapi_client/models/portal_notifications_put200_response.rb +0 -156
- data/lib/openapi_client/models/portal_profile.rb +0 -184
- data/lib/openapi_client/models/refresh_token_request.rb +0 -164
- data/lib/openapi_client/models/register_device_request.rb +0 -208
- data/lib/openapi_client/models/register_request.rb +0 -201
- data/lib/openapi_client/models/register_schema_request.rb +0 -191
- data/lib/openapi_client/models/resend_verification_request.rb +0 -164
- data/lib/openapi_client/models/reset_password_request.rb +0 -199
- data/lib/openapi_client/models/retry_policy.rb +0 -216
- data/lib/openapi_client/models/routing_info.rb +0 -193
- data/lib/openapi_client/models/search_result.rb +0 -158
- data/lib/openapi_client/models/simulator_post_request.rb +0 -165
- data/lib/openapi_client/models/sso_config_post_request.rb +0 -190
- data/lib/openapi_client/models/stats_response.rb +0 -210
- data/lib/openapi_client/models/stream_params.rb +0 -201
- data/lib/openapi_client/models/subscription_response.rb +0 -201
- data/lib/openapi_client/models/success_rate_response.rb +0 -183
- data/lib/openapi_client/models/system_stats.rb +0 -185
- data/lib/openapi_client/models/system_stats_plan_breakdown_inner.rb +0 -156
- data/lib/openapi_client/models/system_status.rb +0 -210
- data/lib/openapi_client/models/system_status_components_inner.rb +0 -184
- data/lib/openapi_client/models/team.rb +0 -165
- data/lib/openapi_client/models/team_detail_response.rb +0 -169
- data/lib/openapi_client/models/team_invite.rb +0 -174
- data/lib/openapi_client/models/team_member.rb +0 -193
- data/lib/openapi_client/models/test_webhook_request.rb +0 -199
- data/lib/openapi_client/models/test_webhook_response.rb +0 -174
- data/lib/openapi_client/models/transform_rule.rb +0 -201
- data/lib/openapi_client/models/two_factor_required_response.rb +0 -165
- data/lib/openapi_client/models/update_endpoint_request.rb +0 -278
- data/lib/openapi_client/models/update_notification_preferences.rb +0 -195
- data/lib/openapi_client/models/update_profile_request.rb +0 -190
- data/lib/openapi_client/models/update_routing_request.rb +0 -190
- data/lib/openapi_client/models/upgrade_request.rb +0 -209
- data/lib/openapi_client/models/upgrade_response.rb +0 -166
- data/lib/openapi_client/models/usage_response.rb +0 -201
- data/lib/openapi_client/models/user_summary.rb +0 -193
- data/lib/openapi_client/models/validate_event_request.rb +0 -164
- data/lib/openapi_client/models/verify2fa_request.rb +0 -208
- data/lib/openapi_client/models/verify_email_request.rb +0 -164
- data/lib/openapi_client/models/webhook_template.rb +0 -183
- data/lib/openapi_client/version.rb +0 -15
- data/lib/openapi_client.rb +0 -169
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module HookSniff
|
|
6
|
+
# Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a "message.attempt.exhausted" type or after it's failed four times as a "message.attempt.failing" event.
|
|
7
|
+
class MessageAttemptExhaustedEventData
|
|
8
|
+
# The Application's ID.
|
|
9
|
+
attr_accessor :app_id
|
|
10
|
+
# The Application's UID.
|
|
11
|
+
attr_accessor :app_uid
|
|
12
|
+
# The Endpoint's ID.
|
|
13
|
+
attr_accessor :endpoint_id
|
|
14
|
+
attr_accessor :last_attempt
|
|
15
|
+
# The Message's UID.
|
|
16
|
+
attr_accessor :msg_event_id
|
|
17
|
+
# The Message's ID.
|
|
18
|
+
attr_accessor :msg_id
|
|
19
|
+
|
|
20
|
+
ALL_FIELD ||= ["app_id", "app_uid", "endpoint_id", "last_attempt", "msg_event_id", "msg_id"].freeze
|
|
21
|
+
private_constant :ALL_FIELD
|
|
22
|
+
|
|
23
|
+
def initialize(attributes = {})
|
|
24
|
+
unless attributes.is_a?(Hash)
|
|
25
|
+
fail(
|
|
26
|
+
ArgumentError,
|
|
27
|
+
"The input argument (attributes) must be a hash in `HookSniff::MessageAttemptExhaustedEventData` new method"
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
attributes.each do |k, v|
|
|
32
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
33
|
+
fail(ArgumentError, "The field #{k} is not part of HookSniff::MessageAttemptExhaustedEventData")
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
instance_variable_set("@#{k}", v)
|
|
37
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def self.deserialize(attributes = {})
|
|
42
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
43
|
+
attrs = Hash.new
|
|
44
|
+
attrs["app_id"] = attributes["appId"]
|
|
45
|
+
attrs["app_uid"] = attributes["appUid"]
|
|
46
|
+
attrs["endpoint_id"] = attributes["endpointId"]
|
|
47
|
+
attrs["last_attempt"] = HookSniff::MessageAttemptFailedData.deserialize(attributes["lastAttempt"])
|
|
48
|
+
attrs["msg_event_id"] = attributes["msgEventId"]
|
|
49
|
+
attrs["msg_id"] = attributes["msgId"]
|
|
50
|
+
new(attrs)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def serialize
|
|
54
|
+
out = Hash.new
|
|
55
|
+
out["appId"] = HookSniff::serialize_primitive(@app_id) if @app_id
|
|
56
|
+
out["appUid"] = HookSniff::serialize_primitive(@app_uid) if @app_uid
|
|
57
|
+
out["endpointId"] = HookSniff::serialize_primitive(@endpoint_id) if @endpoint_id
|
|
58
|
+
out["lastAttempt"] = HookSniff::serialize_schema_ref(@last_attempt) if @last_attempt
|
|
59
|
+
out["msgEventId"] = HookSniff::serialize_primitive(@msg_event_id) if @msg_event_id
|
|
60
|
+
out["msgId"] = HookSniff::serialize_primitive(@msg_id) if @msg_id
|
|
61
|
+
out
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Serializes the object to a json string
|
|
65
|
+
# @return String
|
|
66
|
+
def to_json
|
|
67
|
+
JSON.dump(serialize)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module HookSniff
|
|
6
|
+
class MessageAttemptFailedData
|
|
7
|
+
# The MessageAttempt's ID.
|
|
8
|
+
attr_accessor :id
|
|
9
|
+
attr_accessor :response_status_code
|
|
10
|
+
attr_accessor :timestamp
|
|
11
|
+
|
|
12
|
+
ALL_FIELD ||= ["id", "response_status_code", "timestamp"].freeze
|
|
13
|
+
private_constant :ALL_FIELD
|
|
14
|
+
|
|
15
|
+
def initialize(attributes = {})
|
|
16
|
+
unless attributes.is_a?(Hash)
|
|
17
|
+
fail(
|
|
18
|
+
ArgumentError,
|
|
19
|
+
"The input argument (attributes) must be a hash in `HookSniff::MessageAttemptFailedData` new method"
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
attributes.each do |k, v|
|
|
24
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
25
|
+
fail(ArgumentError, "The field #{k} is not part of HookSniff::MessageAttemptFailedData")
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
instance_variable_set("@#{k}", v)
|
|
29
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def self.deserialize(attributes = {})
|
|
34
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
35
|
+
attrs = Hash.new
|
|
36
|
+
attrs["id"] = attributes["id"]
|
|
37
|
+
attrs["response_status_code"] = attributes["responseStatusCode"]
|
|
38
|
+
attrs["timestamp"] = DateTime.rfc3339(attributes["timestamp"]).to_time
|
|
39
|
+
new(attrs)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def serialize
|
|
43
|
+
out = Hash.new
|
|
44
|
+
out["id"] = HookSniff::serialize_primitive(@id) if @id
|
|
45
|
+
out["responseStatusCode"] = HookSniff::serialize_primitive(@response_status_code) if @response_status_code
|
|
46
|
+
out["timestamp"] = HookSniff::serialize_primitive(@timestamp) if @timestamp
|
|
47
|
+
out
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Serializes the object to a json string
|
|
51
|
+
# @return String
|
|
52
|
+
def to_json
|
|
53
|
+
JSON.dump(serialize)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module HookSniff
|
|
6
|
+
# Sent after a message has been failing for a few times.
|
|
7
|
+
# It's sent on the fourth failure. It complements `message.attempt.exhausted` which is sent after the last failure.
|
|
8
|
+
class MessageAttemptFailingEvent
|
|
9
|
+
attr_accessor :data
|
|
10
|
+
attr_accessor :type
|
|
11
|
+
|
|
12
|
+
ALL_FIELD ||= ["data", "type"].freeze
|
|
13
|
+
private_constant :ALL_FIELD
|
|
14
|
+
|
|
15
|
+
def initialize(attributes = {})
|
|
16
|
+
unless attributes.is_a?(Hash)
|
|
17
|
+
fail(
|
|
18
|
+
ArgumentError,
|
|
19
|
+
"The input argument (attributes) must be a hash in `HookSniff::MessageAttemptFailingEvent` new method"
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
attributes.each do |k, v|
|
|
24
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
25
|
+
fail(ArgumentError, "The field #{k} is not part of HookSniff::MessageAttemptFailingEvent")
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
instance_variable_set("@#{k}", v)
|
|
29
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def self.deserialize(attributes = {})
|
|
34
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
35
|
+
attrs = Hash.new
|
|
36
|
+
attrs["data"] = HookSniff::MessageAttemptFailingEventData.deserialize(attributes["data"])
|
|
37
|
+
attrs["type"] = attributes["type"]
|
|
38
|
+
new(attrs)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def serialize
|
|
42
|
+
out = Hash.new
|
|
43
|
+
out["data"] = HookSniff::serialize_schema_ref(@data) if @data
|
|
44
|
+
out["type"] = HookSniff::serialize_primitive(@type) if @type
|
|
45
|
+
out
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Serializes the object to a json string
|
|
49
|
+
# @return String
|
|
50
|
+
def to_json
|
|
51
|
+
JSON.dump(serialize)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module HookSniff
|
|
6
|
+
# Sent when a message delivery has failed (all of the retry attempts have been exhausted) as a "message.attempt.exhausted" type or after it's failed four times as a "message.attempt.failing" event.
|
|
7
|
+
class MessageAttemptFailingEventData
|
|
8
|
+
# The Application's ID.
|
|
9
|
+
attr_accessor :app_id
|
|
10
|
+
# The Application's UID.
|
|
11
|
+
attr_accessor :app_uid
|
|
12
|
+
# The Endpoint's ID.
|
|
13
|
+
attr_accessor :endpoint_id
|
|
14
|
+
attr_accessor :last_attempt
|
|
15
|
+
# The Message's UID.
|
|
16
|
+
attr_accessor :msg_event_id
|
|
17
|
+
# The Message's ID.
|
|
18
|
+
attr_accessor :msg_id
|
|
19
|
+
|
|
20
|
+
ALL_FIELD ||= ["app_id", "app_uid", "endpoint_id", "last_attempt", "msg_event_id", "msg_id"].freeze
|
|
21
|
+
private_constant :ALL_FIELD
|
|
22
|
+
|
|
23
|
+
def initialize(attributes = {})
|
|
24
|
+
unless attributes.is_a?(Hash)
|
|
25
|
+
fail(
|
|
26
|
+
ArgumentError,
|
|
27
|
+
"The input argument (attributes) must be a hash in `HookSniff::MessageAttemptFailingEventData` new method"
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
attributes.each do |k, v|
|
|
32
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
33
|
+
fail(ArgumentError, "The field #{k} is not part of HookSniff::MessageAttemptFailingEventData")
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
instance_variable_set("@#{k}", v)
|
|
37
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def self.deserialize(attributes = {})
|
|
42
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
43
|
+
attrs = Hash.new
|
|
44
|
+
attrs["app_id"] = attributes["appId"]
|
|
45
|
+
attrs["app_uid"] = attributes["appUid"]
|
|
46
|
+
attrs["endpoint_id"] = attributes["endpointId"]
|
|
47
|
+
attrs["last_attempt"] = HookSniff::MessageAttemptFailedData.deserialize(attributes["lastAttempt"])
|
|
48
|
+
attrs["msg_event_id"] = attributes["msgEventId"]
|
|
49
|
+
attrs["msg_id"] = attributes["msgId"]
|
|
50
|
+
new(attrs)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def serialize
|
|
54
|
+
out = Hash.new
|
|
55
|
+
out["appId"] = HookSniff::serialize_primitive(@app_id) if @app_id
|
|
56
|
+
out["appUid"] = HookSniff::serialize_primitive(@app_uid) if @app_uid
|
|
57
|
+
out["endpointId"] = HookSniff::serialize_primitive(@endpoint_id) if @endpoint_id
|
|
58
|
+
out["lastAttempt"] = HookSniff::serialize_schema_ref(@last_attempt) if @last_attempt
|
|
59
|
+
out["msgEventId"] = HookSniff::serialize_primitive(@msg_event_id) if @msg_event_id
|
|
60
|
+
out["msgId"] = HookSniff::serialize_primitive(@msg_id) if @msg_id
|
|
61
|
+
out
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Serializes the object to a json string
|
|
65
|
+
# @return String
|
|
66
|
+
def to_json
|
|
67
|
+
JSON.dump(serialize)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module HookSniff
|
|
6
|
+
class MessageAttemptLog
|
|
7
|
+
# The Application's ID.
|
|
8
|
+
attr_accessor :app_id
|
|
9
|
+
# The Application's UID.
|
|
10
|
+
attr_accessor :app_uid
|
|
11
|
+
attr_accessor :attempt_count
|
|
12
|
+
attr_accessor :attempt_end
|
|
13
|
+
# The MessageAttempt's ID.
|
|
14
|
+
attr_accessor :attempt_id
|
|
15
|
+
attr_accessor :attempt_start
|
|
16
|
+
# The Endpoint's ID.
|
|
17
|
+
attr_accessor :endpoint_id
|
|
18
|
+
# The event type's name
|
|
19
|
+
attr_accessor :event_type
|
|
20
|
+
attr_accessor :http_times
|
|
21
|
+
attr_accessor :msg_created
|
|
22
|
+
# The Message's UID.
|
|
23
|
+
attr_accessor :msg_event_id
|
|
24
|
+
# The Message's ID.
|
|
25
|
+
attr_accessor :msg_id
|
|
26
|
+
# The Environment's ID.
|
|
27
|
+
attr_accessor :org_id
|
|
28
|
+
attr_accessor :response_status_code
|
|
29
|
+
attr_accessor :status
|
|
30
|
+
|
|
31
|
+
ALL_FIELD ||= [
|
|
32
|
+
"app_id",
|
|
33
|
+
"app_uid",
|
|
34
|
+
"attempt_count",
|
|
35
|
+
"attempt_end",
|
|
36
|
+
"attempt_id",
|
|
37
|
+
"attempt_start",
|
|
38
|
+
"endpoint_id",
|
|
39
|
+
"event_type",
|
|
40
|
+
"http_times",
|
|
41
|
+
"msg_created",
|
|
42
|
+
"msg_event_id",
|
|
43
|
+
"msg_id",
|
|
44
|
+
"org_id",
|
|
45
|
+
"response_status_code",
|
|
46
|
+
"status"
|
|
47
|
+
].freeze
|
|
48
|
+
private_constant :ALL_FIELD
|
|
49
|
+
|
|
50
|
+
def initialize(attributes = {})
|
|
51
|
+
unless attributes.is_a?(Hash)
|
|
52
|
+
fail(ArgumentError, "The input argument (attributes) must be a hash in `HookSniff::MessageAttemptLog` new method")
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
attributes.each do |k, v|
|
|
56
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
57
|
+
fail(ArgumentError, "The field #{k} is not part of HookSniff::MessageAttemptLog")
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
instance_variable_set("@#{k}", v)
|
|
61
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def self.deserialize(attributes = {})
|
|
66
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
67
|
+
attrs = Hash.new
|
|
68
|
+
attrs["app_id"] = attributes["appId"]
|
|
69
|
+
attrs["app_uid"] = attributes["appUid"]
|
|
70
|
+
attrs["attempt_count"] = attributes["attemptCount"]
|
|
71
|
+
attrs["attempt_end"] = DateTime.rfc3339(attributes["attemptEnd"]).to_time
|
|
72
|
+
attrs["attempt_id"] = attributes["attemptId"]
|
|
73
|
+
attrs["attempt_start"] = DateTime.rfc3339(attributes["attemptStart"]).to_time
|
|
74
|
+
attrs["endpoint_id"] = attributes["endpointId"]
|
|
75
|
+
attrs["event_type"] = attributes["eventType"]
|
|
76
|
+
attrs["http_times"] = HookSniff::HttpAttemptTimes.deserialize(attributes["httpTimes"]) if attributes["httpTimes"]
|
|
77
|
+
attrs["msg_created"] = DateTime.rfc3339(attributes["msgCreated"]).to_time
|
|
78
|
+
attrs["msg_event_id"] = attributes["msgEventId"]
|
|
79
|
+
attrs["msg_id"] = attributes["msgId"]
|
|
80
|
+
attrs["org_id"] = attributes["orgId"]
|
|
81
|
+
attrs["response_status_code"] = attributes["responseStatusCode"]
|
|
82
|
+
attrs["status"] = HookSniff::MessageStatus.deserialize(attributes["status"])
|
|
83
|
+
new(attrs)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def serialize
|
|
87
|
+
out = Hash.new
|
|
88
|
+
out["appId"] = HookSniff::serialize_primitive(@app_id) if @app_id
|
|
89
|
+
out["appUid"] = HookSniff::serialize_primitive(@app_uid) if @app_uid
|
|
90
|
+
out["attemptCount"] = HookSniff::serialize_primitive(@attempt_count) if @attempt_count
|
|
91
|
+
out["attemptEnd"] = HookSniff::serialize_primitive(@attempt_end) if @attempt_end
|
|
92
|
+
out["attemptId"] = HookSniff::serialize_primitive(@attempt_id) if @attempt_id
|
|
93
|
+
out["attemptStart"] = HookSniff::serialize_primitive(@attempt_start) if @attempt_start
|
|
94
|
+
out["endpointId"] = HookSniff::serialize_primitive(@endpoint_id) if @endpoint_id
|
|
95
|
+
out["eventType"] = HookSniff::serialize_primitive(@event_type) if @event_type
|
|
96
|
+
out["httpTimes"] = HookSniff::serialize_schema_ref(@http_times) if @http_times
|
|
97
|
+
out["msgCreated"] = HookSniff::serialize_primitive(@msg_created) if @msg_created
|
|
98
|
+
out["msgEventId"] = HookSniff::serialize_primitive(@msg_event_id) if @msg_event_id
|
|
99
|
+
out["msgId"] = HookSniff::serialize_primitive(@msg_id) if @msg_id
|
|
100
|
+
out["orgId"] = HookSniff::serialize_primitive(@org_id) if @org_id
|
|
101
|
+
out["responseStatusCode"] = HookSniff::serialize_primitive(@response_status_code) if @response_status_code
|
|
102
|
+
out["status"] = HookSniff::serialize_schema_ref(@status) if @status
|
|
103
|
+
out
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Serializes the object to a json string
|
|
107
|
+
# @return String
|
|
108
|
+
def to_json
|
|
109
|
+
JSON.dump(serialize)
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module HookSniff
|
|
6
|
+
# Sent after message attempts are made. Contains metadata about message attempts and their results. In order to reduce the frequency of webhooks, these are sent in batches periodically.
|
|
7
|
+
class MessageAttemptLogEvent
|
|
8
|
+
attr_accessor :data
|
|
9
|
+
attr_accessor :type
|
|
10
|
+
|
|
11
|
+
ALL_FIELD ||= ["data", "type"].freeze
|
|
12
|
+
private_constant :ALL_FIELD
|
|
13
|
+
|
|
14
|
+
def initialize(attributes = {})
|
|
15
|
+
unless attributes.is_a?(Hash)
|
|
16
|
+
fail(
|
|
17
|
+
ArgumentError,
|
|
18
|
+
"The input argument (attributes) must be a hash in `HookSniff::MessageAttemptLogEvent` new method"
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
attributes.each do |k, v|
|
|
23
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
24
|
+
fail(ArgumentError, "The field #{k} is not part of HookSniff::MessageAttemptLogEvent")
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
instance_variable_set("@#{k}", v)
|
|
28
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def self.deserialize(attributes = {})
|
|
33
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
34
|
+
attrs = Hash.new
|
|
35
|
+
attrs["data"] = attributes["data"].map { |v| HookSniff::MessageAttemptLog.deserialize(v) }
|
|
36
|
+
attrs["type"] = attributes["type"]
|
|
37
|
+
new(attrs)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def serialize
|
|
41
|
+
out = Hash.new
|
|
42
|
+
out["data"] = @data.map { |v| v.serialize } if @data
|
|
43
|
+
out["type"] = HookSniff::serialize_primitive(@type) if @type
|
|
44
|
+
out
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Serializes the object to a json string
|
|
48
|
+
# @return String
|
|
49
|
+
def to_json
|
|
50
|
+
JSON.dump(serialize)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module HookSniff
|
|
6
|
+
class MessageAttemptOut
|
|
7
|
+
# The Endpoint's ID.
|
|
8
|
+
attr_accessor :endpoint_id
|
|
9
|
+
# The MessageAttempt's ID.
|
|
10
|
+
attr_accessor :id
|
|
11
|
+
attr_accessor :msg
|
|
12
|
+
# The Message's ID.
|
|
13
|
+
attr_accessor :msg_id
|
|
14
|
+
attr_accessor :response
|
|
15
|
+
# Response duration in milliseconds.
|
|
16
|
+
attr_accessor :response_duration_ms
|
|
17
|
+
attr_accessor :response_status_code
|
|
18
|
+
attr_accessor :status
|
|
19
|
+
attr_accessor :status_text
|
|
20
|
+
attr_accessor :timestamp
|
|
21
|
+
attr_accessor :trigger_type
|
|
22
|
+
attr_accessor :url
|
|
23
|
+
|
|
24
|
+
ALL_FIELD ||= [
|
|
25
|
+
"endpoint_id",
|
|
26
|
+
"id",
|
|
27
|
+
"msg",
|
|
28
|
+
"msg_id",
|
|
29
|
+
"response",
|
|
30
|
+
"response_duration_ms",
|
|
31
|
+
"response_status_code",
|
|
32
|
+
"status",
|
|
33
|
+
"status_text",
|
|
34
|
+
"timestamp",
|
|
35
|
+
"trigger_type",
|
|
36
|
+
"url"
|
|
37
|
+
].freeze
|
|
38
|
+
private_constant :ALL_FIELD
|
|
39
|
+
|
|
40
|
+
def initialize(attributes = {})
|
|
41
|
+
unless attributes.is_a?(Hash)
|
|
42
|
+
fail(ArgumentError, "The input argument (attributes) must be a hash in `HookSniff::MessageAttemptOut` new method")
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
attributes.each do |k, v|
|
|
46
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
47
|
+
fail(ArgumentError, "The field #{k} is not part of HookSniff::MessageAttemptOut")
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
instance_variable_set("@#{k}", v)
|
|
51
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def self.deserialize(attributes = {})
|
|
56
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
57
|
+
attrs = Hash.new
|
|
58
|
+
attrs["endpoint_id"] = attributes["endpointId"]
|
|
59
|
+
attrs["id"] = attributes["id"]
|
|
60
|
+
attrs["msg"] = HookSniff::MessageOut.deserialize(attributes["msg"]) if attributes["msg"]
|
|
61
|
+
attrs["msg_id"] = attributes["msgId"]
|
|
62
|
+
attrs["response"] = attributes["response"]
|
|
63
|
+
attrs["response_duration_ms"] = attributes["responseDurationMs"]
|
|
64
|
+
attrs["response_status_code"] = attributes["responseStatusCode"]
|
|
65
|
+
attrs["status"] = HookSniff::MessageStatus.deserialize(attributes["status"])
|
|
66
|
+
attrs["status_text"] = HookSniff::MessageStatusText.deserialize(attributes["statusText"])
|
|
67
|
+
attrs["timestamp"] = DateTime.rfc3339(attributes["timestamp"]).to_time
|
|
68
|
+
attrs["trigger_type"] = HookSniff::MessageAttemptTriggerType.deserialize(attributes["triggerType"])
|
|
69
|
+
attrs["url"] = attributes["url"]
|
|
70
|
+
new(attrs)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def serialize
|
|
74
|
+
out = Hash.new
|
|
75
|
+
out["endpointId"] = HookSniff::serialize_primitive(@endpoint_id) if @endpoint_id
|
|
76
|
+
out["id"] = HookSniff::serialize_primitive(@id) if @id
|
|
77
|
+
out["msg"] = HookSniff::serialize_schema_ref(@msg) if @msg
|
|
78
|
+
out["msgId"] = HookSniff::serialize_primitive(@msg_id) if @msg_id
|
|
79
|
+
out["response"] = HookSniff::serialize_primitive(@response) if @response
|
|
80
|
+
out["responseDurationMs"] = HookSniff::serialize_primitive(@response_duration_ms) if @response_duration_ms
|
|
81
|
+
out["responseStatusCode"] = HookSniff::serialize_primitive(@response_status_code) if @response_status_code
|
|
82
|
+
out["status"] = HookSniff::serialize_schema_ref(@status) if @status
|
|
83
|
+
out["statusText"] = HookSniff::serialize_schema_ref(@status_text) if @status_text
|
|
84
|
+
out["timestamp"] = HookSniff::serialize_primitive(@timestamp) if @timestamp
|
|
85
|
+
out["triggerType"] = HookSniff::serialize_schema_ref(@trigger_type) if @trigger_type
|
|
86
|
+
out["url"] = HookSniff::serialize_primitive(@url) if @url
|
|
87
|
+
out
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Serializes the object to a json string
|
|
91
|
+
# @return String
|
|
92
|
+
def to_json
|
|
93
|
+
JSON.dump(serialize)
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
module HookSniff
|
|
4
|
+
# The reason an attempt was made:
|
|
5
|
+
#
|
|
6
|
+
# - Scheduled = 0
|
|
7
|
+
# - Manual = 1
|
|
8
|
+
class MessageAttemptTriggerType
|
|
9
|
+
SCHEDULED = 0.freeze
|
|
10
|
+
MANUAL = 1.freeze
|
|
11
|
+
|
|
12
|
+
def self.all_vars
|
|
13
|
+
@all_vars ||= [SCHEDULED, MANUAL].freeze
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def initialize(value)
|
|
17
|
+
unless MessageAttemptTriggerType.all_vars.include?(value)
|
|
18
|
+
raise "Invalid ENUM value '#{value}' for class #MessageAttemptTriggerType"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
@value = value
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def self.deserialize(value)
|
|
25
|
+
return value if MessageAttemptTriggerType.all_vars.include?(value)
|
|
26
|
+
raise "Invalid ENUM value '#{value}' for class #MessageAttemptTriggerType"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def serialize
|
|
30
|
+
@value
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# This file is @generated
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module HookSniff
|
|
6
|
+
class MessageEndpointOut
|
|
7
|
+
# List of message channels this endpoint listens to (omit for all).
|
|
8
|
+
attr_accessor :channels
|
|
9
|
+
attr_accessor :created_at
|
|
10
|
+
# An example endpoint name.
|
|
11
|
+
attr_accessor :description
|
|
12
|
+
attr_accessor :disabled
|
|
13
|
+
attr_accessor :filter_types
|
|
14
|
+
# The Endpoint's ID.
|
|
15
|
+
attr_accessor :id
|
|
16
|
+
attr_accessor :next_attempt
|
|
17
|
+
# Deprecated, use `throttleRate` instead.
|
|
18
|
+
attr_accessor :rate_limit
|
|
19
|
+
attr_accessor :status
|
|
20
|
+
attr_accessor :status_text
|
|
21
|
+
# Maximum messages per second to send to this endpoint.
|
|
22
|
+
#
|
|
23
|
+
# Outgoing messages will be throttled to this rate.
|
|
24
|
+
attr_accessor :throttle_rate
|
|
25
|
+
# Optional unique identifier for the endpoint.
|
|
26
|
+
attr_accessor :uid
|
|
27
|
+
attr_accessor :updated_at
|
|
28
|
+
attr_accessor :url
|
|
29
|
+
attr_accessor :version
|
|
30
|
+
|
|
31
|
+
ALL_FIELD ||= [
|
|
32
|
+
"channels",
|
|
33
|
+
"created_at",
|
|
34
|
+
"description",
|
|
35
|
+
"disabled",
|
|
36
|
+
"filter_types",
|
|
37
|
+
"id",
|
|
38
|
+
"next_attempt",
|
|
39
|
+
"rate_limit",
|
|
40
|
+
"status",
|
|
41
|
+
"status_text",
|
|
42
|
+
"throttle_rate",
|
|
43
|
+
"uid",
|
|
44
|
+
"updated_at",
|
|
45
|
+
"url",
|
|
46
|
+
"version"
|
|
47
|
+
].freeze
|
|
48
|
+
private_constant :ALL_FIELD
|
|
49
|
+
|
|
50
|
+
def initialize(attributes = {})
|
|
51
|
+
unless attributes.is_a?(Hash)
|
|
52
|
+
fail(ArgumentError, "The input argument (attributes) must be a hash in `HookSniff::MessageEndpointOut` new method")
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
attributes.each do |k, v|
|
|
56
|
+
unless ALL_FIELD.include?(k.to_s)
|
|
57
|
+
fail(ArgumentError, "The field #{k} is not part of HookSniff::MessageEndpointOut")
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
instance_variable_set("@#{k}", v)
|
|
61
|
+
instance_variable_set("@__#{k}_is_defined", true)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def self.deserialize(attributes = {})
|
|
66
|
+
attributes = attributes.transform_keys(&:to_s)
|
|
67
|
+
attrs = Hash.new
|
|
68
|
+
attrs["channels"] = attributes["channels"]
|
|
69
|
+
attrs["created_at"] = DateTime.rfc3339(attributes["createdAt"]).to_time
|
|
70
|
+
attrs["description"] = attributes["description"]
|
|
71
|
+
attrs["disabled"] = attributes["disabled"]
|
|
72
|
+
attrs["filter_types"] = attributes["filterTypes"]
|
|
73
|
+
attrs["id"] = attributes["id"]
|
|
74
|
+
attrs["next_attempt"] = DateTime.rfc3339(attributes["nextAttempt"]).to_time if attributes["nextAttempt"]
|
|
75
|
+
attrs["rate_limit"] = attributes["rateLimit"]
|
|
76
|
+
attrs["status"] = HookSniff::MessageStatus.deserialize(attributes["status"])
|
|
77
|
+
attrs["status_text"] = HookSniff::MessageStatusText.deserialize(attributes["statusText"])
|
|
78
|
+
attrs["throttle_rate"] = attributes["throttleRate"]
|
|
79
|
+
attrs["uid"] = attributes["uid"]
|
|
80
|
+
attrs["updated_at"] = DateTime.rfc3339(attributes["updatedAt"]).to_time
|
|
81
|
+
attrs["url"] = attributes["url"]
|
|
82
|
+
attrs["version"] = attributes["version"]
|
|
83
|
+
new(attrs)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def serialize
|
|
87
|
+
out = Hash.new
|
|
88
|
+
out["channels"] = HookSniff::serialize_primitive(@channels) if @channels
|
|
89
|
+
out["createdAt"] = HookSniff::serialize_primitive(@created_at) if @created_at
|
|
90
|
+
out["description"] = HookSniff::serialize_primitive(@description) if @description
|
|
91
|
+
out["disabled"] = HookSniff::serialize_primitive(@disabled) if @disabled
|
|
92
|
+
out["filterTypes"] = HookSniff::serialize_primitive(@filter_types) if @filter_types
|
|
93
|
+
out["id"] = HookSniff::serialize_primitive(@id) if @id
|
|
94
|
+
out["nextAttempt"] = HookSniff::serialize_primitive(@next_attempt) if @next_attempt
|
|
95
|
+
out["rateLimit"] = HookSniff::serialize_primitive(@rate_limit) if @rate_limit
|
|
96
|
+
out["status"] = HookSniff::serialize_schema_ref(@status) if @status
|
|
97
|
+
out["statusText"] = HookSniff::serialize_schema_ref(@status_text) if @status_text
|
|
98
|
+
out["throttleRate"] = HookSniff::serialize_primitive(@throttle_rate) if @throttle_rate
|
|
99
|
+
out["uid"] = HookSniff::serialize_primitive(@uid) if @uid
|
|
100
|
+
out["updatedAt"] = HookSniff::serialize_primitive(@updated_at) if @updated_at
|
|
101
|
+
out["url"] = HookSniff::serialize_primitive(@url) if @url
|
|
102
|
+
out["version"] = HookSniff::serialize_primitive(@version) if @version
|
|
103
|
+
out
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Serializes the object to a json string
|
|
107
|
+
# @return String
|
|
108
|
+
def to_json
|
|
109
|
+
JSON.dump(serialize)
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|