sib-api-v3-sdk 7.5.0 → 8.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +59 -4
  3. data/docs/Body.md +18 -0
  4. data/docs/Body1.md +18 -0
  5. data/docs/CRMApi.md +710 -0
  6. data/docs/Contact.md +15 -0
  7. data/docs/ContactsApi.md +61 -2
  8. data/docs/CreateSmsCampaign.md +1 -0
  9. data/docs/CreateSubAccount.md +10 -0
  10. data/docs/CreateWebhook.md +2 -1
  11. data/docs/FileData.md +17 -0
  12. data/docs/GetCampaignStats.md +1 -0
  13. data/docs/GetContactCampaignStats.md +1 -0
  14. data/docs/GetExtendedContactDetailsStatistics.md +1 -0
  15. data/docs/GetExtendedContactDetailsStatisticsDelivered.md +9 -0
  16. data/docs/GetInboundEmailEvents.md +8 -0
  17. data/docs/GetInboundEmailEventsByUuid.md +15 -0
  18. data/docs/GetInboundEmailEventsByUuidAttachments.md +11 -0
  19. data/docs/GetInboundEmailEventsByUuidLogs.md +9 -0
  20. data/docs/GetInboundEmailEventsEvents.md +11 -0
  21. data/docs/InboundParsingApi.md +139 -0
  22. data/docs/MasterAccountApi.md +367 -0
  23. data/docs/MasterDetailsResponse.md +14 -0
  24. data/docs/MasterDetailsResponseBillingInfo.md +11 -0
  25. data/docs/MasterDetailsResponseBillingInfoAddress.md +12 -0
  26. data/docs/MasterDetailsResponseBillingInfoName.md +9 -0
  27. data/docs/MasterDetailsResponsePlanInfo.md +13 -0
  28. data/docs/MasterDetailsResponsePlanInfoFeatures.md +12 -0
  29. data/docs/Note.md +14 -0
  30. data/docs/NoteData.md +10 -0
  31. data/docs/RequestContactExport.md +1 -2
  32. data/docs/SendSmtpEmail.md +3 -3
  33. data/docs/SendTransacSms.md +1 -0
  34. data/docs/SsoTokenRequest.md +9 -0
  35. data/docs/SubAccountDetailsResponse.md +11 -0
  36. data/docs/SubAccountDetailsResponsePlanInfo.md +10 -0
  37. data/docs/SubAccountDetailsResponsePlanInfoCredits.md +9 -0
  38. data/docs/SubAccountDetailsResponsePlanInfoCreditsEmails.md +9 -0
  39. data/docs/SubAccountDetailsResponsePlanInfoFeatures.md +10 -0
  40. data/docs/SubAccountDetailsResponsePlanInfoFeaturesInbox.md +9 -0
  41. data/docs/SubAccountDetailsResponsePlanInfoFeaturesLandingPage.md +9 -0
  42. data/docs/SubAccountDetailsResponsePlanInfoFeaturesUsers.md +9 -0
  43. data/docs/SubAccountUpdatePlanRequest.md +9 -0
  44. data/docs/SubAccountUpdatePlanRequestCredits.md +8 -0
  45. data/docs/SubAccountUpdatePlanRequestFeatures.md +10 -0
  46. data/docs/SubAccountsResponse.md +9 -0
  47. data/docs/SubAccountsResponseSubAccounts.md +11 -0
  48. data/docs/Task.md +24 -0
  49. data/docs/TaskReminder.md +10 -0
  50. data/docs/TransactionalEmailsApi.md +4 -63
  51. data/docs/UpdateBatchContacts.md +8 -0
  52. data/docs/UpdateBatchContactsContacts.md +16 -0
  53. data/docs/UpdateBatchContactsModel.md +9 -0
  54. data/docs/UpdateSmsCampaign.md +1 -0
  55. data/docs/UpdateWebhook.md +2 -1
  56. data/lib/sib-api-v3-sdk/api/contacts_api.rb +55 -2
  57. data/lib/sib-api-v3-sdk/api/crm_api.rb +670 -0
  58. data/lib/sib-api-v3-sdk/api/inbound_parsing_api.rb +161 -0
  59. data/lib/sib-api-v3-sdk/api/master_account_api.rb +365 -0
  60. data/lib/sib-api-v3-sdk/api/transactional_emails_api.rb +4 -60
  61. data/lib/sib-api-v3-sdk/api/webhooks_api.rb +2 -2
  62. data/lib/sib-api-v3-sdk/models/body.rb +305 -0
  63. data/lib/sib-api-v3-sdk/models/body_1.rb +305 -0
  64. data/lib/sib-api-v3-sdk/models/{send_email.rb → contact.rb} +64 -78
  65. data/lib/sib-api-v3-sdk/models/create_sms_campaign.rb +16 -4
  66. data/lib/sib-api-v3-sdk/models/create_sub_account.rb +244 -0
  67. data/lib/sib-api-v3-sdk/models/create_webhook.rb +17 -7
  68. data/lib/sib-api-v3-sdk/models/file_data.rb +278 -0
  69. data/lib/sib-api-v3-sdk/models/get_campaign_stats.rb +16 -1
  70. data/lib/sib-api-v3-sdk/models/get_contact_campaign_stats.rb +15 -4
  71. data/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics.rb +16 -4
  72. data/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_delivered.rb +205 -0
  73. data/lib/sib-api-v3-sdk/models/{send_template_email.rb → get_inbound_email_events.rb} +10 -14
  74. data/lib/sib-api-v3-sdk/models/get_inbound_email_events_by_uuid.rb +259 -0
  75. data/lib/sib-api-v3-sdk/models/get_inbound_email_events_by_uuid_attachments.rb +215 -0
  76. data/lib/sib-api-v3-sdk/models/get_inbound_email_events_by_uuid_logs.rb +229 -0
  77. data/lib/sib-api-v3-sdk/models/get_inbound_email_events_events.rb +235 -0
  78. data/lib/sib-api-v3-sdk/models/master_details_response.rb +243 -0
  79. data/lib/sib-api-v3-sdk/models/master_details_response_billing_info.rb +214 -0
  80. data/lib/sib-api-v3-sdk/models/master_details_response_billing_info_address.rb +226 -0
  81. data/lib/sib-api-v3-sdk/models/master_details_response_billing_info_name.rb +196 -0
  82. data/lib/sib-api-v3-sdk/models/master_details_response_plan_info.rb +272 -0
  83. data/lib/sib-api-v3-sdk/models/{send_email_attachment.rb → master_details_response_plan_info_features.rb} +45 -44
  84. data/lib/sib-api-v3-sdk/models/note.rb +283 -0
  85. data/lib/sib-api-v3-sdk/models/note_data.rb +243 -0
  86. data/lib/sib-api-v3-sdk/models/request_contact_export.rb +6 -11
  87. data/lib/sib-api-v3-sdk/models/request_contact_export_custom_contact_filter.rb +1 -1
  88. data/lib/sib-api-v3-sdk/models/send_smtp_email.rb +3 -3
  89. data/lib/sib-api-v3-sdk/models/send_transac_sms.rb +16 -4
  90. data/lib/sib-api-v3-sdk/models/sso_token_request.rb +200 -0
  91. data/lib/sib-api-v3-sdk/models/sub_account_details_response.rb +214 -0
  92. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info.rb +204 -0
  93. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info_credits.rb +195 -0
  94. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info_credits_emails.rb +196 -0
  95. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info_features.rb +203 -0
  96. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info_features_inbox.rb +196 -0
  97. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info_features_landing_page.rb +196 -0
  98. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info_features_users.rb +196 -0
  99. data/lib/sib-api-v3-sdk/models/sub_account_update_plan_request.rb +194 -0
  100. data/lib/sib-api-v3-sdk/models/sub_account_update_plan_request_credits.rb +186 -0
  101. data/lib/sib-api-v3-sdk/models/sub_account_update_plan_request_features.rb +206 -0
  102. data/lib/sib-api-v3-sdk/models/sub_accounts_response.rb +196 -0
  103. data/lib/sib-api-v3-sdk/models/sub_accounts_response_sub_accounts.rb +235 -0
  104. data/lib/sib-api-v3-sdk/models/task.rb +367 -0
  105. data/lib/sib-api-v3-sdk/models/task_reminder.rb +257 -0
  106. data/lib/sib-api-v3-sdk/models/update_batch_contacts.rb +187 -0
  107. data/lib/sib-api-v3-sdk/models/update_batch_contacts_contacts.rb +273 -0
  108. data/lib/sib-api-v3-sdk/models/update_batch_contacts_model.rb +197 -0
  109. data/lib/sib-api-v3-sdk/models/update_sms_campaign.rb +16 -4
  110. data/lib/sib-api-v3-sdk/models/update_webhook.rb +15 -5
  111. data/lib/sib-api-v3-sdk/version.rb +1 -1
  112. data/lib/sib-api-v3-sdk.rb +41 -3
  113. data/sib-api-v3-sdk.gemspec +2 -1
  114. data/spec/api/contacts_api_spec.rb +13 -1
  115. data/spec/api/crm_api_spec.rb +170 -0
  116. data/spec/api/inbound_parsing_api_spec.rb +64 -0
  117. data/spec/api/master_account_api_spec.rb +108 -0
  118. data/spec/api/transactional_emails_api_spec.rb +2 -13
  119. data/spec/models/body_1_spec.rb +101 -0
  120. data/spec/models/body_spec.rb +101 -0
  121. data/spec/models/contact_spec.rb +83 -0
  122. data/spec/models/create_sms_campaign_spec.rb +6 -0
  123. data/spec/models/create_sub_account_spec.rb +57 -0
  124. data/spec/models/create_webhook_spec.rb +8 -2
  125. data/spec/models/file_data_spec.rb +95 -0
  126. data/spec/models/get_campaign_stats_spec.rb +6 -0
  127. data/spec/models/get_contact_campaign_stats_spec.rb +6 -0
  128. data/spec/models/get_extended_contact_details_statistics_delivered_spec.rb +47 -0
  129. data/spec/models/get_extended_contact_details_statistics_spec.rb +6 -0
  130. data/spec/models/get_inbound_email_events_by_uuid_attachments_spec.rb +59 -0
  131. data/spec/models/get_inbound_email_events_by_uuid_logs_spec.rb +51 -0
  132. data/spec/models/get_inbound_email_events_by_uuid_spec.rb +83 -0
  133. data/spec/models/get_inbound_email_events_events_spec.rb +59 -0
  134. data/spec/models/get_inbound_email_events_spec.rb +41 -0
  135. data/spec/models/master_details_response_billing_info_address_spec.rb +65 -0
  136. data/spec/models/master_details_response_billing_info_name_spec.rb +47 -0
  137. data/spec/models/master_details_response_billing_info_spec.rb +59 -0
  138. data/spec/models/master_details_response_plan_info_features_spec.rb +65 -0
  139. data/spec/models/master_details_response_plan_info_spec.rb +75 -0
  140. data/spec/models/master_details_response_spec.rb +77 -0
  141. data/spec/models/note_data_spec.rb +53 -0
  142. data/spec/models/note_spec.rb +77 -0
  143. data/spec/models/request_contact_export_spec.rb +0 -6
  144. data/spec/models/send_transac_sms_spec.rb +6 -0
  145. data/spec/models/{send_email_attachment_spec.rb → sso_token_request_spec.rb} +8 -8
  146. data/spec/models/sub_account_details_response_plan_info_credits_emails_spec.rb +47 -0
  147. data/spec/models/sub_account_details_response_plan_info_credits_spec.rb +47 -0
  148. data/spec/models/sub_account_details_response_plan_info_features_inbox_spec.rb +47 -0
  149. data/spec/models/sub_account_details_response_plan_info_features_landing_page_spec.rb +47 -0
  150. data/spec/models/sub_account_details_response_plan_info_features_spec.rb +53 -0
  151. data/spec/models/sub_account_details_response_plan_info_features_users_spec.rb +47 -0
  152. data/spec/models/sub_account_details_response_plan_info_spec.rb +53 -0
  153. data/spec/models/sub_account_details_response_spec.rb +59 -0
  154. data/spec/models/sub_account_update_plan_request_credits_spec.rb +41 -0
  155. data/spec/models/sub_account_update_plan_request_features_spec.rb +53 -0
  156. data/spec/models/sub_account_update_plan_request_spec.rb +47 -0
  157. data/spec/models/sub_accounts_response_spec.rb +47 -0
  158. data/spec/models/sub_accounts_response_sub_accounts_spec.rb +59 -0
  159. data/spec/models/task_reminder_spec.rb +57 -0
  160. data/spec/models/task_spec.rb +137 -0
  161. data/spec/models/{send_email_spec.rb → update_batch_contacts_contacts_spec.rb} +15 -15
  162. data/spec/models/update_batch_contacts_model_spec.rb +47 -0
  163. data/spec/models/{send_template_email_spec.rb → update_batch_contacts_spec.rb} +7 -7
  164. data/spec/models/update_sms_campaign_spec.rb +6 -0
  165. data/spec/models/update_webhook_spec.rb +7 -1
  166. metadata +186 -14
  167. data/docs/SendEmail.md +0 -16
  168. data/docs/SendEmailAttachment.md +0 -9
  169. data/docs/SendTemplateEmail.md +0 -8
@@ -0,0 +1,272 @@
1
+ =begin
2
+ #SendinBlue API
3
+
4
+ #SendinBlue 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/sendinblue **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@sendinblue.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 SibApiV3Sdk
16
+ # Plan details
17
+ class MasterDetailsResponsePlanInfo
18
+ # Plan currency
19
+ attr_accessor :currency_code
20
+
21
+ # Timestamp of next billing date
22
+ attr_accessor :next_billing_at
23
+
24
+ # Plan amount
25
+ attr_accessor :price
26
+
27
+ # Plan period type
28
+ attr_accessor :plan_period
29
+
30
+ # Number of sub-accounts
31
+ attr_accessor :sub_accounts
32
+
33
+ # List of provided features in the plan
34
+ attr_accessor :features
35
+
36
+ class EnumAttributeValidator
37
+ attr_reader :datatype
38
+ attr_reader :allowable_values
39
+
40
+ def initialize(datatype, allowable_values)
41
+ @allowable_values = allowable_values.map do |value|
42
+ case datatype.to_s
43
+ when /Integer/i
44
+ value.to_i
45
+ when /Float/i
46
+ value.to_f
47
+ else
48
+ value
49
+ end
50
+ end
51
+ end
52
+
53
+ def valid?(value)
54
+ !value || allowable_values.include?(value)
55
+ end
56
+ end
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'currency_code' => :'currencyCode',
62
+ :'next_billing_at' => :'nextBillingAt',
63
+ :'price' => :'price',
64
+ :'plan_period' => :'planPeriod',
65
+ :'sub_accounts' => :'subAccounts',
66
+ :'features' => :'features'
67
+ }
68
+ end
69
+
70
+ # Attribute type mapping.
71
+ def self.swagger_types
72
+ {
73
+ :'currency_code' => :'String',
74
+ :'next_billing_at' => :'Integer',
75
+ :'price' => :'Float',
76
+ :'plan_period' => :'String',
77
+ :'sub_accounts' => :'Integer',
78
+ :'features' => :'Array<MasterDetailsResponsePlanInfoFeatures>'
79
+ }
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ return unless attributes.is_a?(Hash)
86
+
87
+ # convert string to symbol for hash key
88
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
89
+
90
+ if attributes.has_key?(:'currencyCode')
91
+ self.currency_code = attributes[:'currencyCode']
92
+ end
93
+
94
+ if attributes.has_key?(:'nextBillingAt')
95
+ self.next_billing_at = attributes[:'nextBillingAt']
96
+ end
97
+
98
+ if attributes.has_key?(:'price')
99
+ self.price = attributes[:'price']
100
+ end
101
+
102
+ if attributes.has_key?(:'planPeriod')
103
+ self.plan_period = attributes[:'planPeriod']
104
+ end
105
+
106
+ if attributes.has_key?(:'subAccounts')
107
+ self.sub_accounts = attributes[:'subAccounts']
108
+ end
109
+
110
+ if attributes.has_key?(:'features')
111
+ if (value = attributes[:'features']).is_a?(Array)
112
+ self.features = value
113
+ end
114
+ end
115
+ end
116
+
117
+ # Show invalid properties with the reasons. Usually used together with valid?
118
+ # @return Array for valid properties with the reasons
119
+ def list_invalid_properties
120
+ invalid_properties = Array.new
121
+ invalid_properties
122
+ end
123
+
124
+ # Check to see if the all the properties in the model are valid
125
+ # @return true if the model is valid
126
+ def valid?
127
+ plan_period_validator = EnumAttributeValidator.new('String', ['month', 'year'])
128
+ return false unless plan_period_validator.valid?(@plan_period)
129
+ true
130
+ end
131
+
132
+ # Custom attribute writer method checking allowed values (enum).
133
+ # @param [Object] plan_period Object to be assigned
134
+ def plan_period=(plan_period)
135
+ validator = EnumAttributeValidator.new('String', ['month', 'year'])
136
+ unless validator.valid?(plan_period)
137
+ fail ArgumentError, 'invalid value for "plan_period", must be one of #{validator.allowable_values}.'
138
+ end
139
+ @plan_period = plan_period
140
+ end
141
+
142
+ # Checks equality by comparing each attribute.
143
+ # @param [Object] Object to be compared
144
+ def ==(o)
145
+ return true if self.equal?(o)
146
+ self.class == o.class &&
147
+ currency_code == o.currency_code &&
148
+ next_billing_at == o.next_billing_at &&
149
+ price == o.price &&
150
+ plan_period == o.plan_period &&
151
+ sub_accounts == o.sub_accounts &&
152
+ features == o.features
153
+ end
154
+
155
+ # @see the `==` method
156
+ # @param [Object] Object to be compared
157
+ def eql?(o)
158
+ self == o
159
+ end
160
+
161
+ # Calculates hash code according to all attributes.
162
+ # @return [Fixnum] Hash code
163
+ def hash
164
+ [currency_code, next_billing_at, price, plan_period, sub_accounts, features].hash
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def build_from_hash(attributes)
171
+ return nil unless attributes.is_a?(Hash)
172
+ self.class.swagger_types.each_pair do |key, type|
173
+ if type =~ /\AArray<(.*)>/i
174
+ # check to ensure the input is an array given that the attribute
175
+ # is documented as an array but the input is not
176
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
177
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
178
+ end
179
+ elsif !attributes[self.class.attribute_map[key]].nil?
180
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
181
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
182
+ end
183
+
184
+ self
185
+ end
186
+
187
+ # Deserializes the data based on type
188
+ # @param string type Data type
189
+ # @param string value Value to be deserialized
190
+ # @return [Object] Deserialized data
191
+ def _deserialize(type, value)
192
+ case type.to_sym
193
+ when :DateTime
194
+ DateTime.parse(value)
195
+ when :Date
196
+ Date.parse(value)
197
+ when :String
198
+ value.to_s
199
+ when :Integer
200
+ value.to_i
201
+ when :Float
202
+ value.to_f
203
+ when :BOOLEAN
204
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
205
+ true
206
+ else
207
+ false
208
+ end
209
+ when :Object
210
+ # generic object (usually a Hash), return directly
211
+ value
212
+ when /\AArray<(?<inner_type>.+)>\z/
213
+ inner_type = Regexp.last_match[:inner_type]
214
+ value.map { |v| _deserialize(inner_type, v) }
215
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
216
+ k_type = Regexp.last_match[:k_type]
217
+ v_type = Regexp.last_match[:v_type]
218
+ {}.tap do |hash|
219
+ value.each do |k, v|
220
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
221
+ end
222
+ end
223
+ else # model
224
+ temp_model = SibApiV3Sdk.const_get(type).new
225
+ temp_model.build_from_hash(value)
226
+ end
227
+ end
228
+
229
+ # Returns the string representation of the object
230
+ # @return [String] String presentation of the object
231
+ def to_s
232
+ to_hash.to_s
233
+ end
234
+
235
+ # to_body is an alias to to_hash (backward compatibility)
236
+ # @return [Hash] Returns the object in the form of hash
237
+ def to_body
238
+ to_hash
239
+ end
240
+
241
+ # Returns the object in the form of hash
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_hash
244
+ hash = {}
245
+ self.class.attribute_map.each_pair do |attr, param|
246
+ value = self.send(attr)
247
+ next if value.nil?
248
+ hash[param] = _to_hash(value)
249
+ end
250
+ hash
251
+ end
252
+
253
+ # Outputs non-array value in the form of hash
254
+ # For object, use to_hash. Otherwise, just return the value
255
+ # @param [Object] value Any valid value
256
+ # @return [Hash] Returns the value in the form of hash
257
+ def _to_hash(value)
258
+ if value.is_a?(Array)
259
+ value.compact.map { |v| _to_hash(v) }
260
+ elsif value.is_a?(Hash)
261
+ {}.tap do |hash|
262
+ value.each { |k, v| hash[k] = _to_hash(v) }
263
+ end
264
+ elsif value.respond_to? :to_hash
265
+ value.to_hash
266
+ else
267
+ value
268
+ end
269
+ end
270
+
271
+ end
272
+ end
@@ -13,26 +13,41 @@ Swagger Codegen version: 2.4.19
13
13
  require 'date'
14
14
 
15
15
  module SibApiV3Sdk
16
- class SendEmailAttachment
17
- # Base64 encoded chunk data of the attachment generated on the fly
18
- attr_accessor :content
19
-
20
- # Required for content. Name of the attachment
16
+ class MasterDetailsResponsePlanInfoFeatures
17
+ # Name of the feature
21
18
  attr_accessor :name
22
19
 
20
+ # Unit value of the feature
21
+ attr_accessor :unit_value
22
+
23
+ # Quantity provided in the plan
24
+ attr_accessor :quantity
25
+
26
+ # Quantity consumed by master
27
+ attr_accessor :used
28
+
29
+ # Quantity remaining in the plan
30
+ attr_accessor :remaining
31
+
23
32
  # Attribute mapping from ruby-style variable name to JSON key.
24
33
  def self.attribute_map
25
34
  {
26
- :'content' => :'content',
27
- :'name' => :'name'
35
+ :'name' => :'name',
36
+ :'unit_value' => :'unitValue',
37
+ :'quantity' => :'quantity',
38
+ :'used' => :'used',
39
+ :'remaining' => :'remaining'
28
40
  }
29
41
  end
30
42
 
31
43
  # Attribute type mapping.
32
44
  def self.swagger_types
33
45
  {
34
- :'content' => :'String',
35
- :'name' => :'String'
46
+ :'name' => :'String',
47
+ :'unit_value' => :'String',
48
+ :'quantity' => :'Integer',
49
+ :'used' => :'Integer',
50
+ :'remaining' => :'Integer'
36
51
  }
37
52
  end
38
53
 
@@ -44,64 +59,50 @@ module SibApiV3Sdk
44
59
  # convert string to symbol for hash key
45
60
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
46
61
 
47
- if attributes.has_key?(:'content')
48
- self.content = attributes[:'content']
49
- end
50
-
51
62
  if attributes.has_key?(:'name')
52
63
  self.name = attributes[:'name']
53
64
  end
54
- end
55
65
 
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
- if @content.nil?
61
- invalid_properties.push('invalid value for "content", content cannot be nil.')
66
+ if attributes.has_key?(:'unitValue')
67
+ self.unit_value = attributes[:'unitValue']
62
68
  end
63
69
 
64
- if @content !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
65
- invalid_properties.push('invalid value for "content", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.')
70
+ if attributes.has_key?(:'quantity')
71
+ self.quantity = attributes[:'quantity']
66
72
  end
67
73
 
68
- if @name.nil?
69
- invalid_properties.push('invalid value for "name", name cannot be nil.')
74
+ if attributes.has_key?(:'used')
75
+ self.used = attributes[:'used']
70
76
  end
71
77
 
78
+ if attributes.has_key?(:'remaining')
79
+ self.remaining = attributes[:'remaining']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = Array.new
72
87
  invalid_properties
73
88
  end
74
89
 
75
90
  # Check to see if the all the properties in the model are valid
76
91
  # @return true if the model is valid
77
92
  def valid?
78
- return false if @content.nil?
79
- return false if @content !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
80
- return false if @name.nil?
81
93
  true
82
94
  end
83
95
 
84
- # Custom attribute writer method with validation
85
- # @param [Object] content Value to be assigned
86
- def content=(content)
87
- if content.nil?
88
- fail ArgumentError, 'content cannot be nil'
89
- end
90
-
91
- if content !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
92
- fail ArgumentError, 'invalid value for "content", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.'
93
- end
94
-
95
- @content = content
96
- end
97
-
98
96
  # Checks equality by comparing each attribute.
99
97
  # @param [Object] Object to be compared
100
98
  def ==(o)
101
99
  return true if self.equal?(o)
102
100
  self.class == o.class &&
103
- content == o.content &&
104
- name == o.name
101
+ name == o.name &&
102
+ unit_value == o.unit_value &&
103
+ quantity == o.quantity &&
104
+ used == o.used &&
105
+ remaining == o.remaining
105
106
  end
106
107
 
107
108
  # @see the `==` method
@@ -113,7 +114,7 @@ module SibApiV3Sdk
113
114
  # Calculates hash code according to all attributes.
114
115
  # @return [Fixnum] Hash code
115
116
  def hash
116
- [content, name].hash
117
+ [name, unit_value, quantity, used, remaining].hash
117
118
  end
118
119
 
119
120
  # Builds the object from hash
@@ -0,0 +1,283 @@
1
+ =begin
2
+ #SendinBlue API
3
+
4
+ #SendinBlue 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/sendinblue **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@sendinblue.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 SibApiV3Sdk
16
+ # Note Details
17
+ class Note
18
+ # Unique note Id
19
+ attr_accessor :id
20
+
21
+ # Text content of a note
22
+ attr_accessor :text
23
+
24
+ # Contact ids linked to a note
25
+ attr_accessor :contact_ids
26
+
27
+ # Deal ids linked to a note
28
+ attr_accessor :deal_ids
29
+
30
+ # Account details of user which created the note
31
+ attr_accessor :author_id
32
+
33
+ # Note created date/time
34
+ attr_accessor :created_at
35
+
36
+ # Note updated date/time
37
+ attr_accessor :updated_at
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'id' => :'id',
43
+ :'text' => :'text',
44
+ :'contact_ids' => :'contactIds',
45
+ :'deal_ids' => :'dealIds',
46
+ :'author_id' => :'authorId',
47
+ :'created_at' => :'createdAt',
48
+ :'updated_at' => :'updatedAt'
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.swagger_types
54
+ {
55
+ :'id' => :'String',
56
+ :'text' => :'String',
57
+ :'contact_ids' => :'Array<Integer>',
58
+ :'deal_ids' => :'Array<String>',
59
+ :'author_id' => :'Object',
60
+ :'created_at' => :'DateTime',
61
+ :'updated_at' => :'DateTime'
62
+ }
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ return unless attributes.is_a?(Hash)
69
+
70
+ # convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
72
+
73
+ if attributes.has_key?(:'id')
74
+ self.id = attributes[:'id']
75
+ end
76
+
77
+ if attributes.has_key?(:'text')
78
+ self.text = attributes[:'text']
79
+ end
80
+
81
+ if attributes.has_key?(:'contactIds')
82
+ if (value = attributes[:'contactIds']).is_a?(Array)
83
+ self.contact_ids = value
84
+ end
85
+ end
86
+
87
+ if attributes.has_key?(:'dealIds')
88
+ if (value = attributes[:'dealIds']).is_a?(Array)
89
+ self.deal_ids = value
90
+ end
91
+ end
92
+
93
+ if attributes.has_key?(:'authorId')
94
+ self.author_id = attributes[:'authorId']
95
+ end
96
+
97
+ if attributes.has_key?(:'createdAt')
98
+ self.created_at = attributes[:'createdAt']
99
+ end
100
+
101
+ if attributes.has_key?(:'updatedAt')
102
+ self.updated_at = attributes[:'updatedAt']
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ invalid_properties = Array.new
110
+ if @text.nil?
111
+ invalid_properties.push('invalid value for "text", text cannot be nil.')
112
+ end
113
+
114
+ if @text.to_s.length > 3000
115
+ invalid_properties.push('invalid value for "text", the character length must be smaller than or equal to 3000.')
116
+ end
117
+
118
+ if @text.to_s.length < 1
119
+ invalid_properties.push('invalid value for "text", the character length must be great than or equal to 1.')
120
+ end
121
+
122
+ invalid_properties
123
+ end
124
+
125
+ # Check to see if the all the properties in the model are valid
126
+ # @return true if the model is valid
127
+ def valid?
128
+ return false if @text.nil?
129
+ return false if @text.to_s.length > 3000
130
+ return false if @text.to_s.length < 1
131
+ true
132
+ end
133
+
134
+ # Custom attribute writer method with validation
135
+ # @param [Object] text Value to be assigned
136
+ def text=(text)
137
+ if text.nil?
138
+ fail ArgumentError, 'text cannot be nil'
139
+ end
140
+
141
+ if text.to_s.length > 3000
142
+ fail ArgumentError, 'invalid value for "text", the character length must be smaller than or equal to 3000.'
143
+ end
144
+
145
+ if text.to_s.length < 1
146
+ fail ArgumentError, 'invalid value for "text", the character length must be great than or equal to 1.'
147
+ end
148
+
149
+ @text = text
150
+ end
151
+
152
+ # Checks equality by comparing each attribute.
153
+ # @param [Object] Object to be compared
154
+ def ==(o)
155
+ return true if self.equal?(o)
156
+ self.class == o.class &&
157
+ id == o.id &&
158
+ text == o.text &&
159
+ contact_ids == o.contact_ids &&
160
+ deal_ids == o.deal_ids &&
161
+ author_id == o.author_id &&
162
+ created_at == o.created_at &&
163
+ updated_at == o.updated_at
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(o)
169
+ self == o
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Fixnum] Hash code
174
+ def hash
175
+ [id, text, contact_ids, deal_ids, author_id, created_at, updated_at].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ self.class.swagger_types.each_pair do |key, type|
184
+ if type =~ /\AArray<(.*)>/i
185
+ # check to ensure the input is an array given that the attribute
186
+ # is documented as an array but the input is not
187
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
188
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
189
+ end
190
+ elsif !attributes[self.class.attribute_map[key]].nil?
191
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
192
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
193
+ end
194
+
195
+ self
196
+ end
197
+
198
+ # Deserializes the data based on type
199
+ # @param string type Data type
200
+ # @param string value Value to be deserialized
201
+ # @return [Object] Deserialized data
202
+ def _deserialize(type, value)
203
+ case type.to_sym
204
+ when :DateTime
205
+ DateTime.parse(value)
206
+ when :Date
207
+ Date.parse(value)
208
+ when :String
209
+ value.to_s
210
+ when :Integer
211
+ value.to_i
212
+ when :Float
213
+ value.to_f
214
+ when :BOOLEAN
215
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
216
+ true
217
+ else
218
+ false
219
+ end
220
+ when :Object
221
+ # generic object (usually a Hash), return directly
222
+ value
223
+ when /\AArray<(?<inner_type>.+)>\z/
224
+ inner_type = Regexp.last_match[:inner_type]
225
+ value.map { |v| _deserialize(inner_type, v) }
226
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
227
+ k_type = Regexp.last_match[:k_type]
228
+ v_type = Regexp.last_match[:v_type]
229
+ {}.tap do |hash|
230
+ value.each do |k, v|
231
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
232
+ end
233
+ end
234
+ else # model
235
+ temp_model = SibApiV3Sdk.const_get(type).new
236
+ temp_model.build_from_hash(value)
237
+ end
238
+ end
239
+
240
+ # Returns the string representation of the object
241
+ # @return [String] String presentation of the object
242
+ def to_s
243
+ to_hash.to_s
244
+ end
245
+
246
+ # to_body is an alias to to_hash (backward compatibility)
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_body
249
+ to_hash
250
+ end
251
+
252
+ # Returns the object in the form of hash
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_hash
255
+ hash = {}
256
+ self.class.attribute_map.each_pair do |attr, param|
257
+ value = self.send(attr)
258
+ next if value.nil?
259
+ hash[param] = _to_hash(value)
260
+ end
261
+ hash
262
+ end
263
+
264
+ # Outputs non-array value in the form of hash
265
+ # For object, use to_hash. Otherwise, just return the value
266
+ # @param [Object] value Any valid value
267
+ # @return [Hash] Returns the value in the form of hash
268
+ def _to_hash(value)
269
+ if value.is_a?(Array)
270
+ value.compact.map { |v| _to_hash(v) }
271
+ elsif value.is_a?(Hash)
272
+ {}.tap do |hash|
273
+ value.each { |k, v| hash[k] = _to_hash(v) }
274
+ end
275
+ elsif value.respond_to? :to_hash
276
+ value.to_hash
277
+ else
278
+ value
279
+ end
280
+ end
281
+
282
+ end
283
+ end