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,196 @@
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
+ # Add authentication on webhook url
17
+ class GetWebhookAuth
18
+ # Type of authentication
19
+ attr_accessor :type
20
+
21
+ # Webhook authentication token
22
+ attr_accessor :token
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'type' => :'type',
28
+ :'token' => :'token'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'type' => :'String',
36
+ :'token' => :'String'
37
+ }
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ return unless attributes.is_a?(Hash)
44
+
45
+ # convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
47
+
48
+ if attributes.has_key?(:'type')
49
+ self.type = attributes[:'type']
50
+ end
51
+
52
+ if attributes.has_key?(:'token')
53
+ self.token = attributes[:'token']
54
+ end
55
+ end
56
+
57
+ # Show invalid properties with the reasons. Usually used together with valid?
58
+ # @return Array for valid properties with the reasons
59
+ def list_invalid_properties
60
+ invalid_properties = Array.new
61
+ invalid_properties
62
+ end
63
+
64
+ # Check to see if the all the properties in the model are valid
65
+ # @return true if the model is valid
66
+ def valid?
67
+ true
68
+ end
69
+
70
+ # Checks equality by comparing each attribute.
71
+ # @param [Object] Object to be compared
72
+ def ==(o)
73
+ return true if self.equal?(o)
74
+ self.class == o.class &&
75
+ type == o.type &&
76
+ token == o.token
77
+ end
78
+
79
+ # @see the `==` method
80
+ # @param [Object] Object to be compared
81
+ def eql?(o)
82
+ self == o
83
+ end
84
+
85
+ # Calculates hash code according to all attributes.
86
+ # @return [Fixnum] Hash code
87
+ def hash
88
+ [type, token].hash
89
+ end
90
+
91
+ # Builds the object from hash
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ # @return [Object] Returns the model itself
94
+ def build_from_hash(attributes)
95
+ return nil unless attributes.is_a?(Hash)
96
+ self.class.swagger_types.each_pair do |key, type|
97
+ if type =~ /\AArray<(.*)>/i
98
+ # check to ensure the input is an array given that the attribute
99
+ # is documented as an array but the input is not
100
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
101
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
102
+ end
103
+ elsif !attributes[self.class.attribute_map[key]].nil?
104
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
105
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
106
+ end
107
+
108
+ self
109
+ end
110
+
111
+ # Deserializes the data based on type
112
+ # @param string type Data type
113
+ # @param string value Value to be deserialized
114
+ # @return [Object] Deserialized data
115
+ def _deserialize(type, value)
116
+ case type.to_sym
117
+ when :DateTime
118
+ DateTime.parse(value)
119
+ when :Date
120
+ Date.parse(value)
121
+ when :String
122
+ value.to_s
123
+ when :Integer
124
+ value.to_i
125
+ when :Float
126
+ value.to_f
127
+ when :BOOLEAN
128
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
129
+ true
130
+ else
131
+ false
132
+ end
133
+ when :Object
134
+ # generic object (usually a Hash), return directly
135
+ value
136
+ when /\AArray<(?<inner_type>.+)>\z/
137
+ inner_type = Regexp.last_match[:inner_type]
138
+ value.map { |v| _deserialize(inner_type, v) }
139
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
140
+ k_type = Regexp.last_match[:k_type]
141
+ v_type = Regexp.last_match[:v_type]
142
+ {}.tap do |hash|
143
+ value.each do |k, v|
144
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
145
+ end
146
+ end
147
+ else # model
148
+ temp_model = Brevo.const_get(type).new
149
+ temp_model.build_from_hash(value)
150
+ end
151
+ end
152
+
153
+ # Returns the string representation of the object
154
+ # @return [String] String presentation of the object
155
+ def to_s
156
+ to_hash.to_s
157
+ end
158
+
159
+ # to_body is an alias to to_hash (backward compatibility)
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_body
162
+ to_hash
163
+ end
164
+
165
+ # Returns the object in the form of hash
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_hash
168
+ hash = {}
169
+ self.class.attribute_map.each_pair do |attr, param|
170
+ value = self.send(attr)
171
+ next if value.nil?
172
+ hash[param] = _to_hash(value)
173
+ end
174
+ hash
175
+ end
176
+
177
+ # Outputs non-array value in the form of hash
178
+ # For object, use to_hash. Otherwise, just return the value
179
+ # @param [Object] value Any valid value
180
+ # @return [Hash] Returns the value in the form of hash
181
+ def _to_hash(value)
182
+ if value.is_a?(Array)
183
+ value.compact.map { |v| _to_hash(v) }
184
+ elsif value.is_a?(Hash)
185
+ {}.tap do |hash|
186
+ value.each { |k, v| hash[k] = _to_hash(v) }
187
+ end
188
+ elsif value.respond_to? :to_hash
189
+ value.to_hash
190
+ else
191
+ value
192
+ end
193
+ end
194
+
195
+ end
196
+ end
@@ -0,0 +1,195 @@
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 GetWebhookHeaders
17
+ # Header key name
18
+ attr_accessor :key
19
+
20
+ # Header value
21
+ attr_accessor :value
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'key' => :'key',
27
+ :'value' => :'value'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ :'key' => :'String',
35
+ :'value' => :'String'
36
+ }
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ return unless attributes.is_a?(Hash)
43
+
44
+ # convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
46
+
47
+ if attributes.has_key?(:'key')
48
+ self.key = attributes[:'key']
49
+ end
50
+
51
+ if attributes.has_key?(:'value')
52
+ self.value = attributes[:'value']
53
+ end
54
+ end
55
+
56
+ # Show invalid properties with the reasons. Usually used together with valid?
57
+ # @return Array for valid properties with the reasons
58
+ def list_invalid_properties
59
+ invalid_properties = Array.new
60
+ invalid_properties
61
+ end
62
+
63
+ # Check to see if the all the properties in the model are valid
64
+ # @return true if the model is valid
65
+ def valid?
66
+ true
67
+ end
68
+
69
+ # Checks equality by comparing each attribute.
70
+ # @param [Object] Object to be compared
71
+ def ==(o)
72
+ return true if self.equal?(o)
73
+ self.class == o.class &&
74
+ key == o.key &&
75
+ value == o.value
76
+ end
77
+
78
+ # @see the `==` method
79
+ # @param [Object] Object to be compared
80
+ def eql?(o)
81
+ self == o
82
+ end
83
+
84
+ # Calculates hash code according to all attributes.
85
+ # @return [Fixnum] Hash code
86
+ def hash
87
+ [key, value].hash
88
+ end
89
+
90
+ # Builds the object from hash
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ # @return [Object] Returns the model itself
93
+ def build_from_hash(attributes)
94
+ return nil unless attributes.is_a?(Hash)
95
+ self.class.swagger_types.each_pair do |key, type|
96
+ if type =~ /\AArray<(.*)>/i
97
+ # check to ensure the input is an array given that the attribute
98
+ # is documented as an array but the input is not
99
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
100
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
101
+ end
102
+ elsif !attributes[self.class.attribute_map[key]].nil?
103
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
104
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
105
+ end
106
+
107
+ self
108
+ end
109
+
110
+ # Deserializes the data based on type
111
+ # @param string type Data type
112
+ # @param string value Value to be deserialized
113
+ # @return [Object] Deserialized data
114
+ def _deserialize(type, value)
115
+ case type.to_sym
116
+ when :DateTime
117
+ DateTime.parse(value)
118
+ when :Date
119
+ Date.parse(value)
120
+ when :String
121
+ value.to_s
122
+ when :Integer
123
+ value.to_i
124
+ when :Float
125
+ value.to_f
126
+ when :BOOLEAN
127
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
128
+ true
129
+ else
130
+ false
131
+ end
132
+ when :Object
133
+ # generic object (usually a Hash), return directly
134
+ value
135
+ when /\AArray<(?<inner_type>.+)>\z/
136
+ inner_type = Regexp.last_match[:inner_type]
137
+ value.map { |v| _deserialize(inner_type, v) }
138
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
139
+ k_type = Regexp.last_match[:k_type]
140
+ v_type = Regexp.last_match[:v_type]
141
+ {}.tap do |hash|
142
+ value.each do |k, v|
143
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
144
+ end
145
+ end
146
+ else # model
147
+ temp_model = Brevo.const_get(type).new
148
+ temp_model.build_from_hash(value)
149
+ end
150
+ end
151
+
152
+ # Returns the string representation of the object
153
+ # @return [String] String presentation of the object
154
+ def to_s
155
+ to_hash.to_s
156
+ end
157
+
158
+ # to_body is an alias to to_hash (backward compatibility)
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_body
161
+ to_hash
162
+ end
163
+
164
+ # Returns the object in the form of hash
165
+ # @return [Hash] Returns the object in the form of hash
166
+ def to_hash
167
+ hash = {}
168
+ self.class.attribute_map.each_pair do |attr, param|
169
+ value = self.send(attr)
170
+ next if value.nil?
171
+ hash[param] = _to_hash(value)
172
+ end
173
+ hash
174
+ end
175
+
176
+ # Outputs non-array value in the form of hash
177
+ # For object, use to_hash. Otherwise, just return the value
178
+ # @param [Object] value Any valid value
179
+ # @return [Hash] Returns the value in the form of hash
180
+ def _to_hash(value)
181
+ if value.is_a?(Array)
182
+ value.compact.map { |v| _to_hash(v) }
183
+ elsif value.is_a?(Hash)
184
+ {}.tap do |hash|
185
+ value.each { |k, v| hash[k] = _to_hash(v) }
186
+ end
187
+ elsif value.respond_to? :to_hash
188
+ value.to_hash
189
+ else
190
+ value
191
+ end
192
+ end
193
+
194
+ end
195
+ end
@@ -13,22 +13,20 @@ Swagger Codegen version: 2.4.19
13
13
  require 'date'
14
14
 
15
15
  module Brevo
16
- # Created company id
17
16
  class InlineResponse200
18
- # Unique company id
19
- attr_accessor :id
17
+ attr_accessor :message
20
18
 
21
19
  # Attribute mapping from ruby-style variable name to JSON key.
22
20
  def self.attribute_map
23
21
  {
24
- :'id' => :'id'
22
+ :'message' => :'message'
25
23
  }
26
24
  end
27
25
 
28
26
  # Attribute type mapping.
29
27
  def self.swagger_types
30
28
  {
31
- :'id' => :'String'
29
+ :'message' => :'String'
32
30
  }
33
31
  end
34
32
 
@@ -40,8 +38,8 @@ module Brevo
40
38
  # convert string to symbol for hash key
41
39
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
42
40
 
43
- if attributes.has_key?(:'id')
44
- self.id = attributes[:'id']
41
+ if attributes.has_key?(:'message')
42
+ self.message = attributes[:'message']
45
43
  end
46
44
  end
47
45
 
@@ -49,17 +47,12 @@ module Brevo
49
47
  # @return Array for valid properties with the reasons
50
48
  def list_invalid_properties
51
49
  invalid_properties = Array.new
52
- if @id.nil?
53
- invalid_properties.push('invalid value for "id", id cannot be nil.')
54
- end
55
-
56
50
  invalid_properties
57
51
  end
58
52
 
59
53
  # Check to see if the all the properties in the model are valid
60
54
  # @return true if the model is valid
61
55
  def valid?
62
- return false if @id.nil?
63
56
  true
64
57
  end
65
58
 
@@ -68,7 +61,7 @@ module Brevo
68
61
  def ==(o)
69
62
  return true if self.equal?(o)
70
63
  self.class == o.class &&
71
- id == o.id
64
+ message == o.message
72
65
  end
73
66
 
74
67
  # @see the `==` method
@@ -80,7 +73,7 @@ module Brevo
80
73
  # Calculates hash code according to all attributes.
81
74
  # @return [Fixnum] Hash code
82
75
  def hash
83
- [id].hash
76
+ [message].hash
84
77
  end
85
78
 
86
79
  # Builds the object from hash
@@ -14,21 +14,17 @@ require 'date'
14
14
 
15
15
  module Brevo
16
16
  class InlineResponse2001
17
- # The id of the collection
17
+ # Unique id of the group
18
18
  attr_accessor :id
19
19
 
20
- # The name of the collection
21
- attr_accessor :name
22
-
23
- # The default coupon of the collection
24
- attr_accessor :default_coupon
20
+ # The name of the group of sub-accounts
21
+ attr_accessor :group_name
25
22
 
26
23
  # Attribute mapping from ruby-style variable name to JSON key.
27
24
  def self.attribute_map
28
25
  {
29
26
  :'id' => :'id',
30
- :'name' => :'name',
31
- :'default_coupon' => :'defaultCoupon'
27
+ :'group_name' => :'groupName'
32
28
  }
33
29
  end
34
30
 
@@ -36,8 +32,7 @@ module Brevo
36
32
  def self.swagger_types
37
33
  {
38
34
  :'id' => :'String',
39
- :'name' => :'String',
40
- :'default_coupon' => :'String'
35
+ :'group_name' => :'String'
41
36
  }
42
37
  end
43
38
 
@@ -53,12 +48,8 @@ module Brevo
53
48
  self.id = attributes[:'id']
54
49
  end
55
50
 
56
- if attributes.has_key?(:'name')
57
- self.name = attributes[:'name']
58
- end
59
-
60
- if attributes.has_key?(:'defaultCoupon')
61
- self.default_coupon = attributes[:'defaultCoupon']
51
+ if attributes.has_key?(:'groupName')
52
+ self.group_name = attributes[:'groupName']
62
53
  end
63
54
  end
64
55
 
@@ -66,27 +57,12 @@ module Brevo
66
57
  # @return Array for valid properties with the reasons
67
58
  def list_invalid_properties
68
59
  invalid_properties = Array.new
69
- if @id.nil?
70
- invalid_properties.push('invalid value for "id", id cannot be nil.')
71
- end
72
-
73
- if @name.nil?
74
- invalid_properties.push('invalid value for "name", name cannot be nil.')
75
- end
76
-
77
- if @default_coupon.nil?
78
- invalid_properties.push('invalid value for "default_coupon", default_coupon cannot be nil.')
79
- end
80
-
81
60
  invalid_properties
82
61
  end
83
62
 
84
63
  # Check to see if the all the properties in the model are valid
85
64
  # @return true if the model is valid
86
65
  def valid?
87
- return false if @id.nil?
88
- return false if @name.nil?
89
- return false if @default_coupon.nil?
90
66
  true
91
67
  end
92
68
 
@@ -96,8 +72,7 @@ module Brevo
96
72
  return true if self.equal?(o)
97
73
  self.class == o.class &&
98
74
  id == o.id &&
99
- name == o.name &&
100
- default_coupon == o.default_coupon
75
+ group_name == o.group_name
101
76
  end
102
77
 
103
78
  # @see the `==` method
@@ -109,7 +84,7 @@ module Brevo
109
84
  # Calculates hash code according to all attributes.
110
85
  # @return [Fixnum] Hash code
111
86
  def hash
112
- [id, name, default_coupon].hash
87
+ [id, group_name].hash
113
88
  end
114
89
 
115
90
  # Builds the object from hash