sendx-ruby-sdk 1.1.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +220 -81
  3. data/lib/sendx-ruby-sdk/api/campaign_api.rb +95 -143
  4. data/lib/sendx-ruby-sdk/api/contact_api.rb +129 -96
  5. data/lib/sendx-ruby-sdk/api/custom_field_api.rb +391 -0
  6. data/lib/sendx-ruby-sdk/api/email_sending_api.rb +158 -0
  7. data/lib/sendx-ruby-sdk/api/event_api.rb +91 -57
  8. data/lib/sendx-ruby-sdk/api/events_api.rb +158 -0
  9. data/lib/sendx-ruby-sdk/api/getting_started_api.rb +2 -2
  10. data/lib/sendx-ruby-sdk/api/list_api.rb +126 -91
  11. data/lib/sendx-ruby-sdk/api/post_api.rb +380 -0
  12. data/lib/sendx-ruby-sdk/api/post_category_api.rb +362 -0
  13. data/lib/sendx-ruby-sdk/api/post_tag_api.rb +362 -0
  14. data/lib/sendx-ruby-sdk/api/report_api.rb +90 -0
  15. data/lib/sendx-ruby-sdk/api/reports_api.rb +4 -4
  16. data/lib/sendx-ruby-sdk/api/sender_api.rb +28 -37
  17. data/lib/sendx-ruby-sdk/api/tag_api.rb +380 -0
  18. data/lib/sendx-ruby-sdk/api/tags_api.rb +8 -8
  19. data/lib/sendx-ruby-sdk/api/team_member_api.rb +147 -0
  20. data/lib/sendx-ruby-sdk/api/template_api.rb +391 -0
  21. data/lib/sendx-ruby-sdk/api/tracking_api.rb +158 -0
  22. data/lib/sendx-ruby-sdk/api/webhook_api.rb +362 -0
  23. data/lib/sendx-ruby-sdk/api_client.rb +10 -11
  24. data/lib/sendx-ruby-sdk/api_error.rb +3 -3
  25. data/lib/sendx-ruby-sdk/configuration.rb +6 -10
  26. data/lib/sendx-ruby-sdk/models/campaign.rb +23 -7
  27. data/lib/sendx-ruby-sdk/models/campaign_dashboard_data.rb +11 -5
  28. data/lib/sendx-ruby-sdk/models/campaign_request.rb +13 -41
  29. data/lib/sendx-ruby-sdk/models/contact.rb +11 -5
  30. data/lib/sendx-ruby-sdk/models/contact_request.rb +11 -5
  31. data/lib/sendx-ruby-sdk/models/create_response.rb +11 -5
  32. data/lib/sendx-ruby-sdk/models/custom_event_request.rb +37 -42
  33. data/lib/sendx-ruby-sdk/models/custom_field.rb +285 -0
  34. data/lib/sendx-ruby-sdk/models/customfield_customfield_id_delete200_response.rb +220 -0
  35. data/lib/sendx-ruby-sdk/models/dashboard_stats.rb +11 -5
  36. data/lib/sendx-ruby-sdk/models/delete_campaign200_response.rb +11 -5
  37. data/lib/sendx-ruby-sdk/models/delete_request.rb +11 -5
  38. data/lib/sendx-ruby-sdk/models/delete_response.rb +77 -13
  39. data/lib/sendx-ruby-sdk/models/e_custom_field.rb +295 -0
  40. data/lib/sendx-ruby-sdk/models/error_response.rb +288 -0
  41. data/lib/sendx-ruby-sdk/models/event_response.rb +13 -19
  42. data/lib/sendx-ruby-sdk/models/events_revenue_postback_get200_response.rb +229 -0
  43. data/lib/sendx-ruby-sdk/models/events_revenue_postback_get400_response.rb +220 -0
  44. data/lib/sendx-ruby-sdk/models/events_revenue_postback_get500_response.rb +220 -0
  45. data/lib/sendx-ruby-sdk/models/identify_error_response.rb +220 -0
  46. data/lib/sendx-ruby-sdk/models/identify_request.rb +52 -40
  47. data/lib/sendx-ruby-sdk/models/identify_response.rb +16 -19
  48. data/lib/sendx-ruby-sdk/models/last_sent_campaign_stat.rb +11 -5
  49. data/lib/sendx-ruby-sdk/models/link_stat.rb +232 -0
  50. data/lib/sendx-ruby-sdk/models/list_model.rb +11 -6
  51. data/lib/sendx-ruby-sdk/models/list_request.rb +11 -5
  52. data/lib/sendx-ruby-sdk/models/message_response.rb +229 -0
  53. data/lib/sendx-ruby-sdk/models/operation_response.rb +241 -0
  54. data/lib/sendx-ruby-sdk/models/postback_response.rb +229 -0
  55. data/lib/sendx-ruby-sdk/models/report_data.rb +11 -5
  56. data/lib/sendx-ruby-sdk/models/response.rb +11 -5
  57. data/lib/sendx-ruby-sdk/models/rest_e_campaign.rb +539 -0
  58. data/lib/sendx-ruby-sdk/models/rest_e_contact.rb +380 -0
  59. data/lib/sendx-ruby-sdk/models/rest_e_custom_field.rb +299 -0
  60. data/lib/sendx-ruby-sdk/models/rest_e_list.rb +238 -0
  61. data/lib/sendx-ruby-sdk/models/rest_e_post.rb +443 -0
  62. data/lib/sendx-ruby-sdk/models/rest_e_post_category.rb +238 -0
  63. data/lib/sendx-ruby-sdk/models/rest_e_post_tag.rb +238 -0
  64. data/lib/sendx-ruby-sdk/models/rest_e_sender.rb +265 -0
  65. data/lib/sendx-ruby-sdk/models/rest_e_tag.rb +238 -0
  66. data/lib/sendx-ruby-sdk/models/rest_e_template.rb +307 -0
  67. data/lib/sendx-ruby-sdk/models/rest_e_webhook.rb +349 -0
  68. data/lib/sendx-ruby-sdk/models/rest_r_campaign.rb +580 -0
  69. data/lib/sendx-ruby-sdk/models/rest_r_contact.rb +438 -0
  70. data/lib/sendx-ruby-sdk/models/rest_r_custom_field.rb +306 -0
  71. data/lib/sendx-ruby-sdk/models/rest_r_list.rb +291 -0
  72. data/lib/sendx-ruby-sdk/models/rest_r_member.rb +274 -0
  73. data/lib/sendx-ruby-sdk/models/rest_r_post.rb +384 -0
  74. data/lib/sendx-ruby-sdk/models/rest_r_post_category.rb +251 -0
  75. data/lib/sendx-ruby-sdk/models/rest_r_post_tag.rb +250 -0
  76. data/lib/sendx-ruby-sdk/models/rest_r_sender.rb +272 -0
  77. data/lib/sendx-ruby-sdk/models/rest_r_tag.rb +272 -0
  78. data/lib/sendx-ruby-sdk/models/rest_r_template.rb +366 -0
  79. data/lib/sendx-ruby-sdk/models/rest_r_webhook.rb +326 -0
  80. data/lib/sendx-ruby-sdk/models/rest_report_data.rb +312 -0
  81. data/lib/sendx-ruby-sdk/models/revenue_event_request.rb +37 -42
  82. data/lib/sendx-ruby-sdk/models/sender.rb +41 -5
  83. data/lib/sendx-ruby-sdk/models/sender_request.rb +31 -5
  84. data/lib/sendx-ruby-sdk/models/sender_response.rb +51 -5
  85. data/lib/sendx-ruby-sdk/models/tag.rb +11 -5
  86. data/lib/sendx-ruby-sdk/models/tag_request.rb +11 -5
  87. data/lib/sendx-ruby-sdk/models/template_email_message.rb +337 -0
  88. data/lib/sendx-ruby-sdk/models/track_request.rb +28 -20
  89. data/lib/sendx-ruby-sdk/models/track_response.rb +12 -6
  90. data/lib/sendx-ruby-sdk/models/webhook.rb +311 -0
  91. data/lib/sendx-ruby-sdk/models/webhook_object.rb +451 -0
  92. data/lib/sendx-ruby-sdk/models/webhook_request.rb +291 -0
  93. data/lib/sendx-ruby-sdk/models/x_attachment.rb +263 -0
  94. data/lib/sendx-ruby-sdk/models/x_email_message.rb +356 -0
  95. data/lib/sendx-ruby-sdk/models/x_email_response.rb +261 -0
  96. data/lib/sendx-ruby-sdk/models/x_from.rb +246 -0
  97. data/lib/sendx-ruby-sdk/models/x_reply_to.rb +246 -0
  98. data/lib/sendx-ruby-sdk/models/xto.rb +279 -0
  99. data/lib/sendx-ruby-sdk/version.rb +4 -4
  100. data/lib/sendx-ruby-sdk.rb +53 -25
  101. data/spec/api/custom_field_api_spec.rb +98 -0
  102. data/spec/api/email_sending_api_spec.rb +59 -0
  103. data/spec/api/events_api_spec.rb +59 -0
  104. data/spec/api/post_api_spec.rb +97 -0
  105. data/spec/api/post_category_api_spec.rb +95 -0
  106. data/spec/api/post_tag_api_spec.rb +95 -0
  107. data/spec/api/report_api_spec.rb +47 -0
  108. data/spec/api/tag_api_spec.rb +97 -0
  109. data/spec/api/team_member_api_spec.rb +58 -0
  110. data/spec/api/template_api_spec.rb +98 -0
  111. data/spec/api/tracking_api_spec.rb +59 -0
  112. data/spec/api/webhook_api_spec.rb +95 -0
  113. data/spec/models/custom_field_spec.rb +58 -0
  114. data/spec/models/customfield_customfield_id_delete200_response_spec.rb +36 -0
  115. data/spec/models/e_custom_field_spec.rb +64 -0
  116. data/spec/models/error_response_spec.rb +46 -0
  117. data/spec/models/events_revenue_postback_get200_response_spec.rb +42 -0
  118. data/spec/models/events_revenue_postback_get400_response_spec.rb +36 -0
  119. data/spec/models/events_revenue_postback_get500_response_spec.rb +36 -0
  120. data/spec/models/identify_error_response_spec.rb +36 -0
  121. data/spec/models/link_stat_spec.rb +42 -0
  122. data/spec/models/message_response_spec.rb +42 -0
  123. data/spec/models/operation_response_spec.rb +48 -0
  124. data/spec/models/postback_response_spec.rb +42 -0
  125. data/spec/models/rest_e_campaign_spec.rb +154 -0
  126. data/spec/models/rest_e_contact_spec.rb +78 -0
  127. data/spec/models/rest_e_custom_field_spec.rb +52 -0
  128. data/spec/models/rest_e_list_spec.rb +36 -0
  129. data/spec/models/rest_e_post_category_spec.rb +36 -0
  130. data/spec/models/rest_e_post_spec.rb +144 -0
  131. data/spec/models/rest_e_post_tag_spec.rb +36 -0
  132. data/spec/models/rest_e_sender_spec.rb +42 -0
  133. data/spec/models/rest_e_tag_spec.rb +36 -0
  134. data/spec/models/rest_e_template_spec.rb +66 -0
  135. data/spec/models/rest_e_webhook_spec.rb +84 -0
  136. data/spec/models/rest_r_campaign_spec.rb +178 -0
  137. data/spec/models/rest_r_contact_spec.rb +150 -0
  138. data/spec/models/rest_r_custom_field_spec.rb +58 -0
  139. data/spec/models/rest_r_list_spec.rb +64 -0
  140. data/spec/models/rest_r_member_spec.rb +72 -0
  141. data/spec/models/rest_r_post_category_spec.rb +54 -0
  142. data/spec/models/rest_r_post_spec.rb +144 -0
  143. data/spec/models/rest_r_post_tag_spec.rb +54 -0
  144. data/spec/models/rest_r_sender_spec.rb +54 -0
  145. data/spec/models/rest_r_tag_spec.rb +54 -0
  146. data/spec/models/rest_r_template_spec.rb +94 -0
  147. data/spec/models/rest_r_webhook_spec.rb +90 -0
  148. data/spec/models/rest_report_data_spec.rb +90 -0
  149. data/spec/models/template_email_message_spec.rb +72 -0
  150. data/spec/models/webhook_object_spec.rb +180 -0
  151. data/spec/models/webhook_request_spec.rb +78 -0
  152. data/spec/models/webhook_spec.rb +90 -0
  153. data/spec/models/x_attachment_spec.rb +42 -0
  154. data/spec/models/x_email_message_spec.rb +90 -0
  155. data/spec/models/x_email_response_spec.rb +60 -0
  156. data/spec/models/x_from_spec.rb +42 -0
  157. data/spec/models/x_reply_to_spec.rb +42 -0
  158. data/spec/models/xto_spec.rb +60 -0
  159. data/spec/spec_helper.rb +3 -3
  160. metadata +202 -28
@@ -1,12 +1,12 @@
1
1
  =begin
2
2
  #SendX REST API
3
3
 
4
- ## Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request. <br>
4
+ ## SendX REST API Documentation ## 🚀 Introduction The SendX API is organized around REST principles. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. **Key Features:** - 🔒 **Security**: Team-based authentication with optional member-level access - 🎯 **Resource-Oriented**: RESTful design with clear resource boundaries - 📊 **Rich Data Models**: Three-layer model system (Input/Output/Internal) - 🔗 **Relationships**: Automatic prefix handling for resource relationships - 📈 **Scalable**: Built for high-volume email marketing operations ## 🏗️ Architecture Overview SendX uses a three-layer model architecture: 1. **Input Models** (`RestE*`): For API requests 2. **Output Models** (`RestR*`): For API responses with prefixed IDs 3. **Internal Models**: Core business logic (not exposed in API) ## 🔐 Security & Authentication SendX uses API key authentication: ### Team API Key ```http X-Team-ApiKey: YOUR_TEAM_API_KEY ``` - **Required for all requests** - Team-level access to resources - Available in SendX Settings → Team API Key ## 🆔 Encrypted ID System SendX uses encrypted IDs for security and better developer experience: - **Internal IDs**: Sequential integers (not exposed) - **Encrypted IDs**: 22-character alphanumeric strings - **Prefixed IDs**: Resource-type prefixes in API responses (`contact_<22-char-id>`) ### ID Format **All resource IDs follow this pattern:** ``` <resource_prefix>_<22_character_alphanumeric_string> ``` **Example:** ```json { \"id\": \"contact_BnKjkbBBS500CoBCP0oChQ\", \"lists\": [\"list_OcuxJHdiAvujmwQVJfd3ss\", \"list_0tOFLp5RgV7s3LNiHrjGYs\"], \"tags\": [\"tag_UhsDkjL772Qbj5lWtT62VK\", \"tag_fL7t9lsnZ9swvx2HrtQ9wM\"] } ``` ## 📚 Resource Prefixes | Resource | Prefix | Example | |----------|--------|---------| | Contact | `contact_` | `contact_BnKjkbBBS500CoBCP0oChQ` | | Campaign | `campaign_` | `campaign_LUE9BTxmksSmqHWbh96zsn` | | List | `list_` | `list_OcuxJHdiAvujmwQVJfd3ss` | | Tag | `tag_` | `tag_UhsDkjL772Qbj5lWtT62VK` | | Sender | `sender_` | `sender_4vK3WFhMgvOwUNyaL4QxCD` | | Template | `template_` | `template_f3lJvTEhSjKGVb5Lwc5SWS` | | Custom Field | `field_` | `field_MnuqBAG2NPLm7PZMWbjQxt` | | Webhook | `webhook_` | `webhook_9l154iiXlZoPo7vngmamee` | | Post | `post_` | `post_XyZ123aBc456DeF789GhI` | | Post Category | `post_category_` | `post_category_YzS1wOU20yw87UUHKxMzwn` | | Post Tag | `post_tag_` | `post_tag_123XyZ456AbC` | | Member | `member_` | `member_JkL012MnO345PqR678` | ## 🎯 Best Practices ### Error Handling - **Always check status codes**: 2xx = success, 4xx = client error, 5xx = server error - **Read error messages**: Descriptive messages help debug issues - **Handle rate limits**: Respect API rate limits for optimal performance ### Data Validation - **Email format**: Must be valid email addresses - **Required fields**: Check documentation for mandatory fields - **Field lengths**: Respect maximum length constraints ### Performance - **Pagination**: Use offset/limit for large datasets - **Batch operations**: Process multiple items when supported - **Caching**: Cache responses when appropriate ## 🛠️ SDKs & Integration Official SDKs available for: - [Golang](https://github.com/sendx/sendx-go-sdk) - [Python](https://github.com/sendx/sendx-python-sdk) - [Ruby](https://github.com/sendx/sendx-ruby-sdk) - [Java](https://github.com/sendx/sendx-java-sdk) - [PHP](https://github.com/sendx/sendx-php-sdk) - [JavaScript](https://github.com/sendx/sendx-javascript-sdk) ## 📞 Support Need help? Contact us: - 💬 **Website Chat**: Available on sendx.io - 📧 **Email**: hello@sendx.io - 📚 **Documentation**: Full guides at help.sendx.io --- **API Endpoint:** `https://api.sendx.io/api/v1/rest` [<img src=\"https://run.pstmn.io/button.svg\" alt=\"Run In Postman\" style=\"width: 128px; height: 32px;\">](https://god.gw.postman.com/run-collection/33476323-44b198b0-5219-4619-a01f-cfc24d573885?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D33476323-44b198b0-5219-4619-a01f-cfc24d573885%26entityType%3Dcollection%26workspaceId%3D6b1e4f65-96a9-4136-9512-6266c852517e)
5
5
 
6
6
  The version of the OpenAPI document: 1.0.0
7
- Contact: support@sendx.io
7
+ Contact: hello@sendx.io
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.8.0
9
+ Generator version: 7.13.0
10
10
 
11
11
  =end
12
12
 
@@ -15,33 +15,31 @@ require 'time'
15
15
 
16
16
  module SendX
17
17
  class EventResponse
18
- # Unique identifier for the created event.
19
- attr_accessor :event_id
20
-
21
- # Status of the event creation (e.g., 'success').
22
18
  attr_accessor :status
23
19
 
24
- # Additional message about the event creation.
25
20
  attr_accessor :message
26
21
 
27
22
  # Attribute mapping from ruby-style variable name to JSON key.
28
23
  def self.attribute_map
29
24
  {
30
- :'event_id' => :'event_id',
31
25
  :'status' => :'status',
32
26
  :'message' => :'message'
33
27
  }
34
28
  end
35
29
 
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
36
35
  # Returns all the JSON keys this model knows about
37
36
  def self.acceptable_attributes
38
- attribute_map.values
37
+ acceptable_attribute_map.values
39
38
  end
40
39
 
41
40
  # Attribute type mapping.
42
41
  def self.openapi_types
43
42
  {
44
- :'event_id' => :'String',
45
43
  :'status' => :'String',
46
44
  :'message' => :'String'
47
45
  }
@@ -61,17 +59,14 @@ module SendX
61
59
  end
62
60
 
63
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
64
63
  attributes = attributes.each_with_object({}) { |(k, v), h|
65
- if (!self.class.attribute_map.key?(k.to_sym))
66
- fail ArgumentError, "`#{k}` is not a valid attribute in `SendX::EventResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SendX::EventResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
66
  end
68
67
  h[k.to_sym] = v
69
68
  }
70
69
 
71
- if attributes.key?(:'event_id')
72
- self.event_id = attributes[:'event_id']
73
- end
74
-
75
70
  if attributes.key?(:'status')
76
71
  self.status = attributes[:'status']
77
72
  end
@@ -101,7 +96,6 @@ module SendX
101
96
  def ==(o)
102
97
  return true if self.equal?(o)
103
98
  self.class == o.class &&
104
- event_id == o.event_id &&
105
99
  status == o.status &&
106
100
  message == o.message
107
101
  end
@@ -115,7 +109,7 @@ module SendX
115
109
  # Calculates hash code according to all attributes.
116
110
  # @return [Integer] Hash code
117
111
  def hash
118
- [event_id, status, message].hash
112
+ [status, message].hash
119
113
  end
120
114
 
121
115
  # Builds the object from hash
@@ -0,0 +1,229 @@
1
+ =begin
2
+ #SendX REST API
3
+
4
+ ## SendX REST API Documentation ## 🚀 Introduction The SendX API is organized around REST principles. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. **Key Features:** - 🔒 **Security**: Team-based authentication with optional member-level access - 🎯 **Resource-Oriented**: RESTful design with clear resource boundaries - 📊 **Rich Data Models**: Three-layer model system (Input/Output/Internal) - 🔗 **Relationships**: Automatic prefix handling for resource relationships - 📈 **Scalable**: Built for high-volume email marketing operations ## 🏗️ Architecture Overview SendX uses a three-layer model architecture: 1. **Input Models** (`RestE*`): For API requests 2. **Output Models** (`RestR*`): For API responses with prefixed IDs 3. **Internal Models**: Core business logic (not exposed in API) ## 🔐 Security & Authentication SendX uses API key authentication: ### Team API Key ```http X-Team-ApiKey: YOUR_TEAM_API_KEY ``` - **Required for all requests** - Team-level access to resources - Available in SendX Settings → Team API Key ## 🆔 Encrypted ID System SendX uses encrypted IDs for security and better developer experience: - **Internal IDs**: Sequential integers (not exposed) - **Encrypted IDs**: 22-character alphanumeric strings - **Prefixed IDs**: Resource-type prefixes in API responses (`contact_<22-char-id>`) ### ID Format **All resource IDs follow this pattern:** ``` <resource_prefix>_<22_character_alphanumeric_string> ``` **Example:** ```json { \"id\": \"contact_BnKjkbBBS500CoBCP0oChQ\", \"lists\": [\"list_OcuxJHdiAvujmwQVJfd3ss\", \"list_0tOFLp5RgV7s3LNiHrjGYs\"], \"tags\": [\"tag_UhsDkjL772Qbj5lWtT62VK\", \"tag_fL7t9lsnZ9swvx2HrtQ9wM\"] } ``` ## 📚 Resource Prefixes | Resource | Prefix | Example | |----------|--------|---------| | Contact | `contact_` | `contact_BnKjkbBBS500CoBCP0oChQ` | | Campaign | `campaign_` | `campaign_LUE9BTxmksSmqHWbh96zsn` | | List | `list_` | `list_OcuxJHdiAvujmwQVJfd3ss` | | Tag | `tag_` | `tag_UhsDkjL772Qbj5lWtT62VK` | | Sender | `sender_` | `sender_4vK3WFhMgvOwUNyaL4QxCD` | | Template | `template_` | `template_f3lJvTEhSjKGVb5Lwc5SWS` | | Custom Field | `field_` | `field_MnuqBAG2NPLm7PZMWbjQxt` | | Webhook | `webhook_` | `webhook_9l154iiXlZoPo7vngmamee` | | Post | `post_` | `post_XyZ123aBc456DeF789GhI` | | Post Category | `post_category_` | `post_category_YzS1wOU20yw87UUHKxMzwn` | | Post Tag | `post_tag_` | `post_tag_123XyZ456AbC` | | Member | `member_` | `member_JkL012MnO345PqR678` | ## 🎯 Best Practices ### Error Handling - **Always check status codes**: 2xx = success, 4xx = client error, 5xx = server error - **Read error messages**: Descriptive messages help debug issues - **Handle rate limits**: Respect API rate limits for optimal performance ### Data Validation - **Email format**: Must be valid email addresses - **Required fields**: Check documentation for mandatory fields - **Field lengths**: Respect maximum length constraints ### Performance - **Pagination**: Use offset/limit for large datasets - **Batch operations**: Process multiple items when supported - **Caching**: Cache responses when appropriate ## 🛠️ SDKs & Integration Official SDKs available for: - [Golang](https://github.com/sendx/sendx-go-sdk) - [Python](https://github.com/sendx/sendx-python-sdk) - [Ruby](https://github.com/sendx/sendx-ruby-sdk) - [Java](https://github.com/sendx/sendx-java-sdk) - [PHP](https://github.com/sendx/sendx-php-sdk) - [JavaScript](https://github.com/sendx/sendx-javascript-sdk) ## 📞 Support Need help? Contact us: - 💬 **Website Chat**: Available on sendx.io - 📧 **Email**: hello@sendx.io - 📚 **Documentation**: Full guides at help.sendx.io --- **API Endpoint:** `https://api.sendx.io/api/v1/rest` [<img src=\"https://run.pstmn.io/button.svg\" alt=\"Run In Postman\" style=\"width: 128px; height: 32px;\">](https://god.gw.postman.com/run-collection/33476323-44b198b0-5219-4619-a01f-cfc24d573885?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D33476323-44b198b0-5219-4619-a01f-cfc24d573885%26entityType%3Dcollection%26workspaceId%3D6b1e4f65-96a9-4136-9512-6266c852517e)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: hello@sendx.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.13.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SendX
17
+ class EventsRevenuePostbackGet200Response
18
+ attr_accessor :message
19
+
20
+ attr_accessor :status
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'message' => :'message',
26
+ :'status' => :'status'
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
+ :'message' => :'String',
44
+ :'status' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SendX::EventsRevenuePostbackGet200Response` 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 `SendX::EventsRevenuePostbackGet200Response`. 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?(:'message')
71
+ self.message = attributes[:'message']
72
+ end
73
+
74
+ if attributes.key?(:'status')
75
+ self.status = attributes[:'status']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ message == o.message &&
100
+ status == o.status
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [message, status].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ attributes = attributes.transform_keys(&:to_sym)
121
+ transformed_hash = {}
122
+ openapi_types.each_pair do |key, type|
123
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = nil
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[attribute_map[key]].is_a?(Array)
129
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
130
+ end
131
+ elsif !attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
133
+ end
134
+ end
135
+ new(transformed_hash)
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def self._deserialize(type, value)
143
+ case type.to_sym
144
+ when :Time
145
+ Time.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :Boolean
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ # models (e.g. Pet) or oneOf
176
+ klass = SendX.const_get(type)
177
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+
227
+ end
228
+
229
+ end
@@ -0,0 +1,220 @@
1
+ =begin
2
+ #SendX REST API
3
+
4
+ ## SendX REST API Documentation ## 🚀 Introduction The SendX API is organized around REST principles. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. **Key Features:** - 🔒 **Security**: Team-based authentication with optional member-level access - 🎯 **Resource-Oriented**: RESTful design with clear resource boundaries - 📊 **Rich Data Models**: Three-layer model system (Input/Output/Internal) - 🔗 **Relationships**: Automatic prefix handling for resource relationships - 📈 **Scalable**: Built for high-volume email marketing operations ## 🏗️ Architecture Overview SendX uses a three-layer model architecture: 1. **Input Models** (`RestE*`): For API requests 2. **Output Models** (`RestR*`): For API responses with prefixed IDs 3. **Internal Models**: Core business logic (not exposed in API) ## 🔐 Security & Authentication SendX uses API key authentication: ### Team API Key ```http X-Team-ApiKey: YOUR_TEAM_API_KEY ``` - **Required for all requests** - Team-level access to resources - Available in SendX Settings → Team API Key ## 🆔 Encrypted ID System SendX uses encrypted IDs for security and better developer experience: - **Internal IDs**: Sequential integers (not exposed) - **Encrypted IDs**: 22-character alphanumeric strings - **Prefixed IDs**: Resource-type prefixes in API responses (`contact_<22-char-id>`) ### ID Format **All resource IDs follow this pattern:** ``` <resource_prefix>_<22_character_alphanumeric_string> ``` **Example:** ```json { \"id\": \"contact_BnKjkbBBS500CoBCP0oChQ\", \"lists\": [\"list_OcuxJHdiAvujmwQVJfd3ss\", \"list_0tOFLp5RgV7s3LNiHrjGYs\"], \"tags\": [\"tag_UhsDkjL772Qbj5lWtT62VK\", \"tag_fL7t9lsnZ9swvx2HrtQ9wM\"] } ``` ## 📚 Resource Prefixes | Resource | Prefix | Example | |----------|--------|---------| | Contact | `contact_` | `contact_BnKjkbBBS500CoBCP0oChQ` | | Campaign | `campaign_` | `campaign_LUE9BTxmksSmqHWbh96zsn` | | List | `list_` | `list_OcuxJHdiAvujmwQVJfd3ss` | | Tag | `tag_` | `tag_UhsDkjL772Qbj5lWtT62VK` | | Sender | `sender_` | `sender_4vK3WFhMgvOwUNyaL4QxCD` | | Template | `template_` | `template_f3lJvTEhSjKGVb5Lwc5SWS` | | Custom Field | `field_` | `field_MnuqBAG2NPLm7PZMWbjQxt` | | Webhook | `webhook_` | `webhook_9l154iiXlZoPo7vngmamee` | | Post | `post_` | `post_XyZ123aBc456DeF789GhI` | | Post Category | `post_category_` | `post_category_YzS1wOU20yw87UUHKxMzwn` | | Post Tag | `post_tag_` | `post_tag_123XyZ456AbC` | | Member | `member_` | `member_JkL012MnO345PqR678` | ## 🎯 Best Practices ### Error Handling - **Always check status codes**: 2xx = success, 4xx = client error, 5xx = server error - **Read error messages**: Descriptive messages help debug issues - **Handle rate limits**: Respect API rate limits for optimal performance ### Data Validation - **Email format**: Must be valid email addresses - **Required fields**: Check documentation for mandatory fields - **Field lengths**: Respect maximum length constraints ### Performance - **Pagination**: Use offset/limit for large datasets - **Batch operations**: Process multiple items when supported - **Caching**: Cache responses when appropriate ## 🛠️ SDKs & Integration Official SDKs available for: - [Golang](https://github.com/sendx/sendx-go-sdk) - [Python](https://github.com/sendx/sendx-python-sdk) - [Ruby](https://github.com/sendx/sendx-ruby-sdk) - [Java](https://github.com/sendx/sendx-java-sdk) - [PHP](https://github.com/sendx/sendx-php-sdk) - [JavaScript](https://github.com/sendx/sendx-javascript-sdk) ## 📞 Support Need help? Contact us: - 💬 **Website Chat**: Available on sendx.io - 📧 **Email**: hello@sendx.io - 📚 **Documentation**: Full guides at help.sendx.io --- **API Endpoint:** `https://api.sendx.io/api/v1/rest` [<img src=\"https://run.pstmn.io/button.svg\" alt=\"Run In Postman\" style=\"width: 128px; height: 32px;\">](https://god.gw.postman.com/run-collection/33476323-44b198b0-5219-4619-a01f-cfc24d573885?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D33476323-44b198b0-5219-4619-a01f-cfc24d573885%26entityType%3Dcollection%26workspaceId%3D6b1e4f65-96a9-4136-9512-6266c852517e)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: hello@sendx.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.13.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SendX
17
+ class EventsRevenuePostbackGet400Response
18
+ attr_accessor :error
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'error' => :'error'
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
+ :'error' => :'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 `SendX::EventsRevenuePostbackGet400Response` 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 `SendX::EventsRevenuePostbackGet400Response`. 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?(:'error')
67
+ self.error = attributes[:'error']
68
+ end
69
+ end
70
+
71
+ # Show invalid properties with the reasons. Usually used together with valid?
72
+ # @return Array for valid properties with the reasons
73
+ def list_invalid_properties
74
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
75
+ invalid_properties = Array.new
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ warn '[DEPRECATED] the `valid?` method is obsolete'
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ error == o.error
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Integer] Hash code
102
+ def hash
103
+ [error].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def self.build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
112
+ transformed_hash = {}
113
+ openapi_types.each_pair do |key, type|
114
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
115
+ transformed_hash["#{key}"] = nil
116
+ elsif type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[attribute_map[key]].is_a?(Array)
120
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
121
+ end
122
+ elsif !attributes[attribute_map[key]].nil?
123
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
124
+ end
125
+ end
126
+ new(transformed_hash)
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def self._deserialize(type, value)
134
+ case type.to_sym
135
+ when :Time
136
+ Time.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ # models (e.g. Pet) or oneOf
167
+ klass = SendX.const_get(type)
168
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+
218
+ end
219
+
220
+ end