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
@@ -13,21 +13,20 @@ Swagger Codegen version: 2.4.19
13
13
  require 'date'
14
14
 
15
15
  module SibApiV3Sdk
16
- class SendTemplateEmail
17
- # Message ID of the template Email sent
18
- attr_accessor :message_id
16
+ class GetInboundEmailEvents
17
+ attr_accessor :events
19
18
 
20
19
  # Attribute mapping from ruby-style variable name to JSON key.
21
20
  def self.attribute_map
22
21
  {
23
- :'message_id' => :'messageId'
22
+ :'events' => :'events'
24
23
  }
25
24
  end
26
25
 
27
26
  # Attribute type mapping.
28
27
  def self.swagger_types
29
28
  {
30
- :'message_id' => :'String'
29
+ :'events' => :'Array<GetInboundEmailEventsEvents>'
31
30
  }
32
31
  end
33
32
 
@@ -39,8 +38,10 @@ module SibApiV3Sdk
39
38
  # convert string to symbol for hash key
40
39
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
41
40
 
42
- if attributes.has_key?(:'messageId')
43
- self.message_id = attributes[:'messageId']
41
+ if attributes.has_key?(:'events')
42
+ if (value = attributes[:'events']).is_a?(Array)
43
+ self.events = value
44
+ end
44
45
  end
45
46
  end
46
47
 
@@ -48,17 +49,12 @@ module SibApiV3Sdk
48
49
  # @return Array for valid properties with the reasons
49
50
  def list_invalid_properties
50
51
  invalid_properties = Array.new
51
- if @message_id.nil?
52
- invalid_properties.push('invalid value for "message_id", message_id cannot be nil.')
53
- end
54
-
55
52
  invalid_properties
56
53
  end
57
54
 
58
55
  # Check to see if the all the properties in the model are valid
59
56
  # @return true if the model is valid
60
57
  def valid?
61
- return false if @message_id.nil?
62
58
  true
63
59
  end
64
60
 
@@ -67,7 +63,7 @@ module SibApiV3Sdk
67
63
  def ==(o)
68
64
  return true if self.equal?(o)
69
65
  self.class == o.class &&
70
- message_id == o.message_id
66
+ events == o.events
71
67
  end
72
68
 
73
69
  # @see the `==` method
@@ -79,7 +75,7 @@ module SibApiV3Sdk
79
75
  # Calculates hash code according to all attributes.
80
76
  # @return [Fixnum] Hash code
81
77
  def hash
82
- [message_id].hash
78
+ [events].hash
83
79
  end
84
80
 
85
81
  # Builds the object from hash
@@ -0,0 +1,259 @@
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 GetInboundEmailEventsByUuid
17
+ # Date when email was received on SMTP relay
18
+ attr_accessor :received_at
19
+
20
+ # Date when email was delivered successfully to client’s webhook
21
+ attr_accessor :delivered_at
22
+
23
+ # Recipient’s email address
24
+ attr_accessor :recipient
25
+
26
+ # Sender’s email address
27
+ attr_accessor :sender
28
+
29
+ # Value of the Message-ID header. This will be present only after the processing is done.
30
+ attr_accessor :message_id
31
+
32
+ # Value of the Subject header. This will be present only after the processing is done.
33
+ attr_accessor :subject
34
+
35
+ # List of attachments of the email. This will be present only after the processing is done.
36
+ attr_accessor :attachments
37
+
38
+ # List of events/logs that describe the lifecycle of the email on SIB platform
39
+ attr_accessor :logs
40
+
41
+ # Attribute mapping from ruby-style variable name to JSON key.
42
+ def self.attribute_map
43
+ {
44
+ :'received_at' => :'receivedAt',
45
+ :'delivered_at' => :'deliveredAt',
46
+ :'recipient' => :'recipient',
47
+ :'sender' => :'sender',
48
+ :'message_id' => :'messageId',
49
+ :'subject' => :'subject',
50
+ :'attachments' => :'attachments',
51
+ :'logs' => :'logs'
52
+ }
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.swagger_types
57
+ {
58
+ :'received_at' => :'DateTime',
59
+ :'delivered_at' => :'DateTime',
60
+ :'recipient' => :'String',
61
+ :'sender' => :'String',
62
+ :'message_id' => :'String',
63
+ :'subject' => :'String',
64
+ :'attachments' => :'Array<GetInboundEmailEventsByUuidAttachments>',
65
+ :'logs' => :'Array<GetInboundEmailEventsByUuidLogs>'
66
+ }
67
+ end
68
+
69
+ # Initializes the object
70
+ # @param [Hash] attributes Model attributes in the form of hash
71
+ def initialize(attributes = {})
72
+ return unless attributes.is_a?(Hash)
73
+
74
+ # convert string to symbol for hash key
75
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
76
+
77
+ if attributes.has_key?(:'receivedAt')
78
+ self.received_at = attributes[:'receivedAt']
79
+ end
80
+
81
+ if attributes.has_key?(:'deliveredAt')
82
+ self.delivered_at = attributes[:'deliveredAt']
83
+ end
84
+
85
+ if attributes.has_key?(:'recipient')
86
+ self.recipient = attributes[:'recipient']
87
+ end
88
+
89
+ if attributes.has_key?(:'sender')
90
+ self.sender = attributes[:'sender']
91
+ end
92
+
93
+ if attributes.has_key?(:'messageId')
94
+ self.message_id = attributes[:'messageId']
95
+ end
96
+
97
+ if attributes.has_key?(:'subject')
98
+ self.subject = attributes[:'subject']
99
+ end
100
+
101
+ if attributes.has_key?(:'attachments')
102
+ if (value = attributes[:'attachments']).is_a?(Array)
103
+ self.attachments = value
104
+ end
105
+ end
106
+
107
+ if attributes.has_key?(:'logs')
108
+ if (value = attributes[:'logs']).is_a?(Array)
109
+ self.logs = value
110
+ end
111
+ end
112
+ end
113
+
114
+ # Show invalid properties with the reasons. Usually used together with valid?
115
+ # @return Array for valid properties with the reasons
116
+ def list_invalid_properties
117
+ invalid_properties = Array.new
118
+ invalid_properties
119
+ end
120
+
121
+ # Check to see if the all the properties in the model are valid
122
+ # @return true if the model is valid
123
+ def valid?
124
+ true
125
+ end
126
+
127
+ # Checks equality by comparing each attribute.
128
+ # @param [Object] Object to be compared
129
+ def ==(o)
130
+ return true if self.equal?(o)
131
+ self.class == o.class &&
132
+ received_at == o.received_at &&
133
+ delivered_at == o.delivered_at &&
134
+ recipient == o.recipient &&
135
+ sender == o.sender &&
136
+ message_id == o.message_id &&
137
+ subject == o.subject &&
138
+ attachments == o.attachments &&
139
+ logs == o.logs
140
+ end
141
+
142
+ # @see the `==` method
143
+ # @param [Object] Object to be compared
144
+ def eql?(o)
145
+ self == o
146
+ end
147
+
148
+ # Calculates hash code according to all attributes.
149
+ # @return [Fixnum] Hash code
150
+ def hash
151
+ [received_at, delivered_at, recipient, sender, message_id, subject, attachments, logs].hash
152
+ end
153
+
154
+ # Builds the object from hash
155
+ # @param [Hash] attributes Model attributes in the form of hash
156
+ # @return [Object] Returns the model itself
157
+ def build_from_hash(attributes)
158
+ return nil unless attributes.is_a?(Hash)
159
+ self.class.swagger_types.each_pair do |key, type|
160
+ if type =~ /\AArray<(.*)>/i
161
+ # check to ensure the input is an array given that the attribute
162
+ # is documented as an array but the input is not
163
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
164
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
165
+ end
166
+ elsif !attributes[self.class.attribute_map[key]].nil?
167
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
168
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
169
+ end
170
+
171
+ self
172
+ end
173
+
174
+ # Deserializes the data based on type
175
+ # @param string type Data type
176
+ # @param string value Value to be deserialized
177
+ # @return [Object] Deserialized data
178
+ def _deserialize(type, value)
179
+ case type.to_sym
180
+ when :DateTime
181
+ DateTime.parse(value)
182
+ when :Date
183
+ Date.parse(value)
184
+ when :String
185
+ value.to_s
186
+ when :Integer
187
+ value.to_i
188
+ when :Float
189
+ value.to_f
190
+ when :BOOLEAN
191
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
192
+ true
193
+ else
194
+ false
195
+ end
196
+ when :Object
197
+ # generic object (usually a Hash), return directly
198
+ value
199
+ when /\AArray<(?<inner_type>.+)>\z/
200
+ inner_type = Regexp.last_match[:inner_type]
201
+ value.map { |v| _deserialize(inner_type, v) }
202
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
203
+ k_type = Regexp.last_match[:k_type]
204
+ v_type = Regexp.last_match[:v_type]
205
+ {}.tap do |hash|
206
+ value.each do |k, v|
207
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
208
+ end
209
+ end
210
+ else # model
211
+ temp_model = SibApiV3Sdk.const_get(type).new
212
+ temp_model.build_from_hash(value)
213
+ end
214
+ end
215
+
216
+ # Returns the string representation of the object
217
+ # @return [String] String presentation of the object
218
+ def to_s
219
+ to_hash.to_s
220
+ end
221
+
222
+ # to_body is an alias to to_hash (backward compatibility)
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_body
225
+ to_hash
226
+ end
227
+
228
+ # Returns the object in the form of hash
229
+ # @return [Hash] Returns the object in the form of hash
230
+ def to_hash
231
+ hash = {}
232
+ self.class.attribute_map.each_pair do |attr, param|
233
+ value = self.send(attr)
234
+ next if value.nil?
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ # Outputs non-array value in the form of hash
241
+ # For object, use to_hash. Otherwise, just return the value
242
+ # @param [Object] value Any valid value
243
+ # @return [Hash] Returns the value in the form of hash
244
+ def _to_hash(value)
245
+ if value.is_a?(Array)
246
+ value.compact.map { |v| _to_hash(v) }
247
+ elsif value.is_a?(Hash)
248
+ {}.tap do |hash|
249
+ value.each { |k, v| hash[k] = _to_hash(v) }
250
+ end
251
+ elsif value.respond_to? :to_hash
252
+ value.to_hash
253
+ else
254
+ value
255
+ end
256
+ end
257
+
258
+ end
259
+ end
@@ -0,0 +1,215 @@
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 GetInboundEmailEventsByUuidAttachments
17
+ # filename specified in the Content-Disposition header of the attachment
18
+ attr_accessor :name
19
+
20
+ # value of the Content-Type header of the attachment
21
+ attr_accessor :content_type
22
+
23
+ # value of the Content-ID header of the attachment.
24
+ attr_accessor :content_id
25
+
26
+ # size of the attachment in bytes
27
+ attr_accessor :content_length
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'name' => :'name',
33
+ :'content_type' => :'contentType',
34
+ :'content_id' => :'contentId',
35
+ :'content_length' => :'contentLength'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'name' => :'String',
43
+ :'content_type' => :'String',
44
+ :'content_id' => :'String',
45
+ :'content_length' => :'Integer'
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?(:'name')
58
+ self.name = attributes[:'name']
59
+ end
60
+
61
+ if attributes.has_key?(:'contentType')
62
+ self.content_type = attributes[:'contentType']
63
+ end
64
+
65
+ if attributes.has_key?(:'contentId')
66
+ self.content_id = attributes[:'contentId']
67
+ end
68
+
69
+ if attributes.has_key?(:'contentLength')
70
+ self.content_length = attributes[:'contentLength']
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ name == o.name &&
93
+ content_type == o.content_type &&
94
+ content_id == o.content_id &&
95
+ content_length == o.content_length
96
+ end
97
+
98
+ # @see the `==` method
99
+ # @param [Object] Object to be compared
100
+ def eql?(o)
101
+ self == o
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Fixnum] Hash code
106
+ def hash
107
+ [name, content_type, content_id, content_length].hash
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def build_from_hash(attributes)
114
+ return nil unless attributes.is_a?(Hash)
115
+ self.class.swagger_types.each_pair do |key, type|
116
+ if type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
121
+ end
122
+ elsif !attributes[self.class.attribute_map[key]].nil?
123
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
125
+ end
126
+
127
+ self
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :DateTime
137
+ DateTime.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :BOOLEAN
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ temp_model = SibApiV3Sdk.const_get(type).new
168
+ temp_model.build_from_hash(value)
169
+ end
170
+ end
171
+
172
+ # Returns the string representation of the object
173
+ # @return [String] String presentation of the object
174
+ def to_s
175
+ to_hash.to_s
176
+ end
177
+
178
+ # to_body is an alias to to_hash (backward compatibility)
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_body
181
+ to_hash
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ next if value.nil?
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map { |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end
213
+
214
+ end
215
+ end