svix 0.85.1 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/svix/api/application_api.rb +1 -1
  4. data/lib/svix/api/authentication_api.rb +1 -1
  5. data/lib/svix/api/background_tasks_api.rb +1 -1
  6. data/lib/svix/api/broadcast_api.rb +90 -0
  7. data/lib/svix/api/endpoint_api.rb +1 -1
  8. data/lib/svix/api/environment_api.rb +1 -1
  9. data/lib/svix/api/environment_settings_api.rb +1 -1
  10. data/lib/svix/api/event_type_api.rb +1 -1
  11. data/lib/svix/api/health_api.rb +1 -1
  12. data/lib/svix/api/integration_api.rb +1 -1
  13. data/lib/svix/api/message_api.rb +110 -1
  14. data/lib/svix/api/message_attempt_api.rb +4 -1
  15. data/lib/svix/api/statistics_api.rb +1 -1
  16. data/lib/svix/api_client.rb +1 -1
  17. data/lib/svix/api_error.rb +1 -1
  18. data/lib/svix/background_tasks_api.rb +17 -0
  19. data/lib/svix/configuration.rb +1 -1
  20. data/lib/svix/endpoint_api.rb +2 -2
  21. data/lib/svix/models/app_portal_access_in.rb +1 -1
  22. data/lib/svix/models/app_portal_access_out.rb +1 -1
  23. data/lib/svix/models/app_usage_stats_in.rb +1 -1
  24. data/lib/svix/models/app_usage_stats_out.rb +1 -1
  25. data/lib/svix/models/application_in.rb +1 -1
  26. data/lib/svix/models/application_out.rb +1 -1
  27. data/lib/svix/models/application_patch.rb +1 -1
  28. data/lib/svix/models/application_stats.rb +1 -1
  29. data/lib/svix/models/application_token_expire_in.rb +1 -1
  30. data/lib/svix/models/attempt_statistics_data.rb +1 -1
  31. data/lib/svix/models/attempt_statistics_response.rb +1 -1
  32. data/lib/svix/models/background_task_out.rb +1 -1
  33. data/lib/svix/models/background_task_status.rb +1 -1
  34. data/lib/svix/models/background_task_type.rb +2 -1
  35. data/lib/svix/models/border_radius_config.rb +1 -1
  36. data/lib/svix/models/border_radius_enum.rb +1 -1
  37. data/lib/svix/models/custom_color_palette.rb +1 -1
  38. data/lib/svix/models/custom_theme_override.rb +1 -1
  39. data/lib/svix/models/dashboard_access_out.rb +1 -1
  40. data/lib/svix/models/endpoint_created_event.rb +1 -1
  41. data/lib/svix/models/endpoint_created_event_data.rb +1 -1
  42. data/lib/svix/models/endpoint_deleted_event.rb +1 -1
  43. data/lib/svix/models/endpoint_deleted_event_data.rb +1 -1
  44. data/lib/svix/models/endpoint_disabled_event.rb +1 -1
  45. data/lib/svix/models/endpoint_disabled_event_data.rb +1 -1
  46. data/lib/svix/models/endpoint_headers_in.rb +1 -1
  47. data/lib/svix/models/endpoint_headers_out.rb +1 -1
  48. data/lib/svix/models/endpoint_headers_patch_in.rb +1 -1
  49. data/lib/svix/models/endpoint_in.rb +1 -1
  50. data/lib/svix/models/endpoint_message_out.rb +1 -1
  51. data/lib/svix/models/endpoint_out.rb +1 -1
  52. data/lib/svix/models/endpoint_patch.rb +1 -1
  53. data/lib/svix/models/endpoint_secret_out.rb +1 -1
  54. data/lib/svix/models/endpoint_secret_rotate_in.rb +1 -1
  55. data/lib/svix/models/endpoint_stats.rb +1 -1
  56. data/lib/svix/models/endpoint_transformation_in.rb +1 -1
  57. data/lib/svix/models/endpoint_transformation_out.rb +1 -1
  58. data/lib/svix/models/endpoint_transformation_simulate_in.rb +1 -1
  59. data/lib/svix/models/endpoint_transformation_simulate_out.rb +1 -1
  60. data/lib/svix/models/endpoint_update.rb +1 -1
  61. data/lib/svix/models/endpoint_updated_event.rb +1 -1
  62. data/lib/svix/models/endpoint_updated_event_data.rb +1 -1
  63. data/lib/svix/models/environment_in.rb +1 -1
  64. data/lib/svix/models/environment_out.rb +1 -1
  65. data/lib/svix/models/environment_settings_out.rb +1 -1
  66. data/lib/svix/models/event_example_in.rb +1 -1
  67. data/lib/svix/models/event_type_example_out.rb +1 -1
  68. data/lib/svix/models/event_type_in.rb +1 -1
  69. data/lib/svix/models/event_type_out.rb +1 -1
  70. data/lib/svix/models/event_type_patch.rb +1 -1
  71. data/lib/svix/models/event_type_schema_in.rb +1 -1
  72. data/lib/svix/models/event_type_update.rb +1 -1
  73. data/lib/svix/models/font_size_config.rb +1 -1
  74. data/lib/svix/models/http_error_out.rb +1 -1
  75. data/lib/svix/models/http_validation_error.rb +1 -1
  76. data/lib/svix/models/integration_in.rb +1 -1
  77. data/lib/svix/models/integration_key_out.rb +1 -1
  78. data/lib/svix/models/integration_out.rb +1 -1
  79. data/lib/svix/models/integration_update.rb +1 -1
  80. data/lib/svix/models/list_response_application_out.rb +1 -1
  81. data/lib/svix/models/list_response_application_stats.rb +1 -1
  82. data/lib/svix/models/list_response_background_task_out.rb +1 -1
  83. data/lib/svix/models/list_response_endpoint_message_out.rb +1 -1
  84. data/lib/svix/models/list_response_endpoint_out.rb +1 -1
  85. data/lib/svix/models/list_response_event_type_out.rb +1 -1
  86. data/lib/svix/models/list_response_integration_out.rb +1 -1
  87. data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +1 -1
  88. data/lib/svix/models/list_response_message_attempt_out.rb +1 -1
  89. data/lib/svix/models/list_response_message_endpoint_out.rb +1 -1
  90. data/lib/svix/models/list_response_message_out.rb +1 -1
  91. data/lib/svix/models/message_attempt_endpoint_out.rb +1 -1
  92. data/lib/svix/models/message_attempt_exhausted_event.rb +1 -1
  93. data/lib/svix/models/message_attempt_exhausted_event_data.rb +1 -1
  94. data/lib/svix/models/message_attempt_failed_data.rb +1 -1
  95. data/lib/svix/models/message_attempt_failing_event.rb +1 -1
  96. data/lib/svix/models/message_attempt_failing_event_data.rb +1 -1
  97. data/lib/svix/models/message_attempt_headers_out.rb +1 -1
  98. data/lib/svix/models/message_attempt_out.rb +1 -1
  99. data/lib/svix/models/message_attempt_trigger_type.rb +1 -1
  100. data/lib/svix/models/message_broadcast_in.rb +386 -0
  101. data/lib/svix/models/message_broadcast_out.rb +251 -0
  102. data/lib/svix/models/message_endpoint_out.rb +1 -1
  103. data/lib/svix/models/message_in.rb +1 -1
  104. data/lib/svix/models/message_out.rb +1 -1
  105. data/lib/svix/models/message_status.rb +1 -1
  106. data/lib/svix/models/one_time_token_in.rb +1 -1
  107. data/lib/svix/models/one_time_token_out.rb +1 -1
  108. data/lib/svix/models/ordering.rb +1 -1
  109. data/lib/svix/models/recover_in.rb +1 -1
  110. data/lib/svix/models/recover_out.rb +1 -1
  111. data/lib/svix/models/replay_in.rb +1 -1
  112. data/lib/svix/models/replay_out.rb +1 -1
  113. data/lib/svix/models/settings_in.rb +1 -1
  114. data/lib/svix/models/settings_out.rb +1 -1
  115. data/lib/svix/models/statistics_period.rb +1 -1
  116. data/lib/svix/models/status_code_class.rb +1 -1
  117. data/lib/svix/models/transformation_http_method.rb +1 -1
  118. data/lib/svix/models/validation_error.rb +1 -1
  119. data/lib/svix/version.rb +1 -1
  120. metadata +6 -2
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Welcome to the Svix API documentation! Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/) # Introduction This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com). ## Main concepts In Svix you have four important entities you will be interacting with: - `messages`: these are the webhooks being sent. They can have contents and a few other properties. - `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint. ## Authentication Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. For more information on authentication, please refer to the [authentication token docs](https://docs.svix.com/api-keys). <SecurityDefinitions /> ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
5
5
 
6
- The version of the OpenAPI document: 1.4.1
6
+ The version of the OpenAPI document: 1.4.12
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Welcome to the Svix API documentation! Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/) # Introduction This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com). ## Main concepts In Svix you have four important entities you will be interacting with: - `messages`: these are the webhooks being sent. They can have contents and a few other properties. - `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint. ## Authentication Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. For more information on authentication, please refer to the [authentication token docs](https://docs.svix.com/api-keys). <SecurityDefinitions /> ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
5
5
 
6
- The version of the OpenAPI document: 1.4.1
6
+ The version of the OpenAPI document: 1.4.12
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Welcome to the Svix API documentation! Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/) # Introduction This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com). ## Main concepts In Svix you have four important entities you will be interacting with: - `messages`: these are the webhooks being sent. They can have contents and a few other properties. - `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint. ## Authentication Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. For more information on authentication, please refer to the [authentication token docs](https://docs.svix.com/api-keys). <SecurityDefinitions /> ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
5
5
 
6
- The version of the OpenAPI document: 1.4.1
6
+ The version of the OpenAPI document: 1.4.12
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Welcome to the Svix API documentation! Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/) # Introduction This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com). ## Main concepts In Svix you have four important entities you will be interacting with: - `messages`: these are the webhooks being sent. They can have contents and a few other properties. - `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint. ## Authentication Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. For more information on authentication, please refer to the [authentication token docs](https://docs.svix.com/api-keys). <SecurityDefinitions /> ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
5
5
 
6
- The version of the OpenAPI document: 1.4.1
6
+ The version of the OpenAPI document: 1.4.12
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.2.0
@@ -0,0 +1,386 @@
1
+ =begin
2
+ #Svix API
3
+
4
+ #Welcome to the Svix API documentation! Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/) # Introduction This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com). ## Main concepts In Svix you have four important entities you will be interacting with: - `messages`: these are the webhooks being sent. They can have contents and a few other properties. - `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint. ## Authentication Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. For more information on authentication, please refer to the [authentication token docs](https://docs.svix.com/api-keys). <SecurityDefinitions /> ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
5
+
6
+ The version of the OpenAPI document: 1.4.12
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Svix
17
+ class MessageBroadcastIn
18
+ # List of free-form identifiers that endpoints can filter by
19
+ attr_accessor :channels
20
+
21
+ # Optional unique identifier for the message
22
+ attr_accessor :event_id
23
+
24
+ # The event type's name
25
+ attr_accessor :event_type
26
+
27
+ attr_accessor :payload
28
+
29
+ attr_accessor :payload_retention_period
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'channels' => :'channels',
35
+ :'event_id' => :'eventId',
36
+ :'event_type' => :'eventType',
37
+ :'payload' => :'payload',
38
+ :'payload_retention_period' => :'payloadRetentionPeriod'
39
+ }
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'channels' => :'Array<String>',
51
+ :'event_id' => :'String',
52
+ :'event_type' => :'String',
53
+ :'payload' => :'Object',
54
+ :'payload_retention_period' => :'Integer'
55
+ }
56
+ end
57
+
58
+ # List of attributes with nullable: true
59
+ def self.openapi_nullable
60
+ Set.new([
61
+ :'channels',
62
+ :'event_id',
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 `Svix::MessageBroadcastIn` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Svix::MessageBroadcastIn`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'channels')
82
+ if (value = attributes[:'channels']).is_a?(Array)
83
+ self.channels = value
84
+ end
85
+ end
86
+
87
+ if attributes.key?(:'event_id')
88
+ self.event_id = attributes[:'event_id']
89
+ end
90
+
91
+ if attributes.key?(:'event_type')
92
+ self.event_type = attributes[:'event_type']
93
+ end
94
+
95
+ if attributes.key?(:'payload')
96
+ self.payload = attributes[:'payload']
97
+ end
98
+
99
+ if attributes.key?(:'payload_retention_period')
100
+ self.payload_retention_period = attributes[:'payload_retention_period']
101
+ else
102
+ self.payload_retention_period = 90
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ invalid_properties = Array.new
110
+ if !@channels.nil? && @channels.length > 5
111
+ invalid_properties.push('invalid value for "channels", number of items must be less than or equal to 5.')
112
+ end
113
+
114
+ if !@channels.nil? && @channels.length < 1
115
+ invalid_properties.push('invalid value for "channels", number of items must be greater than or equal to 1.')
116
+ end
117
+
118
+ if !@event_id.nil? && @event_id.to_s.length > 256
119
+ invalid_properties.push('invalid value for "event_id", the character length must be smaller than or equal to 256.')
120
+ end
121
+
122
+ if !@event_id.nil? && @event_id.to_s.length < 1
123
+ invalid_properties.push('invalid value for "event_id", the character length must be great than or equal to 1.')
124
+ end
125
+
126
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
127
+ if !@event_id.nil? && @event_id !~ pattern
128
+ invalid_properties.push("invalid value for \"event_id\", must conform to the pattern #{pattern}.")
129
+ end
130
+
131
+ if @event_type.nil?
132
+ invalid_properties.push('invalid value for "event_type", event_type cannot be nil.')
133
+ end
134
+
135
+ if @event_type.to_s.length > 256
136
+ invalid_properties.push('invalid value for "event_type", the character length must be smaller than or equal to 256.')
137
+ end
138
+
139
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
140
+ if @event_type !~ pattern
141
+ invalid_properties.push("invalid value for \"event_type\", must conform to the pattern #{pattern}.")
142
+ end
143
+
144
+ if @payload.nil?
145
+ invalid_properties.push('invalid value for "payload", payload cannot be nil.')
146
+ end
147
+
148
+ if !@payload_retention_period.nil? && @payload_retention_period > 90
149
+ invalid_properties.push('invalid value for "payload_retention_period", must be smaller than or equal to 90.')
150
+ end
151
+
152
+ if !@payload_retention_period.nil? && @payload_retention_period < 5
153
+ invalid_properties.push('invalid value for "payload_retention_period", must be greater than or equal to 5.')
154
+ end
155
+
156
+ invalid_properties
157
+ end
158
+
159
+ # Check to see if the all the properties in the model are valid
160
+ # @return true if the model is valid
161
+ def valid?
162
+ return false if !@channels.nil? && @channels.length > 5
163
+ return false if !@channels.nil? && @channels.length < 1
164
+ return false if !@event_id.nil? && @event_id.to_s.length > 256
165
+ return false if !@event_id.nil? && @event_id.to_s.length < 1
166
+ return false if !@event_id.nil? && @event_id !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
167
+ return false if @event_type.nil?
168
+ return false if @event_type.to_s.length > 256
169
+ return false if @event_type !~ Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
170
+ return false if @payload.nil?
171
+ return false if !@payload_retention_period.nil? && @payload_retention_period > 90
172
+ return false if !@payload_retention_period.nil? && @payload_retention_period < 5
173
+ true
174
+ end
175
+
176
+ # Custom attribute writer method with validation
177
+ # @param [Object] channels Value to be assigned
178
+ def channels=(channels)
179
+ if !channels.nil? && channels.length > 5
180
+ fail ArgumentError, 'invalid value for "channels", number of items must be less than or equal to 5.'
181
+ end
182
+
183
+ if !channels.nil? && channels.length < 1
184
+ fail ArgumentError, 'invalid value for "channels", number of items must be greater than or equal to 1.'
185
+ end
186
+
187
+ @channels = channels
188
+ end
189
+
190
+ # Custom attribute writer method with validation
191
+ # @param [Object] event_id Value to be assigned
192
+ def event_id=(event_id)
193
+ if !event_id.nil? && event_id.to_s.length > 256
194
+ fail ArgumentError, 'invalid value for "event_id", the character length must be smaller than or equal to 256.'
195
+ end
196
+
197
+ if !event_id.nil? && event_id.to_s.length < 1
198
+ fail ArgumentError, 'invalid value for "event_id", the character length must be great than or equal to 1.'
199
+ end
200
+
201
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
202
+ if !event_id.nil? && event_id !~ pattern
203
+ fail ArgumentError, "invalid value for \"event_id\", must conform to the pattern #{pattern}."
204
+ end
205
+
206
+ @event_id = event_id
207
+ end
208
+
209
+ # Custom attribute writer method with validation
210
+ # @param [Object] event_type Value to be assigned
211
+ def event_type=(event_type)
212
+ if event_type.nil?
213
+ fail ArgumentError, 'event_type cannot be nil'
214
+ end
215
+
216
+ if event_type.to_s.length > 256
217
+ fail ArgumentError, 'invalid value for "event_type", the character length must be smaller than or equal to 256.'
218
+ end
219
+
220
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
221
+ if event_type !~ pattern
222
+ fail ArgumentError, "invalid value for \"event_type\", must conform to the pattern #{pattern}."
223
+ end
224
+
225
+ @event_type = event_type
226
+ end
227
+
228
+ # Custom attribute writer method with validation
229
+ # @param [Object] payload_retention_period Value to be assigned
230
+ def payload_retention_period=(payload_retention_period)
231
+ if !payload_retention_period.nil? && payload_retention_period > 90
232
+ fail ArgumentError, 'invalid value for "payload_retention_period", must be smaller than or equal to 90.'
233
+ end
234
+
235
+ if !payload_retention_period.nil? && payload_retention_period < 5
236
+ fail ArgumentError, 'invalid value for "payload_retention_period", must be greater than or equal to 5.'
237
+ end
238
+
239
+ @payload_retention_period = payload_retention_period
240
+ end
241
+
242
+ # Checks equality by comparing each attribute.
243
+ # @param [Object] Object to be compared
244
+ def ==(o)
245
+ return true if self.equal?(o)
246
+ self.class == o.class &&
247
+ channels == o.channels &&
248
+ event_id == o.event_id &&
249
+ event_type == o.event_type &&
250
+ payload == o.payload &&
251
+ payload_retention_period == o.payload_retention_period
252
+ end
253
+
254
+ # @see the `==` method
255
+ # @param [Object] Object to be compared
256
+ def eql?(o)
257
+ self == o
258
+ end
259
+
260
+ # Calculates hash code according to all attributes.
261
+ # @return [Integer] Hash code
262
+ def hash
263
+ [channels, event_id, event_type, payload, payload_retention_period].hash
264
+ end
265
+
266
+ # Builds the object from hash
267
+ # @param [Hash] attributes Model attributes in the form of hash
268
+ # @return [Object] Returns the model itself
269
+ def self.build_from_hash(attributes)
270
+ new.build_from_hash(attributes)
271
+ end
272
+
273
+ # Builds the object from hash
274
+ # @param [Hash] attributes Model attributes in the form of hash
275
+ # @return [Object] Returns the model itself
276
+ def build_from_hash(attributes)
277
+ return nil unless attributes.is_a?(Hash)
278
+ self.class.openapi_types.each_pair do |key, type|
279
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
280
+ self.send("#{key}=", nil)
281
+ elsif type =~ /\AArray<(.*)>/i
282
+ # check to ensure the input is an array given that the attribute
283
+ # is documented as an array but the input is not
284
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
285
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
286
+ end
287
+ elsif !attributes[self.class.attribute_map[key]].nil?
288
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
289
+ end
290
+ end
291
+
292
+ self
293
+ end
294
+
295
+ # Deserializes the data based on type
296
+ # @param string type Data type
297
+ # @param string value Value to be deserialized
298
+ # @return [Object] Deserialized data
299
+ def _deserialize(type, value)
300
+ case type.to_sym
301
+ when :Time
302
+ Time.parse(value)
303
+ when :Date
304
+ Date.parse(value)
305
+ when :String
306
+ value.to_s
307
+ when :Integer
308
+ value.to_i
309
+ when :Float
310
+ value.to_f
311
+ when :Boolean
312
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
313
+ true
314
+ else
315
+ false
316
+ end
317
+ when :Object
318
+ # generic object (usually a Hash), return directly
319
+ value
320
+ when /\AArray<(?<inner_type>.+)>\z/
321
+ inner_type = Regexp.last_match[:inner_type]
322
+ value.map { |v| _deserialize(inner_type, v) }
323
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
324
+ k_type = Regexp.last_match[:k_type]
325
+ v_type = Regexp.last_match[:v_type]
326
+ {}.tap do |hash|
327
+ value.each do |k, v|
328
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
329
+ end
330
+ end
331
+ else # model
332
+ # models (e.g. Pet) or oneOf
333
+ klass = Svix.const_get(type)
334
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
335
+ end
336
+ end
337
+
338
+ # Returns the string representation of the object
339
+ # @return [String] String presentation of the object
340
+ def to_s
341
+ to_hash.to_s
342
+ end
343
+
344
+ # to_body is an alias to to_hash (backward compatibility)
345
+ # @return [Hash] Returns the object in the form of hash
346
+ def to_body
347
+ to_hash
348
+ end
349
+
350
+ # Returns the object in the form of hash
351
+ # @return [Hash] Returns the object in the form of hash
352
+ def to_hash
353
+ hash = {}
354
+ self.class.attribute_map.each_pair do |attr, param|
355
+ value = self.send(attr)
356
+ if value.nil?
357
+ is_nullable = self.class.openapi_nullable.include?(attr)
358
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
359
+ end
360
+
361
+ hash[param] = _to_hash(value)
362
+ end
363
+ hash
364
+ end
365
+
366
+ # Outputs non-array value in the form of hash
367
+ # For object, use to_hash. Otherwise, just return the value
368
+ # @param [Object] value Any valid value
369
+ # @return [Hash] Returns the value in the form of hash
370
+ def _to_hash(value)
371
+ if value.is_a?(Array)
372
+ value.compact.map { |v| _to_hash(v) }
373
+ elsif value.is_a?(Hash)
374
+ {}.tap do |hash|
375
+ value.each { |k, v| hash[k] = _to_hash(v) }
376
+ end
377
+ elsif value.respond_to? :to_hash
378
+ value.to_hash
379
+ else
380
+ value
381
+ end
382
+ end
383
+
384
+ end
385
+
386
+ end