sib-api-v3-sdk 8.1.0 → 9.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +82 -33
  3. data/docs/Body.md +3 -11
  4. data/docs/Body1.md +3 -11
  5. data/docs/Body10.md +11 -0
  6. data/docs/Body11.md +8 -0
  7. data/docs/Body12.md +11 -0
  8. data/docs/Body2.md +11 -0
  9. data/docs/Body3.md +9 -0
  10. data/docs/Body4.md +9 -0
  11. data/docs/Body5.md +11 -0
  12. data/docs/Body6.md +18 -0
  13. data/docs/Body7.md +17 -0
  14. data/docs/Body8.md +13 -0
  15. data/docs/Body9.md +8 -0
  16. data/docs/CompaniesApi.md +425 -0
  17. data/docs/CompaniesList.md +8 -0
  18. data/docs/Company.md +11 -0
  19. data/docs/CompanyAttributes.md +7 -0
  20. data/docs/CompanyAttributesInner.md +12 -0
  21. data/docs/ContactsApi.md +8 -2
  22. data/docs/{ListsApi.md → ConversationsApi.md} +115 -133
  23. data/docs/ConversationsMessage.md +17 -0
  24. data/docs/ConversationsMessageFile.md +12 -0
  25. data/docs/ConversationsMessageFileImageInfo.md +10 -0
  26. data/docs/CreateContact.md +1 -1
  27. data/docs/CreateEmailCampaign.md +2 -0
  28. data/docs/CreateEmailCampaignRecipients.md +1 -0
  29. data/docs/CreateSubAccount.md +3 -3
  30. data/docs/CreateSubAccountResponse.md +8 -0
  31. data/docs/Deal.md +11 -0
  32. data/docs/DealAttributes.md +7 -0
  33. data/docs/DealAttributesInner.md +12 -0
  34. data/docs/DealsApi.md +476 -0
  35. data/docs/DealsList.md +8 -0
  36. data/docs/EmailCampaignsApi.md +6 -5
  37. data/docs/FileData.md +3 -6
  38. data/docs/FileDownloadableLink.md +8 -0
  39. data/docs/FileList.md +7 -0
  40. data/docs/FilesApi.md +318 -0
  41. data/docs/GetCampaignStats.md +2 -0
  42. data/docs/GetScheduledEmailByBatchId.md +9 -0
  43. data/docs/GetScheduledEmailByBatchIdBatches.md +10 -0
  44. data/docs/GetScheduledEmailByMessageId.md +10 -0
  45. data/docs/GetSsoToken.md +1 -1
  46. data/docs/InboundParsingApi.md +60 -0
  47. data/docs/InlineResponse200.md +8 -0
  48. data/docs/InlineResponse201.md +8 -0
  49. data/docs/InlineResponse2011.md +8 -0
  50. data/docs/MasterAccountApi.md +6 -6
  51. data/docs/NoteData.md +1 -0
  52. data/docs/NoteId.md +8 -0
  53. data/docs/NoteList.md +7 -0
  54. data/docs/NotesApi.md +312 -0
  55. data/docs/Pipeline.md +8 -0
  56. data/docs/PipelineStage.md +9 -0
  57. data/docs/ScheduleSmtpEmail.md +10 -0
  58. data/docs/SendSmtpEmail.md +3 -1
  59. data/docs/SubAccountDetailsResponsePlanInfoCredits.md +1 -1
  60. data/docs/SubAccountsResponseSubAccounts.md +4 -4
  61. data/docs/Task.md +0 -11
  62. data/docs/TaskList.md +8 -0
  63. data/docs/TaskReminder.md +1 -1
  64. data/docs/TaskTypes.md +0 -1
  65. data/docs/{FoldersApi.md → TasksApi.md} +95 -91
  66. data/docs/TransactionalEmailsApi.md +201 -2
  67. data/docs/UpdateContact.md +1 -1
  68. data/docs/UpdateEmailCampaign.md +3 -1
  69. data/docs/UpdateEmailCampaignRecipients.md +2 -1
  70. data/docs/UpdateSmtpTemplate.md +1 -1
  71. data/docs/UploadImageModel.md +8 -0
  72. data/lib/sib-api-v3-sdk/api/companies_api.rb +409 -0
  73. data/lib/sib-api-v3-sdk/api/contacts_api.rb +26 -0
  74. data/lib/sib-api-v3-sdk/api/conversations_api.rb +504 -0
  75. data/lib/sib-api-v3-sdk/api/deals_api.rb +454 -0
  76. data/lib/sib-api-v3-sdk/api/email_campaigns_api.rb +13 -8
  77. data/lib/sib-api-v3-sdk/api/files_api.rb +313 -0
  78. data/lib/sib-api-v3-sdk/api/inbound_parsing_api.rb +57 -1
  79. data/lib/sib-api-v3-sdk/api/master_account_api.rb +9 -9
  80. data/lib/sib-api-v3-sdk/api/notes_api.rb +308 -0
  81. data/lib/sib-api-v3-sdk/api/process_api.rb +4 -0
  82. data/lib/sib-api-v3-sdk/api/reseller_api.rb +4 -0
  83. data/lib/sib-api-v3-sdk/api/sms_campaigns_api.rb +4 -0
  84. data/lib/sib-api-v3-sdk/api/tasks_api.rb +375 -0
  85. data/lib/sib-api-v3-sdk/api/transactional_emails_api.rb +222 -3
  86. data/lib/sib-api-v3-sdk/models/body.rb +16 -111
  87. data/lib/sib-api-v3-sdk/models/body_1.rb +16 -116
  88. data/lib/sib-api-v3-sdk/models/body_10.rb +225 -0
  89. data/lib/sib-api-v3-sdk/models/body_11.rb +190 -0
  90. data/lib/sib-api-v3-sdk/models/body_12.rb +215 -0
  91. data/lib/sib-api-v3-sdk/models/body_2.rb +223 -0
  92. data/lib/sib-api-v3-sdk/models/body_3.rb +200 -0
  93. data/lib/sib-api-v3-sdk/models/body_4.rb +195 -0
  94. data/lib/sib-api-v3-sdk/models/body_5.rb +223 -0
  95. data/lib/sib-api-v3-sdk/models/body_6.rb +320 -0
  96. data/lib/sib-api-v3-sdk/models/body_7.rb +281 -0
  97. data/lib/sib-api-v3-sdk/models/body_8.rb +245 -0
  98. data/lib/sib-api-v3-sdk/models/body_9.rb +190 -0
  99. data/lib/sib-api-v3-sdk/models/companies_list.rb +188 -0
  100. data/lib/sib-api-v3-sdk/models/company.rb +220 -0
  101. data/lib/sib-api-v3-sdk/models/company_attributes.rb +176 -0
  102. data/lib/sib-api-v3-sdk/models/company_attributes_inner.rb +223 -0
  103. data/lib/sib-api-v3-sdk/models/conversations_message.rb +324 -0
  104. data/lib/sib-api-v3-sdk/models/conversations_message_file.rb +239 -0
  105. data/lib/sib-api-v3-sdk/models/conversations_message_file_image_info.rb +236 -0
  106. data/lib/sib-api-v3-sdk/models/create_contact.rb +1 -1
  107. data/lib/sib-api-v3-sdk/models/create_email_campaign.rb +24 -4
  108. data/lib/sib-api-v3-sdk/models/create_email_campaign_recipients.rb +17 -5
  109. data/lib/sib-api-v3-sdk/models/create_sub_account.rb +3 -3
  110. data/lib/sib-api-v3-sdk/models/create_sub_account_response.rb +190 -0
  111. data/lib/sib-api-v3-sdk/models/deal.rb +220 -0
  112. data/lib/sib-api-v3-sdk/models/deal_attributes.rb +176 -0
  113. data/lib/sib-api-v3-sdk/models/deal_attributes_inner.rb +223 -0
  114. data/lib/sib-api-v3-sdk/models/deals_list.rb +188 -0
  115. data/lib/sib-api-v3-sdk/models/file_data.rb +22 -54
  116. data/lib/sib-api-v3-sdk/models/file_downloadable_link.rb +190 -0
  117. data/lib/sib-api-v3-sdk/models/file_list.rb +176 -0
  118. data/lib/sib-api-v3-sdk/models/get_campaign_stats.rb +21 -1
  119. data/lib/sib-api-v3-sdk/models/get_scheduled_email_by_batch_id.rb +196 -0
  120. data/lib/sib-api-v3-sdk/models/{contact.rb → get_scheduled_email_by_batch_id_batches.rb} +62 -74
  121. data/lib/sib-api-v3-sdk/models/get_scheduled_email_by_message_id.rb +254 -0
  122. data/lib/sib-api-v3-sdk/models/get_sso_token.rb +1 -1
  123. data/lib/sib-api-v3-sdk/models/inline_response_200.rb +191 -0
  124. data/lib/sib-api-v3-sdk/models/inline_response_201.rb +191 -0
  125. data/lib/sib-api-v3-sdk/models/inline_response_201_1.rb +191 -0
  126. data/lib/sib-api-v3-sdk/models/note_data.rb +16 -4
  127. data/lib/sib-api-v3-sdk/models/note_id.rb +186 -0
  128. data/lib/sib-api-v3-sdk/models/note_list.rb +176 -0
  129. data/lib/sib-api-v3-sdk/models/pipeline.rb +188 -0
  130. data/lib/sib-api-v3-sdk/models/pipeline_stage.rb +196 -0
  131. data/lib/sib-api-v3-sdk/models/schedule_smtp_email.rb +206 -0
  132. data/lib/sib-api-v3-sdk/models/send_smtp_email.rb +24 -4
  133. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info_credits.rb +2 -2
  134. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info_credits_emails.rb +1 -1
  135. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info_features.rb +1 -1
  136. data/lib/sib-api-v3-sdk/models/sub_accounts_response_sub_accounts.rb +4 -4
  137. data/lib/sib-api-v3-sdk/models/task.rb +4 -119
  138. data/lib/sib-api-v3-sdk/models/task_list.rb +188 -0
  139. data/lib/sib-api-v3-sdk/models/task_reminder.rb +1 -1
  140. data/lib/sib-api-v3-sdk/models/task_types.rb +1 -11
  141. data/lib/sib-api-v3-sdk/models/update_contact.rb +1 -1
  142. data/lib/sib-api-v3-sdk/models/update_email_campaign.rb +25 -5
  143. data/lib/sib-api-v3-sdk/models/update_email_campaign_recipients.rb +18 -6
  144. data/lib/sib-api-v3-sdk/models/update_smtp_template.rb +1 -1
  145. data/lib/sib-api-v3-sdk/models/upload_image_model.rb +190 -0
  146. data/lib/sib-api-v3-sdk/version.rb +1 -1
  147. data/lib/sib-api-v3-sdk.rb +44 -5
  148. data/spec/api/companies_api_spec.rb +119 -0
  149. data/spec/api/contacts_api_spec.rb +2 -0
  150. data/spec/api/{crm_api_spec.rb → conversations_api_spec.rb} +54 -94
  151. data/spec/api/{lists_api_spec.rb → deals_api_spec.rb} +51 -68
  152. data/spec/api/email_campaigns_api_spec.rb +1 -1
  153. data/spec/api/files_api_spec.rb +99 -0
  154. data/spec/api/inbound_parsing_api_spec.rb +12 -0
  155. data/spec/api/master_account_api_spec.rb +4 -4
  156. data/spec/api/notes_api_spec.rb +97 -0
  157. data/spec/api/{folders_api_spec.rb → tasks_api_spec.rb} +47 -41
  158. data/spec/api/transactional_emails_api_spec.rb +44 -0
  159. data/spec/models/body_10_spec.rb +59 -0
  160. data/spec/models/body_11_spec.rb +41 -0
  161. data/spec/models/body_12_spec.rb +59 -0
  162. data/spec/models/body_1_spec.rb +2 -50
  163. data/spec/models/body_2_spec.rb +59 -0
  164. data/spec/models/body_3_spec.rb +47 -0
  165. data/spec/models/body_4_spec.rb +47 -0
  166. data/spec/models/body_5_spec.rb +59 -0
  167. data/spec/models/body_6_spec.rb +101 -0
  168. data/spec/models/{contact_spec.rb → body_7_spec.rb} +26 -14
  169. data/spec/{api/attributes_api_spec.rb → models/body_8_spec.rb} +22 -34
  170. data/spec/models/body_9_spec.rb +41 -0
  171. data/spec/models/body_spec.rb +2 -50
  172. data/spec/models/companies_list_spec.rb +41 -0
  173. data/spec/models/company_attributes_inner_spec.rb +65 -0
  174. data/spec/models/company_attributes_spec.rb +35 -0
  175. data/spec/models/company_spec.rb +59 -0
  176. data/spec/models/conversations_message_file_image_info_spec.rb +53 -0
  177. data/spec/models/conversations_message_file_spec.rb +65 -0
  178. data/spec/models/conversations_message_spec.rb +99 -0
  179. data/spec/models/create_email_campaign_recipients_spec.rb +6 -0
  180. data/spec/models/create_email_campaign_spec.rb +12 -0
  181. data/spec/models/create_sub_account_response_spec.rb +41 -0
  182. data/spec/models/deal_attributes_inner_spec.rb +65 -0
  183. data/spec/models/deal_attributes_spec.rb +35 -0
  184. data/spec/models/deal_spec.rb +59 -0
  185. data/spec/models/deals_list_spec.rb +41 -0
  186. data/spec/models/file_data_spec.rb +3 -21
  187. data/spec/models/file_downloadable_link_spec.rb +41 -0
  188. data/spec/models/file_list_spec.rb +35 -0
  189. data/spec/models/get_campaign_stats_spec.rb +12 -0
  190. data/spec/models/get_scheduled_email_by_batch_id_batches_spec.rb +57 -0
  191. data/spec/models/get_scheduled_email_by_batch_id_spec.rb +47 -0
  192. data/spec/models/get_scheduled_email_by_message_id_spec.rb +57 -0
  193. data/spec/models/inline_response_200_spec.rb +41 -0
  194. data/spec/models/inline_response_201_1_spec.rb +41 -0
  195. data/spec/models/inline_response_201_spec.rb +41 -0
  196. data/spec/models/note_data_spec.rb +6 -0
  197. data/spec/models/note_id_spec.rb +41 -0
  198. data/spec/models/note_list_spec.rb +35 -0
  199. data/spec/models/pipeline_spec.rb +41 -0
  200. data/spec/models/pipeline_stage_spec.rb +47 -0
  201. data/spec/models/schedule_smtp_email_spec.rb +53 -0
  202. data/spec/models/send_smtp_email_spec.rb +12 -0
  203. data/spec/models/task_list_spec.rb +41 -0
  204. data/spec/models/task_spec.rb +0 -66
  205. data/spec/models/task_types_spec.rb +0 -6
  206. data/spec/models/update_email_campaign_recipients_spec.rb +6 -0
  207. data/spec/models/update_email_campaign_spec.rb +12 -0
  208. data/spec/models/upload_image_model_spec.rb +41 -0
  209. metadata +179 -23
  210. data/docs/AttributesApi.md +0 -246
  211. data/docs/CRMApi.md +0 -762
  212. data/docs/Contact.md +0 -15
  213. data/lib/sib-api-v3-sdk/api/attributes_api.rb +0 -274
  214. data/lib/sib-api-v3-sdk/api/crm_api.rb +0 -716
  215. data/lib/sib-api-v3-sdk/api/folders_api.rb +0 -383
  216. data/lib/sib-api-v3-sdk/api/lists_api.rb +0 -562
@@ -44,6 +44,12 @@ module SibApiV3Sdk
44
44
  # Recipients without any privacy protection option enabled in their email client
45
45
  attr_accessor :trackable_views
46
46
 
47
+ # Rate of recipients without any privacy protection option enabled in their email client
48
+ attr_accessor :trackable_views_rate
49
+
50
+ # Rate of recipients without any privacy protection option enabled in their email client, applied to all delivered emails
51
+ attr_accessor :estimated_views
52
+
47
53
  # Number of unsubscription for the campaign
48
54
  attr_accessor :unsubscriptions
49
55
 
@@ -69,6 +75,8 @@ module SibApiV3Sdk
69
75
  :'hard_bounces' => :'hardBounces',
70
76
  :'unique_views' => :'uniqueViews',
71
77
  :'trackable_views' => :'trackableViews',
78
+ :'trackable_views_rate' => :'trackableViewsRate',
79
+ :'estimated_views' => :'estimatedViews',
72
80
  :'unsubscriptions' => :'unsubscriptions',
73
81
  :'viewed' => :'viewed',
74
82
  :'deferred' => :'deferred',
@@ -89,6 +97,8 @@ module SibApiV3Sdk
89
97
  :'hard_bounces' => :'Integer',
90
98
  :'unique_views' => :'Integer',
91
99
  :'trackable_views' => :'Integer',
100
+ :'trackable_views_rate' => :'Float',
101
+ :'estimated_views' => :'Integer',
92
102
  :'unsubscriptions' => :'Integer',
93
103
  :'viewed' => :'Integer',
94
104
  :'deferred' => :'Integer',
@@ -144,6 +154,14 @@ module SibApiV3Sdk
144
154
  self.trackable_views = attributes[:'trackableViews']
145
155
  end
146
156
 
157
+ if attributes.has_key?(:'trackableViewsRate')
158
+ self.trackable_views_rate = attributes[:'trackableViewsRate']
159
+ end
160
+
161
+ if attributes.has_key?(:'estimatedViews')
162
+ self.estimated_views = attributes[:'estimatedViews']
163
+ end
164
+
147
165
  if attributes.has_key?(:'unsubscriptions')
148
166
  self.unsubscriptions = attributes[:'unsubscriptions']
149
167
  end
@@ -244,6 +262,8 @@ module SibApiV3Sdk
244
262
  hard_bounces == o.hard_bounces &&
245
263
  unique_views == o.unique_views &&
246
264
  trackable_views == o.trackable_views &&
265
+ trackable_views_rate == o.trackable_views_rate &&
266
+ estimated_views == o.estimated_views &&
247
267
  unsubscriptions == o.unsubscriptions &&
248
268
  viewed == o.viewed &&
249
269
  deferred == o.deferred &&
@@ -259,7 +279,7 @@ module SibApiV3Sdk
259
279
  # Calculates hash code according to all attributes.
260
280
  # @return [Fixnum] Hash code
261
281
  def hash
262
- [list_id, unique_clicks, clickers, complaints, delivered, sent, soft_bounces, hard_bounces, unique_views, trackable_views, unsubscriptions, viewed, deferred, return_bounce].hash
282
+ [list_id, unique_clicks, clickers, complaints, delivered, sent, soft_bounces, hard_bounces, unique_views, trackable_views, trackable_views_rate, estimated_views, unsubscriptions, viewed, deferred, return_bounce].hash
263
283
  end
264
284
 
265
285
  # Builds the object from hash
@@ -0,0 +1,196 @@
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
+ class GetScheduledEmailByBatchId
17
+ # Total number of batches
18
+ attr_accessor :count
19
+
20
+ attr_accessor :batches
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'count' => :'count',
26
+ :'batches' => :'batches'
27
+ }
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.swagger_types
32
+ {
33
+ :'count' => :'Integer',
34
+ :'batches' => :'Array<GetScheduledEmailByBatchIdBatches>'
35
+ }
36
+ end
37
+
38
+ # Initializes the object
39
+ # @param [Hash] attributes Model attributes in the form of hash
40
+ def initialize(attributes = {})
41
+ return unless attributes.is_a?(Hash)
42
+
43
+ # convert string to symbol for hash key
44
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
45
+
46
+ if attributes.has_key?(:'count')
47
+ self.count = attributes[:'count']
48
+ end
49
+
50
+ if attributes.has_key?(:'batches')
51
+ if (value = attributes[:'batches']).is_a?(Array)
52
+ self.batches = value
53
+ end
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
+ count == o.count &&
76
+ batches == o.batches
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
+ [count, batches].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 = SibApiV3Sdk.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
@@ -13,57 +13,53 @@ Swagger Codegen version: 2.4.19
13
13
  require 'date'
14
14
 
15
15
  module SibApiV3Sdk
16
- # Contact Details
17
- class Contact
18
- # Next incomplete task of contact
19
- attr_accessor :virtual_next_task
16
+ class GetScheduledEmailByBatchIdBatches
17
+ # Datetime for which the batch was scheduled
18
+ attr_accessor :scheduled_at
20
19
 
21
- # Contact email
22
- attr_accessor :email
23
-
24
- # User id to whom contact is assigned
25
- attr_accessor :assign_to_id
26
-
27
- # Contact id
28
- attr_accessor :contacts_id
29
-
30
- # CRM lists in which contact is added
31
- attr_accessor :crm_lists
32
-
33
- # Contact attributes e.g firstname / lastname / SMS etc.
34
- attr_accessor :attributes
35
-
36
- # Contact created date/time
20
+ # Datetime on which the batch was scheduled
37
21
  attr_accessor :created_at
38
22
 
39
- # Contact updated date/time
40
- attr_accessor :updated_at
23
+ # Current status of the scheduled batch
24
+ attr_accessor :status
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
41
47
 
42
48
  # Attribute mapping from ruby-style variable name to JSON key.
43
49
  def self.attribute_map
44
50
  {
45
- :'virtual_next_task' => :'virtualNextTask',
46
- :'email' => :'email',
47
- :'assign_to_id' => :'assignToId',
48
- :'contacts_id' => :'contactsId',
49
- :'crm_lists' => :'crmLists',
50
- :'attributes' => :'attributes',
51
+ :'scheduled_at' => :'scheduledAt',
51
52
  :'created_at' => :'createdAt',
52
- :'updated_at' => :'updatedAt'
53
+ :'status' => :'status'
53
54
  }
54
55
  end
55
56
 
56
57
  # Attribute type mapping.
57
58
  def self.swagger_types
58
59
  {
59
- :'virtual_next_task' => :'Object',
60
- :'email' => :'String',
61
- :'assign_to_id' => :'String',
62
- :'contacts_id' => :'Integer',
63
- :'crm_lists' => :'Object',
64
- :'attributes' => :'Object',
60
+ :'scheduled_at' => :'DateTime',
65
61
  :'created_at' => :'DateTime',
66
- :'updated_at' => :'DateTime'
62
+ :'status' => :'String'
67
63
  }
68
64
  end
69
65
 
@@ -75,36 +71,16 @@ module SibApiV3Sdk
75
71
  # convert string to symbol for hash key
76
72
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
77
73
 
78
- if attributes.has_key?(:'virtualNextTask')
79
- self.virtual_next_task = attributes[:'virtualNextTask']
80
- end
81
-
82
- if attributes.has_key?(:'email')
83
- self.email = attributes[:'email']
84
- end
85
-
86
- if attributes.has_key?(:'assignToId')
87
- self.assign_to_id = attributes[:'assignToId']
88
- end
89
-
90
- if attributes.has_key?(:'contactsId')
91
- self.contacts_id = attributes[:'contactsId']
92
- end
93
-
94
- if attributes.has_key?(:'crmLists')
95
- self.crm_lists = attributes[:'crmLists']
96
- end
97
-
98
- if attributes.has_key?(:'attributes')
99
- self.attributes = attributes[:'attributes']
74
+ if attributes.has_key?(:'scheduledAt')
75
+ self.scheduled_at = attributes[:'scheduledAt']
100
76
  end
101
77
 
102
78
  if attributes.has_key?(:'createdAt')
103
79
  self.created_at = attributes[:'createdAt']
104
80
  end
105
81
 
106
- if attributes.has_key?(:'updatedAt')
107
- self.updated_at = attributes[:'updatedAt']
82
+ if attributes.has_key?(:'status')
83
+ self.status = attributes[:'status']
108
84
  end
109
85
  end
110
86
 
@@ -112,12 +88,16 @@ module SibApiV3Sdk
112
88
  # @return Array for valid properties with the reasons
113
89
  def list_invalid_properties
114
90
  invalid_properties = Array.new
115
- if @email.nil?
116
- invalid_properties.push('invalid value for "email", email cannot be nil.')
91
+ if @scheduled_at.nil?
92
+ invalid_properties.push('invalid value for "scheduled_at", scheduled_at cannot be nil.')
93
+ end
94
+
95
+ if @created_at.nil?
96
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
117
97
  end
118
98
 
119
- if @crm_lists.nil?
120
- invalid_properties.push('invalid value for "crm_lists", crm_lists cannot be nil.')
99
+ if @status.nil?
100
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
121
101
  end
122
102
 
123
103
  invalid_properties
@@ -126,24 +106,32 @@ module SibApiV3Sdk
126
106
  # Check to see if the all the properties in the model are valid
127
107
  # @return true if the model is valid
128
108
  def valid?
129
- return false if @email.nil?
130
- return false if @crm_lists.nil?
109
+ return false if @scheduled_at.nil?
110
+ return false if @created_at.nil?
111
+ return false if @status.nil?
112
+ status_validator = EnumAttributeValidator.new('String', ['inProgress', 'queued', 'processed', 'error'])
113
+ return false unless status_validator.valid?(@status)
131
114
  true
132
115
  end
133
116
 
117
+ # Custom attribute writer method checking allowed values (enum).
118
+ # @param [Object] status Object to be assigned
119
+ def status=(status)
120
+ validator = EnumAttributeValidator.new('String', ['inProgress', 'queued', 'processed', 'error'])
121
+ unless validator.valid?(status)
122
+ fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.'
123
+ end
124
+ @status = status
125
+ end
126
+
134
127
  # Checks equality by comparing each attribute.
135
128
  # @param [Object] Object to be compared
136
129
  def ==(o)
137
130
  return true if self.equal?(o)
138
131
  self.class == o.class &&
139
- virtual_next_task == o.virtual_next_task &&
140
- email == o.email &&
141
- assign_to_id == o.assign_to_id &&
142
- contacts_id == o.contacts_id &&
143
- crm_lists == o.crm_lists &&
144
- attributes == o.attributes &&
132
+ scheduled_at == o.scheduled_at &&
145
133
  created_at == o.created_at &&
146
- updated_at == o.updated_at
134
+ status == o.status
147
135
  end
148
136
 
149
137
  # @see the `==` method
@@ -155,7 +143,7 @@ module SibApiV3Sdk
155
143
  # Calculates hash code according to all attributes.
156
144
  # @return [Fixnum] Hash code
157
145
  def hash
158
- [virtual_next_task, email, assign_to_id, contacts_id, crm_lists, attributes, created_at, updated_at].hash
146
+ [scheduled_at, created_at, status].hash
159
147
  end
160
148
 
161
149
  # Builds the object from hash