sib-api-v3-sdk 8.1.0 → 9.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +82 -14
  3. data/docs/Body.md +2 -11
  4. data/docs/Body1.md +2 -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/ConversationsApi.md +542 -0
  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/CreateSubAccount.md +3 -3
  28. data/docs/CreateSubAccountResponse.md +8 -0
  29. data/docs/Deal.md +11 -0
  30. data/docs/DealAttributes.md +7 -0
  31. data/docs/DealAttributesInner.md +12 -0
  32. data/docs/DealsApi.md +476 -0
  33. data/docs/DealsList.md +8 -0
  34. data/docs/EmailCampaignsApi.md +6 -5
  35. data/docs/FileData.md +3 -6
  36. data/docs/FileDownloadableLink.md +8 -0
  37. data/docs/FileList.md +7 -0
  38. data/docs/FilesApi.md +318 -0
  39. data/docs/GetCampaignStats.md +2 -0
  40. data/docs/GetScheduledEmailByBatchId.md +9 -0
  41. data/docs/GetScheduledEmailByBatchIdBatches.md +10 -0
  42. data/docs/GetScheduledEmailByMessageId.md +10 -0
  43. data/docs/GetSsoToken.md +1 -1
  44. data/docs/InboundParsingApi.md +60 -0
  45. data/docs/InlineResponse200.md +8 -0
  46. data/docs/InlineResponse201.md +8 -0
  47. data/docs/InlineResponse2011.md +8 -0
  48. data/docs/MasterAccountApi.md +6 -6
  49. data/docs/NoteId.md +8 -0
  50. data/docs/NoteList.md +7 -0
  51. data/docs/NotesApi.md +312 -0
  52. data/docs/Pipeline.md +8 -0
  53. data/docs/PipelineStage.md +9 -0
  54. data/docs/ScheduleSmtpEmail.md +10 -0
  55. data/docs/SendSmtpEmail.md +3 -1
  56. data/docs/SubAccountDetailsResponsePlanInfoCredits.md +1 -1
  57. data/docs/SubAccountsResponseSubAccounts.md +4 -4
  58. data/docs/Task.md +0 -11
  59. data/docs/TaskList.md +8 -0
  60. data/docs/TaskReminder.md +1 -1
  61. data/docs/TaskTypes.md +0 -1
  62. data/docs/TasksApi.md +376 -0
  63. data/docs/TransactionalEmailsApi.md +199 -0
  64. data/docs/UpdateContact.md +1 -1
  65. data/docs/UpdateEmailCampaign.md +1 -1
  66. data/docs/UpdateSmtpTemplate.md +1 -1
  67. data/docs/UploadImageModel.md +8 -0
  68. data/lib/sib-api-v3-sdk/api/companies_api.rb +409 -0
  69. data/lib/sib-api-v3-sdk/api/contacts_api.rb +6 -0
  70. data/lib/sib-api-v3-sdk/api/conversations_api.rb +504 -0
  71. data/lib/sib-api-v3-sdk/api/deals_api.rb +454 -0
  72. data/lib/sib-api-v3-sdk/api/email_campaigns_api.rb +9 -8
  73. data/lib/sib-api-v3-sdk/api/files_api.rb +313 -0
  74. data/lib/sib-api-v3-sdk/api/inbound_parsing_api.rb +53 -1
  75. data/lib/sib-api-v3-sdk/api/master_account_api.rb +9 -9
  76. data/lib/sib-api-v3-sdk/api/notes_api.rb +308 -0
  77. data/lib/sib-api-v3-sdk/api/tasks_api.rb +375 -0
  78. data/lib/sib-api-v3-sdk/api/transactional_emails_api.rb +195 -0
  79. data/lib/sib-api-v3-sdk/models/body.rb +9 -114
  80. data/lib/sib-api-v3-sdk/models/body_1.rb +9 -119
  81. data/lib/sib-api-v3-sdk/models/body_10.rb +225 -0
  82. data/lib/sib-api-v3-sdk/models/body_11.rb +190 -0
  83. data/lib/sib-api-v3-sdk/models/body_12.rb +215 -0
  84. data/lib/sib-api-v3-sdk/models/body_2.rb +223 -0
  85. data/lib/sib-api-v3-sdk/models/body_3.rb +200 -0
  86. data/lib/sib-api-v3-sdk/models/body_4.rb +195 -0
  87. data/lib/sib-api-v3-sdk/models/body_5.rb +223 -0
  88. data/lib/sib-api-v3-sdk/models/body_6.rb +320 -0
  89. data/lib/sib-api-v3-sdk/models/body_7.rb +281 -0
  90. data/lib/sib-api-v3-sdk/models/body_8.rb +245 -0
  91. data/lib/sib-api-v3-sdk/models/body_9.rb +190 -0
  92. data/lib/sib-api-v3-sdk/models/companies_list.rb +188 -0
  93. data/lib/sib-api-v3-sdk/models/company.rb +220 -0
  94. data/lib/sib-api-v3-sdk/models/company_attributes.rb +176 -0
  95. data/lib/sib-api-v3-sdk/models/company_attributes_inner.rb +223 -0
  96. data/lib/sib-api-v3-sdk/models/conversations_message.rb +324 -0
  97. data/lib/sib-api-v3-sdk/models/conversations_message_file.rb +239 -0
  98. data/lib/sib-api-v3-sdk/models/conversations_message_file_image_info.rb +236 -0
  99. data/lib/sib-api-v3-sdk/models/create_contact.rb +1 -1
  100. data/lib/sib-api-v3-sdk/models/create_sub_account.rb +3 -3
  101. data/lib/sib-api-v3-sdk/models/create_sub_account_response.rb +190 -0
  102. data/lib/sib-api-v3-sdk/models/deal.rb +220 -0
  103. data/lib/sib-api-v3-sdk/models/deal_attributes.rb +176 -0
  104. data/lib/sib-api-v3-sdk/models/deal_attributes_inner.rb +223 -0
  105. data/lib/sib-api-v3-sdk/models/deals_list.rb +188 -0
  106. data/lib/sib-api-v3-sdk/models/file_data.rb +22 -54
  107. data/lib/sib-api-v3-sdk/models/file_downloadable_link.rb +190 -0
  108. data/lib/sib-api-v3-sdk/models/file_list.rb +176 -0
  109. data/lib/sib-api-v3-sdk/models/get_campaign_stats.rb +21 -1
  110. data/lib/sib-api-v3-sdk/models/get_scheduled_email_by_batch_id.rb +196 -0
  111. data/lib/sib-api-v3-sdk/models/{contact.rb → get_scheduled_email_by_batch_id_batches.rb} +62 -74
  112. data/lib/sib-api-v3-sdk/models/get_scheduled_email_by_message_id.rb +254 -0
  113. data/lib/sib-api-v3-sdk/models/get_sso_token.rb +1 -1
  114. data/lib/sib-api-v3-sdk/models/inline_response_200.rb +191 -0
  115. data/lib/sib-api-v3-sdk/models/inline_response_201.rb +191 -0
  116. data/lib/sib-api-v3-sdk/models/inline_response_201_1.rb +191 -0
  117. data/lib/sib-api-v3-sdk/models/note_id.rb +186 -0
  118. data/lib/sib-api-v3-sdk/models/note_list.rb +176 -0
  119. data/lib/sib-api-v3-sdk/models/pipeline.rb +188 -0
  120. data/lib/sib-api-v3-sdk/models/pipeline_stage.rb +196 -0
  121. data/lib/sib-api-v3-sdk/models/schedule_smtp_email.rb +206 -0
  122. data/lib/sib-api-v3-sdk/models/send_smtp_email.rb +24 -4
  123. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info_credits.rb +2 -2
  124. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info_credits_emails.rb +1 -1
  125. data/lib/sib-api-v3-sdk/models/sub_account_details_response_plan_info_features.rb +1 -1
  126. data/lib/sib-api-v3-sdk/models/sub_accounts_response_sub_accounts.rb +4 -4
  127. data/lib/sib-api-v3-sdk/models/task.rb +4 -119
  128. data/lib/sib-api-v3-sdk/models/task_list.rb +188 -0
  129. data/lib/sib-api-v3-sdk/models/task_reminder.rb +1 -1
  130. data/lib/sib-api-v3-sdk/models/task_types.rb +1 -11
  131. data/lib/sib-api-v3-sdk/models/update_contact.rb +1 -1
  132. data/lib/sib-api-v3-sdk/models/update_email_campaign.rb +1 -1
  133. data/lib/sib-api-v3-sdk/models/update_smtp_template.rb +1 -1
  134. data/lib/sib-api-v3-sdk/models/upload_image_model.rb +190 -0
  135. data/lib/sib-api-v3-sdk/version.rb +1 -1
  136. data/lib/sib-api-v3-sdk.rb +44 -2
  137. data/spec/api/companies_api_spec.rb +119 -0
  138. data/spec/api/contacts_api_spec.rb +2 -0
  139. data/spec/api/conversations_api_spec.rb +140 -0
  140. data/spec/api/deals_api_spec.rb +129 -0
  141. data/spec/api/email_campaigns_api_spec.rb +1 -1
  142. data/spec/api/files_api_spec.rb +99 -0
  143. data/spec/api/inbound_parsing_api_spec.rb +12 -0
  144. data/spec/api/master_account_api_spec.rb +4 -4
  145. data/spec/api/notes_api_spec.rb +97 -0
  146. data/spec/api/{crm_api_spec.rb → tasks_api_spec.rb} +25 -92
  147. data/spec/api/transactional_emails_api_spec.rb +44 -0
  148. data/spec/models/body_10_spec.rb +59 -0
  149. data/spec/models/body_11_spec.rb +41 -0
  150. data/spec/models/body_12_spec.rb +59 -0
  151. data/spec/models/body_1_spec.rb +1 -55
  152. data/spec/models/body_2_spec.rb +59 -0
  153. data/spec/models/body_3_spec.rb +47 -0
  154. data/spec/models/body_4_spec.rb +47 -0
  155. data/spec/models/body_5_spec.rb +59 -0
  156. data/spec/models/body_6_spec.rb +101 -0
  157. data/spec/models/{contact_spec.rb → body_7_spec.rb} +26 -14
  158. data/spec/models/body_8_spec.rb +71 -0
  159. data/spec/models/body_9_spec.rb +41 -0
  160. data/spec/models/body_spec.rb +1 -55
  161. data/spec/models/companies_list_spec.rb +41 -0
  162. data/spec/models/company_attributes_inner_spec.rb +65 -0
  163. data/spec/models/company_attributes_spec.rb +35 -0
  164. data/spec/models/company_spec.rb +59 -0
  165. data/spec/models/conversations_message_file_image_info_spec.rb +53 -0
  166. data/spec/models/conversations_message_file_spec.rb +65 -0
  167. data/spec/models/conversations_message_spec.rb +99 -0
  168. data/spec/models/create_sub_account_response_spec.rb +41 -0
  169. data/spec/models/deal_attributes_inner_spec.rb +65 -0
  170. data/spec/models/deal_attributes_spec.rb +35 -0
  171. data/spec/models/deal_spec.rb +59 -0
  172. data/spec/models/deals_list_spec.rb +41 -0
  173. data/spec/models/file_data_spec.rb +3 -21
  174. data/spec/models/file_downloadable_link_spec.rb +41 -0
  175. data/spec/models/file_list_spec.rb +35 -0
  176. data/spec/models/get_campaign_stats_spec.rb +12 -0
  177. data/spec/models/get_scheduled_email_by_batch_id_batches_spec.rb +57 -0
  178. data/spec/models/get_scheduled_email_by_batch_id_spec.rb +47 -0
  179. data/spec/models/get_scheduled_email_by_message_id_spec.rb +57 -0
  180. data/spec/models/inline_response_200_spec.rb +41 -0
  181. data/spec/models/inline_response_201_1_spec.rb +41 -0
  182. data/spec/models/inline_response_201_spec.rb +41 -0
  183. data/spec/models/note_id_spec.rb +41 -0
  184. data/spec/models/note_list_spec.rb +35 -0
  185. data/spec/models/pipeline_spec.rb +41 -0
  186. data/spec/models/pipeline_stage_spec.rb +47 -0
  187. data/spec/models/schedule_smtp_email_spec.rb +53 -0
  188. data/spec/models/send_smtp_email_spec.rb +12 -0
  189. data/spec/models/task_list_spec.rb +41 -0
  190. data/spec/models/task_spec.rb +0 -66
  191. data/spec/models/task_types_spec.rb +0 -6
  192. data/spec/models/upload_image_model_spec.rb +41 -0
  193. metadata +179 -11
  194. data/docs/CRMApi.md +0 -762
  195. data/docs/Contact.md +0 -15
  196. data/lib/sib-api-v3-sdk/api/crm_api.rb +0 -716
@@ -0,0 +1,223 @@
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 Body5
17
+ # Contact ids for contacts to be linked with deal
18
+ attr_accessor :link_contact_ids
19
+
20
+ # Contact ids for contacts to be unlinked from deal
21
+ attr_accessor :unlink_contact_ids
22
+
23
+ # Company ids to be linked with deal
24
+ attr_accessor :link_company_ids
25
+
26
+ # Company ids to be unlinked from deal
27
+ attr_accessor :unlink_company_ids
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'link_contact_ids' => :'linkContactIds',
33
+ :'unlink_contact_ids' => :'unlinkContactIds',
34
+ :'link_company_ids' => :'linkCompanyIds',
35
+ :'unlink_company_ids' => :'unlinkCompanyIds'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'link_contact_ids' => :'Array<Integer>',
43
+ :'unlink_contact_ids' => :'Array<Integer>',
44
+ :'link_company_ids' => :'Array<String>',
45
+ :'unlink_company_ids' => :'Array<String>'
46
+ }
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ return unless attributes.is_a?(Hash)
53
+
54
+ # convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
56
+
57
+ if attributes.has_key?(:'linkContactIds')
58
+ if (value = attributes[:'linkContactIds']).is_a?(Array)
59
+ self.link_contact_ids = value
60
+ end
61
+ end
62
+
63
+ if attributes.has_key?(:'unlinkContactIds')
64
+ if (value = attributes[:'unlinkContactIds']).is_a?(Array)
65
+ self.unlink_contact_ids = value
66
+ end
67
+ end
68
+
69
+ if attributes.has_key?(:'linkCompanyIds')
70
+ if (value = attributes[:'linkCompanyIds']).is_a?(Array)
71
+ self.link_company_ids = value
72
+ end
73
+ end
74
+
75
+ if attributes.has_key?(:'unlinkCompanyIds')
76
+ if (value = attributes[:'unlinkCompanyIds']).is_a?(Array)
77
+ self.unlink_company_ids = value
78
+ end
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ invalid_properties = Array.new
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ link_contact_ids == o.link_contact_ids &&
101
+ unlink_contact_ids == o.unlink_contact_ids &&
102
+ link_company_ids == o.link_company_ids &&
103
+ unlink_company_ids == o.unlink_company_ids
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Fixnum] Hash code
114
+ def hash
115
+ [link_contact_ids, unlink_contact_ids, link_company_ids, unlink_company_ids].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.swagger_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :DateTime
145
+ DateTime.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :BOOLEAN
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ temp_model = SibApiV3Sdk.const_get(type).new
176
+ temp_model.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ next if value.nil?
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+
222
+ end
223
+ end
@@ -0,0 +1,320 @@
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 Body6
17
+ # Name of task
18
+ attr_accessor :name
19
+
20
+ # Duration of task in milliseconds [1 minute = 60000 ms]
21
+ attr_accessor :duration
22
+
23
+ # Id for type of task e.g Call / Email / Meeting etc.
24
+ attr_accessor :task_type_id
25
+
26
+ # Task due date and time
27
+ attr_accessor :date
28
+
29
+ # Notes added to a task
30
+ attr_accessor :notes
31
+
32
+ # Task marked as done
33
+ attr_accessor :done
34
+
35
+ # User id to whom task is assigned
36
+ attr_accessor :assign_to_id
37
+
38
+ # Contact ids for contacts linked to this task
39
+ attr_accessor :contacts_ids
40
+
41
+ # Deal ids for deals a task is linked to
42
+ attr_accessor :deals_ids
43
+
44
+ # Companies ids for companies a task is linked to
45
+ attr_accessor :companies_ids
46
+
47
+ attr_accessor :reminder
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'name' => :'name',
53
+ :'duration' => :'duration',
54
+ :'task_type_id' => :'taskTypeId',
55
+ :'date' => :'date',
56
+ :'notes' => :'notes',
57
+ :'done' => :'done',
58
+ :'assign_to_id' => :'assignToId',
59
+ :'contacts_ids' => :'contactsIds',
60
+ :'deals_ids' => :'dealsIds',
61
+ :'companies_ids' => :'companiesIds',
62
+ :'reminder' => :'reminder'
63
+ }
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.swagger_types
68
+ {
69
+ :'name' => :'String',
70
+ :'duration' => :'Integer',
71
+ :'task_type_id' => :'String',
72
+ :'date' => :'DateTime',
73
+ :'notes' => :'String',
74
+ :'done' => :'BOOLEAN',
75
+ :'assign_to_id' => :'String',
76
+ :'contacts_ids' => :'Array<Integer>',
77
+ :'deals_ids' => :'Array<String>',
78
+ :'companies_ids' => :'Array<String>',
79
+ :'reminder' => :'TaskReminder'
80
+ }
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ return unless attributes.is_a?(Hash)
87
+
88
+ # convert string to symbol for hash key
89
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
90
+
91
+ if attributes.has_key?(:'name')
92
+ self.name = attributes[:'name']
93
+ end
94
+
95
+ if attributes.has_key?(:'duration')
96
+ self.duration = attributes[:'duration']
97
+ end
98
+
99
+ if attributes.has_key?(:'taskTypeId')
100
+ self.task_type_id = attributes[:'taskTypeId']
101
+ end
102
+
103
+ if attributes.has_key?(:'date')
104
+ self.date = attributes[:'date']
105
+ end
106
+
107
+ if attributes.has_key?(:'notes')
108
+ self.notes = attributes[:'notes']
109
+ end
110
+
111
+ if attributes.has_key?(:'done')
112
+ self.done = attributes[:'done']
113
+ end
114
+
115
+ if attributes.has_key?(:'assignToId')
116
+ self.assign_to_id = attributes[:'assignToId']
117
+ end
118
+
119
+ if attributes.has_key?(:'contactsIds')
120
+ if (value = attributes[:'contactsIds']).is_a?(Array)
121
+ self.contacts_ids = value
122
+ end
123
+ end
124
+
125
+ if attributes.has_key?(:'dealsIds')
126
+ if (value = attributes[:'dealsIds']).is_a?(Array)
127
+ self.deals_ids = value
128
+ end
129
+ end
130
+
131
+ if attributes.has_key?(:'companiesIds')
132
+ if (value = attributes[:'companiesIds']).is_a?(Array)
133
+ self.companies_ids = value
134
+ end
135
+ end
136
+
137
+ if attributes.has_key?(:'reminder')
138
+ self.reminder = attributes[:'reminder']
139
+ end
140
+ end
141
+
142
+ # Show invalid properties with the reasons. Usually used together with valid?
143
+ # @return Array for valid properties with the reasons
144
+ def list_invalid_properties
145
+ invalid_properties = Array.new
146
+ if @name.nil?
147
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
148
+ end
149
+
150
+ if !@duration.nil? && @duration < 0
151
+ invalid_properties.push('invalid value for "duration", must be greater than or equal to 0.')
152
+ end
153
+
154
+ if @task_type_id.nil?
155
+ invalid_properties.push('invalid value for "task_type_id", task_type_id cannot be nil.')
156
+ end
157
+
158
+ if @date.nil?
159
+ invalid_properties.push('invalid value for "date", date cannot be nil.')
160
+ end
161
+
162
+ invalid_properties
163
+ end
164
+
165
+ # Check to see if the all the properties in the model are valid
166
+ # @return true if the model is valid
167
+ def valid?
168
+ return false if @name.nil?
169
+ return false if !@duration.nil? && @duration < 0
170
+ return false if @task_type_id.nil?
171
+ return false if @date.nil?
172
+ true
173
+ end
174
+
175
+ # Custom attribute writer method with validation
176
+ # @param [Object] duration Value to be assigned
177
+ def duration=(duration)
178
+ if !duration.nil? && duration < 0
179
+ fail ArgumentError, 'invalid value for "duration", must be greater than or equal to 0.'
180
+ end
181
+
182
+ @duration = duration
183
+ end
184
+
185
+ # Checks equality by comparing each attribute.
186
+ # @param [Object] Object to be compared
187
+ def ==(o)
188
+ return true if self.equal?(o)
189
+ self.class == o.class &&
190
+ name == o.name &&
191
+ duration == o.duration &&
192
+ task_type_id == o.task_type_id &&
193
+ date == o.date &&
194
+ notes == o.notes &&
195
+ done == o.done &&
196
+ assign_to_id == o.assign_to_id &&
197
+ contacts_ids == o.contacts_ids &&
198
+ deals_ids == o.deals_ids &&
199
+ companies_ids == o.companies_ids &&
200
+ reminder == o.reminder
201
+ end
202
+
203
+ # @see the `==` method
204
+ # @param [Object] Object to be compared
205
+ def eql?(o)
206
+ self == o
207
+ end
208
+
209
+ # Calculates hash code according to all attributes.
210
+ # @return [Fixnum] Hash code
211
+ def hash
212
+ [name, duration, task_type_id, date, notes, done, assign_to_id, contacts_ids, deals_ids, companies_ids, reminder].hash
213
+ end
214
+
215
+ # Builds the object from hash
216
+ # @param [Hash] attributes Model attributes in the form of hash
217
+ # @return [Object] Returns the model itself
218
+ def build_from_hash(attributes)
219
+ return nil unless attributes.is_a?(Hash)
220
+ self.class.swagger_types.each_pair do |key, type|
221
+ if type =~ /\AArray<(.*)>/i
222
+ # check to ensure the input is an array given that the attribute
223
+ # is documented as an array but the input is not
224
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
225
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
226
+ end
227
+ elsif !attributes[self.class.attribute_map[key]].nil?
228
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
229
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
230
+ end
231
+
232
+ self
233
+ end
234
+
235
+ # Deserializes the data based on type
236
+ # @param string type Data type
237
+ # @param string value Value to be deserialized
238
+ # @return [Object] Deserialized data
239
+ def _deserialize(type, value)
240
+ case type.to_sym
241
+ when :DateTime
242
+ DateTime.parse(value)
243
+ when :Date
244
+ Date.parse(value)
245
+ when :String
246
+ value.to_s
247
+ when :Integer
248
+ value.to_i
249
+ when :Float
250
+ value.to_f
251
+ when :BOOLEAN
252
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
253
+ true
254
+ else
255
+ false
256
+ end
257
+ when :Object
258
+ # generic object (usually a Hash), return directly
259
+ value
260
+ when /\AArray<(?<inner_type>.+)>\z/
261
+ inner_type = Regexp.last_match[:inner_type]
262
+ value.map { |v| _deserialize(inner_type, v) }
263
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
264
+ k_type = Regexp.last_match[:k_type]
265
+ v_type = Regexp.last_match[:v_type]
266
+ {}.tap do |hash|
267
+ value.each do |k, v|
268
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
269
+ end
270
+ end
271
+ else # model
272
+ temp_model = SibApiV3Sdk.const_get(type).new
273
+ temp_model.build_from_hash(value)
274
+ end
275
+ end
276
+
277
+ # Returns the string representation of the object
278
+ # @return [String] String presentation of the object
279
+ def to_s
280
+ to_hash.to_s
281
+ end
282
+
283
+ # to_body is an alias to to_hash (backward compatibility)
284
+ # @return [Hash] Returns the object in the form of hash
285
+ def to_body
286
+ to_hash
287
+ end
288
+
289
+ # Returns the object in the form of hash
290
+ # @return [Hash] Returns the object in the form of hash
291
+ def to_hash
292
+ hash = {}
293
+ self.class.attribute_map.each_pair do |attr, param|
294
+ value = self.send(attr)
295
+ next if value.nil?
296
+ hash[param] = _to_hash(value)
297
+ end
298
+ hash
299
+ end
300
+
301
+ # Outputs non-array value in the form of hash
302
+ # For object, use to_hash. Otherwise, just return the value
303
+ # @param [Object] value Any valid value
304
+ # @return [Hash] Returns the value in the form of hash
305
+ def _to_hash(value)
306
+ if value.is_a?(Array)
307
+ value.compact.map { |v| _to_hash(v) }
308
+ elsif value.is_a?(Hash)
309
+ {}.tap do |hash|
310
+ value.each { |k, v| hash[k] = _to_hash(v) }
311
+ end
312
+ elsif value.respond_to? :to_hash
313
+ value.to_hash
314
+ else
315
+ value
316
+ end
317
+ end
318
+
319
+ end
320
+ end