brevo 2.0.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (263) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +56 -4
  3. data/docs/Body.md +2 -3
  4. data/docs/Body1.md +2 -3
  5. data/docs/Body10.md +10 -4
  6. data/docs/Body11.md +6 -1
  7. data/docs/Body12.md +1 -4
  8. data/docs/Body13.md +11 -0
  9. data/docs/Body14.md +8 -0
  10. data/docs/Body15.md +11 -0
  11. data/docs/Body2.md +1 -4
  12. data/docs/Body3.md +3 -2
  13. data/docs/Body4.md +3 -2
  14. data/docs/Body5.md +4 -4
  15. data/docs/Body6.md +2 -11
  16. data/docs/Body7.md +2 -10
  17. data/docs/Body8.md +4 -6
  18. data/docs/Body9.md +11 -1
  19. data/docs/CompaniesApi.md +8 -8
  20. data/docs/ContactsApi.md +14 -4
  21. data/docs/ConversationsApi.md +10 -10
  22. data/docs/ConversionSourceMetrics.md +12 -0
  23. data/docs/ConversionSourceProduct.md +15 -0
  24. data/docs/CorporateGroupDetailsResponse.md +10 -0
  25. data/docs/CorporateGroupDetailsResponseGroup.md +10 -0
  26. data/docs/CorporateGroupDetailsResponseSubaccounts.md +10 -0
  27. data/docs/CorporateGroupDetailsResponseUsers.md +10 -0
  28. data/docs/CouponsApi.md +12 -9
  29. data/docs/CreateContact.md +1 -1
  30. data/docs/CreateCouponCollection.md +5 -2
  31. data/docs/CreateDomainModel.md +1 -0
  32. data/docs/CreateDomainModelDnsRecords.md +1 -0
  33. data/docs/CreateWebhook.md +3 -0
  34. data/docs/CreateWhatsAppTemplate.md +1 -0
  35. data/docs/DealsApi.md +10 -10
  36. data/docs/EcommerceApi.md +261 -2
  37. data/docs/EmailCampaignsApi.md +1 -3
  38. data/docs/Event.md +12 -0
  39. data/docs/EventIdentifiers.md +12 -0
  40. data/docs/EventsApi.md +67 -0
  41. data/docs/ExportWebhooksHistory.md +2 -1
  42. data/docs/ExternalFeedsApi.md +2 -2
  43. data/docs/GetContactDetails.md +1 -1
  44. data/docs/GetCorporateInvitedUsersList.md +8 -0
  45. data/docs/GetCorporateInvitedUsersListFeatureAccess.md +11 -0
  46. data/docs/GetCorporateInvitedUsersListGroups.md +9 -0
  47. data/docs/GetCorporateInvitedUsersListUsers.md +12 -0
  48. data/docs/GetCorporateUserPermission.md +11 -0
  49. data/docs/GetCorporateUserPermissionFeatureAccess.md +11 -0
  50. data/docs/GetCorporateUserPermissionGroups.md +9 -0
  51. data/docs/GetCouponCollection.md +9 -6
  52. data/docs/GetExtendedContactDetails.md +1 -1
  53. data/docs/GetOrders.md +9 -0
  54. data/docs/GetWebhook.md +3 -0
  55. data/docs/GetWebhookAuth.md +9 -0
  56. data/docs/GetWebhookHeaders.md +9 -0
  57. data/docs/InlineResponse200.md +1 -1
  58. data/docs/InlineResponse2001.md +2 -3
  59. data/docs/InlineResponse2002.md +8 -0
  60. data/docs/InlineResponse2003.md +10 -0
  61. data/docs/InlineResponse201.md +1 -1
  62. data/docs/InlineResponse2011.md +1 -1
  63. data/docs/InlineResponse2012.md +1 -1
  64. data/docs/InlineResponse2013.md +1 -1
  65. data/docs/InlineResponse2014.md +1 -1
  66. data/docs/InlineResponse2015.md +8 -0
  67. data/docs/InviteAdminUser.md +11 -0
  68. data/docs/InviteAdminUserPrivileges.md +9 -0
  69. data/docs/Inviteuser.md +10 -0
  70. data/docs/InviteuserPrivileges.md +9 -0
  71. data/docs/MasterAccountApi.md +828 -117
  72. data/docs/MasterDetailsResponsePlanInfoFeatures.md +2 -0
  73. data/docs/OrderBatch.md +1 -0
  74. data/docs/PutRevokeUserPermission.md +8 -0
  75. data/docs/Putresendcancelinvitation.md +8 -0
  76. data/docs/RequestContactImport.md +1 -0
  77. data/docs/SendSmtpEmail.md +18 -19
  78. data/docs/SendSmtpEmailMessageVersions.md +2 -0
  79. data/docs/SendWhatsappMessage.md +1 -0
  80. data/docs/SsoTokenRequestCorporate.md +8 -0
  81. data/docs/SubAccountAppsToggleRequest.md +1 -1
  82. data/docs/SubAccountUpdatePlanRequestFeatures.md +2 -2
  83. data/docs/TasksApi.md +8 -8
  84. data/docs/TransactionalEmailsApi.md +7 -7
  85. data/docs/TransactionalWhatsAppApi.md +2 -2
  86. data/docs/UpdateContact.md +1 -1
  87. data/docs/UpdateCouponCollection.md +4 -1
  88. data/docs/UpdateWebhook.md +3 -0
  89. data/docs/UserApi.md +239 -0
  90. data/docs/WebhooksApi.md +4 -4
  91. data/docs/WhatsAppCampaignsApi.md +3 -1
  92. data/lib/brevo/api/companies_api.rb +3 -3
  93. data/lib/brevo/api/contacts_api.rb +14 -2
  94. data/lib/brevo/api/conversations_api.rb +2 -2
  95. data/lib/brevo/api/coupons_api.rb +15 -16
  96. data/lib/brevo/api/deals_api.rb +5 -5
  97. data/lib/brevo/api/ecommerce_api.rb +250 -0
  98. data/lib/brevo/api/email_campaigns_api.rb +0 -3
  99. data/lib/brevo/api/events_api.rb +86 -0
  100. data/lib/brevo/api/external_feeds_api.rb +3 -3
  101. data/lib/brevo/api/master_account_api.rb +652 -4
  102. data/lib/brevo/api/tasks_api.rb +5 -5
  103. data/lib/brevo/api/transactional_emails_api.rb +11 -11
  104. data/lib/brevo/api/transactional_whats_app_api.rb +3 -3
  105. data/lib/brevo/api/user_api.rb +222 -0
  106. data/lib/brevo/api/webhooks_api.rb +4 -4
  107. data/lib/brevo/api/whats_app_campaigns_api.rb +6 -0
  108. data/lib/brevo/models/body.rb +20 -28
  109. data/lib/brevo/models/body_1.rb +22 -25
  110. data/lib/brevo/models/body_10.rb +95 -39
  111. data/lib/brevo/models/body_11.rb +60 -5
  112. data/lib/brevo/models/body_12.rb +13 -38
  113. data/lib/brevo/models/body_13.rb +225 -0
  114. data/lib/brevo/models/body_14.rb +190 -0
  115. data/lib/brevo/models/body_15.rb +215 -0
  116. data/lib/brevo/models/body_2.rb +14 -45
  117. data/lib/brevo/models/body_3.rb +16 -6
  118. data/lib/brevo/models/body_4.rb +16 -6
  119. data/lib/brevo/models/body_5.rb +19 -19
  120. data/lib/brevo/models/body_6.rb +9 -129
  121. data/lib/brevo/models/body_7.rb +9 -95
  122. data/lib/brevo/models/body_8.rb +37 -59
  123. data/lib/brevo/models/body_9.rb +141 -11
  124. data/lib/brevo/models/conversion_source_metrics.rb +279 -0
  125. data/lib/brevo/models/conversion_source_product.rb +252 -0
  126. data/lib/brevo/models/corporate_group_details_response.rb +206 -0
  127. data/lib/brevo/models/corporate_group_details_response_group.rb +205 -0
  128. data/lib/brevo/models/corporate_group_details_response_subaccounts.rb +205 -0
  129. data/lib/brevo/models/corporate_group_details_response_users.rb +205 -0
  130. data/lib/brevo/models/create_contact.rb +1 -1
  131. data/lib/brevo/models/create_coupon_collection.rb +37 -7
  132. data/lib/brevo/models/create_domain_model.rb +11 -1
  133. data/lib/brevo/models/create_domain_model_dns_records.rb +13 -4
  134. data/lib/brevo/models/create_webhook.rb +35 -4
  135. data/lib/brevo/models/create_whats_app_template.rb +28 -6
  136. data/lib/brevo/models/event.rb +234 -0
  137. data/lib/brevo/models/event_identifiers.rb +236 -0
  138. data/lib/brevo/models/export_webhooks_history.rb +31 -4
  139. data/lib/brevo/models/get_contact_details.rb +0 -5
  140. data/lib/brevo/models/get_corporate_invited_users_list.rb +187 -0
  141. data/lib/brevo/models/get_corporate_invited_users_list_feature_access.rb +224 -0
  142. data/lib/brevo/models/get_corporate_invited_users_list_groups.rb +196 -0
  143. data/lib/brevo/models/get_corporate_invited_users_list_users.rb +248 -0
  144. data/lib/brevo/models/get_corporate_user_permission.rb +236 -0
  145. data/lib/brevo/models/get_corporate_user_permission_feature_access.rb +224 -0
  146. data/lib/brevo/models/get_corporate_user_permission_groups.rb +196 -0
  147. data/lib/brevo/models/get_coupon_collection.rb +40 -10
  148. data/lib/brevo/models/get_extended_contact_details.rb +0 -5
  149. data/lib/brevo/models/get_orders.rb +196 -0
  150. data/lib/brevo/models/get_webhook.rb +35 -4
  151. data/lib/brevo/models/get_webhook_auth.rb +196 -0
  152. data/lib/brevo/models/get_webhook_headers.rb +195 -0
  153. data/lib/brevo/models/inline_response_200.rb +7 -14
  154. data/lib/brevo/models/inline_response_200_1.rb +9 -34
  155. data/lib/brevo/models/inline_response_200_2.rb +191 -0
  156. data/lib/brevo/models/inline_response_200_3.rb +215 -0
  157. data/lib/brevo/models/inline_response_201.rb +0 -7
  158. data/lib/brevo/models/inline_response_201_1.rb +2 -2
  159. data/lib/brevo/models/inline_response_201_2.rb +2 -1
  160. data/lib/brevo/models/inline_response_201_3.rb +11 -11
  161. data/lib/brevo/models/inline_response_201_4.rb +11 -11
  162. data/lib/brevo/models/inline_response_201_5.rb +190 -0
  163. data/lib/brevo/models/invite_admin_user.rb +233 -0
  164. data/lib/brevo/models/invite_admin_user_privileges.rb +232 -0
  165. data/lib/brevo/models/inviteuser.rb +221 -0
  166. data/lib/brevo/models/inviteuser_privileges.rb +232 -0
  167. data/lib/brevo/models/master_details_response_plan_info_features.rb +21 -1
  168. data/lib/brevo/models/order_batch.rb +16 -4
  169. data/lib/brevo/models/put_revoke_user_permission.rb +191 -0
  170. data/lib/brevo/models/putresendcancelinvitation.rb +191 -0
  171. data/lib/brevo/models/request_contact_import.rb +13 -1
  172. data/lib/brevo/models/send_smtp_email_message_versions.rb +24 -4
  173. data/lib/brevo/models/send_whatsapp_message.rb +11 -1
  174. data/lib/brevo/models/sso_token_request_corporate.rb +190 -0
  175. data/lib/brevo/models/sub_account_apps_toggle_request.rb +1 -1
  176. data/lib/brevo/models/sub_account_details_response_plan_info_features_inbox.rb +1 -1
  177. data/lib/brevo/models/sub_account_details_response_plan_info_features_landing_page.rb +1 -1
  178. data/lib/brevo/models/sub_account_update_plan_request_features.rb +2 -2
  179. data/lib/brevo/models/update_contact.rb +1 -1
  180. data/lib/brevo/models/update_coupon_collection.rb +34 -9
  181. data/lib/brevo/models/update_webhook.rb +35 -4
  182. data/lib/brevo/version.rb +1 -1
  183. data/lib/brevo.rb +32 -0
  184. data/spec/api/companies_api_spec.rb +1 -1
  185. data/spec/api/contacts_api_spec.rb +5 -1
  186. data/spec/api/conversations_api_spec.rb +1 -1
  187. data/spec/api/coupons_api_spec.rb +4 -3
  188. data/spec/api/deals_api_spec.rb +2 -2
  189. data/spec/api/ecommerce_api_spec.rb +57 -0
  190. data/spec/api/email_campaigns_api_spec.rb +0 -1
  191. data/spec/api/events_api_spec.rb +47 -0
  192. data/spec/api/external_feeds_api_spec.rb +1 -1
  193. data/spec/api/master_account_api_spec.rb +145 -1
  194. data/spec/api/tasks_api_spec.rb +2 -2
  195. data/spec/api/transactional_emails_api_spec.rb +3 -3
  196. data/spec/api/transactional_whats_app_api_spec.rb +1 -1
  197. data/spec/api/user_api_spec.rb +47 -0
  198. data/spec/api/webhooks_api_spec.rb +2 -2
  199. data/spec/api/whats_app_campaigns_api_spec.rb +1 -0
  200. data/spec/models/body_10_spec.rb +40 -4
  201. data/spec/models/body_11_spec.rb +30 -0
  202. data/spec/models/body_12_spec.rb +1 -19
  203. data/spec/models/body_13_spec.rb +59 -0
  204. data/spec/models/body_14_spec.rb +41 -0
  205. data/spec/models/body_15_spec.rb +59 -0
  206. data/spec/models/body_1_spec.rb +2 -8
  207. data/spec/models/body_2_spec.rb +1 -19
  208. data/spec/models/body_3_spec.rb +6 -0
  209. data/spec/models/body_4_spec.rb +6 -0
  210. data/spec/models/body_5_spec.rb +2 -2
  211. data/spec/models/body_6_spec.rb +1 -55
  212. data/spec/models/body_7_spec.rb +1 -49
  213. data/spec/models/body_8_spec.rb +4 -16
  214. data/spec/models/body_9_spec.rb +61 -1
  215. data/spec/models/body_spec.rb +2 -8
  216. data/spec/models/conversion_source_metrics_spec.rb +69 -0
  217. data/spec/models/conversion_source_product_spec.rb +83 -0
  218. data/spec/models/corporate_group_details_response_group_spec.rb +53 -0
  219. data/spec/models/corporate_group_details_response_spec.rb +53 -0
  220. data/spec/models/corporate_group_details_response_subaccounts_spec.rb +53 -0
  221. data/spec/models/corporate_group_details_response_users_spec.rb +53 -0
  222. data/spec/models/create_coupon_collection_spec.rb +18 -0
  223. data/spec/models/create_domain_model_dns_records_spec.rb +6 -0
  224. data/spec/models/create_domain_model_spec.rb +6 -0
  225. data/spec/models/create_webhook_spec.rb +18 -0
  226. data/spec/models/create_whats_app_template_spec.rb +11 -1
  227. data/spec/models/event_identifiers_spec.rb +65 -0
  228. data/spec/models/event_spec.rb +65 -0
  229. data/spec/models/export_webhooks_history_spec.rb +11 -1
  230. data/spec/models/get_corporate_invited_users_list_feature_access_spec.rb +59 -0
  231. data/spec/models/get_corporate_invited_users_list_groups_spec.rb +47 -0
  232. data/spec/models/get_corporate_invited_users_list_spec.rb +41 -0
  233. data/spec/models/get_corporate_invited_users_list_users_spec.rb +65 -0
  234. data/spec/models/get_corporate_user_permission_feature_access_spec.rb +59 -0
  235. data/spec/models/get_corporate_user_permission_groups_spec.rb +47 -0
  236. data/spec/models/get_corporate_user_permission_spec.rb +59 -0
  237. data/spec/models/get_coupon_collection_spec.rb +18 -0
  238. data/spec/models/get_orders_spec.rb +47 -0
  239. data/spec/models/get_webhook_auth_spec.rb +47 -0
  240. data/spec/models/get_webhook_headers_spec.rb +47 -0
  241. data/spec/models/get_webhook_spec.rb +18 -0
  242. data/spec/models/inline_response_200_1_spec.rb +1 -7
  243. data/spec/models/inline_response_200_2_spec.rb +41 -0
  244. data/spec/models/inline_response_200_3_spec.rb +53 -0
  245. data/spec/models/inline_response_200_spec.rb +1 -1
  246. data/spec/models/inline_response_201_3_spec.rb +1 -1
  247. data/spec/models/inline_response_201_4_spec.rb +1 -1
  248. data/spec/models/inline_response_201_5_spec.rb +41 -0
  249. data/spec/models/invite_admin_user_privileges_spec.rb +55 -0
  250. data/spec/models/invite_admin_user_spec.rb +59 -0
  251. data/spec/models/inviteuser_privileges_spec.rb +55 -0
  252. data/spec/models/inviteuser_spec.rb +53 -0
  253. data/spec/models/master_details_response_plan_info_features_spec.rb +12 -0
  254. data/spec/models/order_batch_spec.rb +6 -0
  255. data/spec/models/put_revoke_user_permission_spec.rb +41 -0
  256. data/spec/models/putresendcancelinvitation_spec.rb +41 -0
  257. data/spec/models/request_contact_import_spec.rb +6 -0
  258. data/spec/models/send_smtp_email_message_versions_spec.rb +12 -0
  259. data/spec/models/send_whatsapp_message_spec.rb +6 -0
  260. data/spec/models/sso_token_request_corporate_spec.rb +41 -0
  261. data/spec/models/update_coupon_collection_spec.rb +18 -0
  262. data/spec/models/update_webhook_spec.rb +18 -0
  263. metadata +152 -24
@@ -0,0 +1,190 @@
1
+ =begin
2
+ #Brevo API
3
+
4
+ #Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable |
5
+
6
+ OpenAPI spec version: 3.0.0
7
+ Contact: contact@brevo.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.19
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Brevo
16
+ class Body14
17
+ # edited message text
18
+ attr_accessor :text
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'text' => :'text'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.swagger_types
29
+ {
30
+ :'text' => :'String'
31
+ }
32
+ end
33
+
34
+ # Initializes the object
35
+ # @param [Hash] attributes Model attributes in the form of hash
36
+ def initialize(attributes = {})
37
+ return unless attributes.is_a?(Hash)
38
+
39
+ # convert string to symbol for hash key
40
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
41
+
42
+ if attributes.has_key?(:'text')
43
+ self.text = attributes[:'text']
44
+ end
45
+ end
46
+
47
+ # Show invalid properties with the reasons. Usually used together with valid?
48
+ # @return Array for valid properties with the reasons
49
+ def list_invalid_properties
50
+ invalid_properties = Array.new
51
+ if @text.nil?
52
+ invalid_properties.push('invalid value for "text", text cannot be nil.')
53
+ end
54
+
55
+ invalid_properties
56
+ end
57
+
58
+ # Check to see if the all the properties in the model are valid
59
+ # @return true if the model is valid
60
+ def valid?
61
+ return false if @text.nil?
62
+ true
63
+ end
64
+
65
+ # Checks equality by comparing each attribute.
66
+ # @param [Object] Object to be compared
67
+ def ==(o)
68
+ return true if self.equal?(o)
69
+ self.class == o.class &&
70
+ text == o.text
71
+ end
72
+
73
+ # @see the `==` method
74
+ # @param [Object] Object to be compared
75
+ def eql?(o)
76
+ self == o
77
+ end
78
+
79
+ # Calculates hash code according to all attributes.
80
+ # @return [Fixnum] Hash code
81
+ def hash
82
+ [text].hash
83
+ end
84
+
85
+ # Builds the object from hash
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ # @return [Object] Returns the model itself
88
+ def build_from_hash(attributes)
89
+ return nil unless attributes.is_a?(Hash)
90
+ self.class.swagger_types.each_pair do |key, type|
91
+ if type =~ /\AArray<(.*)>/i
92
+ # check to ensure the input is an array given that the attribute
93
+ # is documented as an array but the input is not
94
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
95
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
96
+ end
97
+ elsif !attributes[self.class.attribute_map[key]].nil?
98
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
99
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
100
+ end
101
+
102
+ self
103
+ end
104
+
105
+ # Deserializes the data based on type
106
+ # @param string type Data type
107
+ # @param string value Value to be deserialized
108
+ # @return [Object] Deserialized data
109
+ def _deserialize(type, value)
110
+ case type.to_sym
111
+ when :DateTime
112
+ DateTime.parse(value)
113
+ when :Date
114
+ Date.parse(value)
115
+ when :String
116
+ value.to_s
117
+ when :Integer
118
+ value.to_i
119
+ when :Float
120
+ value.to_f
121
+ when :BOOLEAN
122
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
123
+ true
124
+ else
125
+ false
126
+ end
127
+ when :Object
128
+ # generic object (usually a Hash), return directly
129
+ value
130
+ when /\AArray<(?<inner_type>.+)>\z/
131
+ inner_type = Regexp.last_match[:inner_type]
132
+ value.map { |v| _deserialize(inner_type, v) }
133
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
134
+ k_type = Regexp.last_match[:k_type]
135
+ v_type = Regexp.last_match[:v_type]
136
+ {}.tap do |hash|
137
+ value.each do |k, v|
138
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
139
+ end
140
+ end
141
+ else # model
142
+ temp_model = Brevo.const_get(type).new
143
+ temp_model.build_from_hash(value)
144
+ end
145
+ end
146
+
147
+ # Returns the string representation of the object
148
+ # @return [String] String presentation of the object
149
+ def to_s
150
+ to_hash.to_s
151
+ end
152
+
153
+ # to_body is an alias to to_hash (backward compatibility)
154
+ # @return [Hash] Returns the object in the form of hash
155
+ def to_body
156
+ to_hash
157
+ end
158
+
159
+ # Returns the object in the form of hash
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_hash
162
+ hash = {}
163
+ self.class.attribute_map.each_pair do |attr, param|
164
+ value = self.send(attr)
165
+ next if value.nil?
166
+ hash[param] = _to_hash(value)
167
+ end
168
+ hash
169
+ end
170
+
171
+ # Outputs non-array value in the form of hash
172
+ # For object, use to_hash. Otherwise, just return the value
173
+ # @param [Object] value Any valid value
174
+ # @return [Hash] Returns the value in the form of hash
175
+ def _to_hash(value)
176
+ if value.is_a?(Array)
177
+ value.compact.map { |v| _to_hash(v) }
178
+ elsif value.is_a?(Hash)
179
+ {}.tap do |hash|
180
+ value.each { |k, v| hash[k] = _to_hash(v) }
181
+ end
182
+ elsif value.respond_to? :to_hash
183
+ value.to_hash
184
+ else
185
+ value
186
+ end
187
+ end
188
+
189
+ end
190
+ end
@@ -0,0 +1,215 @@
1
+ =begin
2
+ #Brevo API
3
+
4
+ #Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable |
5
+
6
+ OpenAPI spec version: 3.0.0
7
+ Contact: contact@brevo.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.19
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Brevo
16
+ class Body15
17
+ # agent ID. It can be found on agent’s page or received <a href=\"https://developers.brevo.com/docs/conversations-webhooks\">from a webhook</a>. Alternatively, you can use `agentEmail` + `agentName` + `receivedFrom` instead (all 3 fields required).
18
+ attr_accessor :agent_id
19
+
20
+ # mark your messages to distinguish messages created by you from the others.
21
+ attr_accessor :received_from
22
+
23
+ # agent email. When sending online pings from a standalone system, it’s hard to maintain a 1-to-1 relationship between the users of both systems. In this case, an agent can be specified by their email address. If there’s no agent with the specified email address in your Brevo organization, a dummy agent will be created automatically.
24
+ attr_accessor :agent_email
25
+
26
+ # agent name.
27
+ attr_accessor :agent_name
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'agent_id' => :'agentId',
33
+ :'received_from' => :'receivedFrom',
34
+ :'agent_email' => :'agentEmail',
35
+ :'agent_name' => :'agentName'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'agent_id' => :'String',
43
+ :'received_from' => :'String',
44
+ :'agent_email' => :'String',
45
+ :'agent_name' => :'String'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
+
57
+ if attributes.has_key?(:'agentId')
58
+ self.agent_id = attributes[:'agentId']
59
+ end
60
+
61
+ if attributes.has_key?(:'receivedFrom')
62
+ self.received_from = attributes[:'receivedFrom']
63
+ end
64
+
65
+ if attributes.has_key?(:'agentEmail')
66
+ self.agent_email = attributes[:'agentEmail']
67
+ end
68
+
69
+ if attributes.has_key?(:'agentName')
70
+ self.agent_name = attributes[:'agentName']
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ agent_id == o.agent_id &&
93
+ received_from == o.received_from &&
94
+ agent_email == o.agent_email &&
95
+ agent_name == o.agent_name
96
+ end
97
+
98
+ # @see the `==` method
99
+ # @param [Object] Object to be compared
100
+ def eql?(o)
101
+ self == o
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Fixnum] Hash code
106
+ def hash
107
+ [agent_id, received_from, agent_email, agent_name].hash
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def build_from_hash(attributes)
114
+ return nil unless attributes.is_a?(Hash)
115
+ self.class.swagger_types.each_pair do |key, type|
116
+ if 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[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
121
+ end
122
+ elsif !attributes[self.class.attribute_map[key]].nil?
123
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
125
+ end
126
+
127
+ self
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :DateTime
137
+ DateTime.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :BOOLEAN
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ temp_model = Brevo.const_get(type).new
168
+ temp_model.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
+ next if value.nil?
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map { |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end
213
+
214
+ end
215
+ end
@@ -14,35 +14,20 @@ require 'date'
14
14
 
15
15
  module Brevo
16
16
  class Body2
17
- # Contact ids for contacts to be linked with company
18
- attr_accessor :link_contact_ids
19
-
20
- # Contact ids for contacts to be unlinked from company
21
- attr_accessor :unlink_contact_ids
22
-
23
- # Deals ids for deals to be linked with company
24
- attr_accessor :link_deals_ids
25
-
26
- # Deals ids for deals to be unlinked from company
27
- attr_accessor :unlink_deals_ids
17
+ # List of sub-account ids
18
+ attr_accessor :sub_account_ids
28
19
 
29
20
  # Attribute mapping from ruby-style variable name to JSON key.
30
21
  def self.attribute_map
31
22
  {
32
- :'link_contact_ids' => :'linkContactIds',
33
- :'unlink_contact_ids' => :'unlinkContactIds',
34
- :'link_deals_ids' => :'linkDealsIds',
35
- :'unlink_deals_ids' => :'unlinkDealsIds'
23
+ :'sub_account_ids' => :'subAccountIds'
36
24
  }
37
25
  end
38
26
 
39
27
  # Attribute type mapping.
40
28
  def self.swagger_types
41
29
  {
42
- :'link_contact_ids' => :'Array<Integer>',
43
- :'unlink_contact_ids' => :'Array<Integer>',
44
- :'link_deals_ids' => :'Array<String>',
45
- :'unlink_deals_ids' => :'Array<String>'
30
+ :'sub_account_ids' => :'Array<Integer>'
46
31
  }
47
32
  end
48
33
 
@@ -54,27 +39,9 @@ module Brevo
54
39
  # convert string to symbol for hash key
55
40
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
41
 
57
- if attributes.has_key?(:'linkContactIds')
58
- if (value = attributes[:'linkContactIds']).is_a?(Array)
59
- self.link_contact_ids = value
60
- end
61
- end
62
-
63
- if attributes.has_key?(:'unlinkContactIds')
64
- if (value = attributes[:'unlinkContactIds']).is_a?(Array)
65
- self.unlink_contact_ids = value
66
- end
67
- end
68
-
69
- if attributes.has_key?(:'linkDealsIds')
70
- if (value = attributes[:'linkDealsIds']).is_a?(Array)
71
- self.link_deals_ids = value
72
- end
73
- end
74
-
75
- if attributes.has_key?(:'unlinkDealsIds')
76
- if (value = attributes[:'unlinkDealsIds']).is_a?(Array)
77
- self.unlink_deals_ids = value
42
+ if attributes.has_key?(:'subAccountIds')
43
+ if (value = attributes[:'subAccountIds']).is_a?(Array)
44
+ self.sub_account_ids = value
78
45
  end
79
46
  end
80
47
  end
@@ -83,12 +50,17 @@ module Brevo
83
50
  # @return Array for valid properties with the reasons
84
51
  def list_invalid_properties
85
52
  invalid_properties = Array.new
53
+ if @sub_account_ids.nil?
54
+ invalid_properties.push('invalid value for "sub_account_ids", sub_account_ids cannot be nil.')
55
+ end
56
+
86
57
  invalid_properties
87
58
  end
88
59
 
89
60
  # Check to see if the all the properties in the model are valid
90
61
  # @return true if the model is valid
91
62
  def valid?
63
+ return false if @sub_account_ids.nil?
92
64
  true
93
65
  end
94
66
 
@@ -97,10 +69,7 @@ module Brevo
97
69
  def ==(o)
98
70
  return true if self.equal?(o)
99
71
  self.class == o.class &&
100
- link_contact_ids == o.link_contact_ids &&
101
- unlink_contact_ids == o.unlink_contact_ids &&
102
- link_deals_ids == o.link_deals_ids &&
103
- unlink_deals_ids == o.unlink_deals_ids
72
+ sub_account_ids == o.sub_account_ids
104
73
  end
105
74
 
106
75
  # @see the `==` method
@@ -112,7 +81,7 @@ module Brevo
112
81
  # Calculates hash code according to all attributes.
113
82
  # @return [Fixnum] Hash code
114
83
  def hash
115
- [link_contact_ids, unlink_contact_ids, link_deals_ids, unlink_deals_ids].hash
84
+ [sub_account_ids].hash
116
85
  end
117
86
 
118
87
  # Builds the object from hash
@@ -14,17 +14,21 @@ require 'date'
14
14
 
15
15
  module Brevo
16
16
  class Body3
17
- # Name of deal
17
+ # Name of company
18
18
  attr_accessor :name
19
19
 
20
- # Attributes for deal creation If you want to create a deal on a specific pipeline and stage you can use the following attributes `pipeline` and `deal_stage`. Pipeline and deal_stage are ids you can fetch using this endpoint `/crm/pipeline/details/{pipelineID}`
20
+ # Attributes for company creation
21
21
  attr_accessor :attributes
22
22
 
23
+ # Country code if phone_number is passed in attributes.
24
+ attr_accessor :country_code
25
+
23
26
  # Attribute mapping from ruby-style variable name to JSON key.
24
27
  def self.attribute_map
25
28
  {
26
29
  :'name' => :'name',
27
- :'attributes' => :'attributes'
30
+ :'attributes' => :'attributes',
31
+ :'country_code' => :'countryCode'
28
32
  }
29
33
  end
30
34
 
@@ -32,7 +36,8 @@ module Brevo
32
36
  def self.swagger_types
33
37
  {
34
38
  :'name' => :'String',
35
- :'attributes' => :'Object'
39
+ :'attributes' => :'Object',
40
+ :'country_code' => :'Integer'
36
41
  }
37
42
  end
38
43
 
@@ -51,6 +56,10 @@ module Brevo
51
56
  if attributes.has_key?(:'attributes')
52
57
  self.attributes = attributes[:'attributes']
53
58
  end
59
+
60
+ if attributes.has_key?(:'countryCode')
61
+ self.country_code = attributes[:'countryCode']
62
+ end
54
63
  end
55
64
 
56
65
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -77,7 +86,8 @@ module Brevo
77
86
  return true if self.equal?(o)
78
87
  self.class == o.class &&
79
88
  name == o.name &&
80
- attributes == o.attributes
89
+ attributes == o.attributes &&
90
+ country_code == o.country_code
81
91
  end
82
92
 
83
93
  # @see the `==` method
@@ -89,7 +99,7 @@ module Brevo
89
99
  # Calculates hash code according to all attributes.
90
100
  # @return [Fixnum] Hash code
91
101
  def hash
92
- [name, attributes].hash
102
+ [name, attributes, country_code].hash
93
103
  end
94
104
 
95
105
  # Builds the object from hash
@@ -14,17 +14,21 @@ require 'date'
14
14
 
15
15
  module Brevo
16
16
  class Body4
17
- # Name of deal
17
+ # Name of company
18
18
  attr_accessor :name
19
19
 
20
- # Attributes for deal update If you wish to update the pipeline of a deal you need to provide the `pipeline` and the `deal_stage`. Pipeline and deal_stage are ids you can fetch using this endpoint `/crm/pipeline/details/{pipelineID}`
20
+ # Attributes for company update
21
21
  attr_accessor :attributes
22
22
 
23
+ # Country code if phone_number is passed in attributes.
24
+ attr_accessor :country_code
25
+
23
26
  # Attribute mapping from ruby-style variable name to JSON key.
24
27
  def self.attribute_map
25
28
  {
26
29
  :'name' => :'name',
27
- :'attributes' => :'attributes'
30
+ :'attributes' => :'attributes',
31
+ :'country_code' => :'countryCode'
28
32
  }
29
33
  end
30
34
 
@@ -32,7 +36,8 @@ module Brevo
32
36
  def self.swagger_types
33
37
  {
34
38
  :'name' => :'String',
35
- :'attributes' => :'Object'
39
+ :'attributes' => :'Object',
40
+ :'country_code' => :'Integer'
36
41
  }
37
42
  end
38
43
 
@@ -51,6 +56,10 @@ module Brevo
51
56
  if attributes.has_key?(:'attributes')
52
57
  self.attributes = attributes[:'attributes']
53
58
  end
59
+
60
+ if attributes.has_key?(:'countryCode')
61
+ self.country_code = attributes[:'countryCode']
62
+ end
54
63
  end
55
64
 
56
65
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -72,7 +81,8 @@ module Brevo
72
81
  return true if self.equal?(o)
73
82
  self.class == o.class &&
74
83
  name == o.name &&
75
- attributes == o.attributes
84
+ attributes == o.attributes &&
85
+ country_code == o.country_code
76
86
  end
77
87
 
78
88
  # @see the `==` method
@@ -84,7 +94,7 @@ module Brevo
84
94
  # Calculates hash code according to all attributes.
85
95
  # @return [Fixnum] Hash code
86
96
  def hash
87
- [name, attributes].hash
97
+ [name, attributes, country_code].hash
88
98
  end
89
99
 
90
100
  # Builds the object from hash