sib-api-v3-sdk 5.3.0 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +66 -62
  3. data/docs/AccountApi.md +3 -3
  4. data/docs/AddContactToList.md +1 -1
  5. data/docs/AttributesApi.md +12 -12
  6. data/docs/ContactsApi.md +110 -47
  7. data/docs/CreateAttribute.md +1 -1
  8. data/docs/CreateContact.md +2 -2
  9. data/docs/CreateDoiContact.md +13 -0
  10. data/docs/CreateEmailCampaign.md +1 -1
  11. data/docs/EmailCampaignsApi.md +78 -21
  12. data/docs/FoldersApi.md +12 -12
  13. data/docs/GetEmailCampaign.md +1 -0
  14. data/docs/GetExtendedCampaignOverview.md +1 -0
  15. data/docs/GetTransacBlockedContactsContacts.md +1 -1
  16. data/docs/GetTransacEmailsListTransactionalEmails.md +2 -0
  17. data/docs/ListsApi.md +12 -12
  18. data/docs/RemainingCreditModelChild.md +2 -2
  19. data/docs/RemainingCreditModelReseller.md +2 -2
  20. data/docs/RemoveContactFromList.md +1 -1
  21. data/docs/RequestContactExport.md +1 -1
  22. data/docs/RequestContactImport.md +1 -1
  23. data/docs/ResellerApi.md +30 -30
  24. data/docs/SMSCampaignsApi.md +21 -21
  25. data/docs/SMTPApi.md +17 -17
  26. data/docs/SendEmail.md +3 -3
  27. data/docs/SendSmtpEmail.md +3 -3
  28. data/docs/SendersApi.md +6 -6
  29. data/docs/TransactionalSMSApi.md +6 -6
  30. data/docs/UpdateAttribute.md +1 -1
  31. data/docs/UpdateContact.md +1 -1
  32. data/docs/UpdateEmailCampaign.md +1 -1
  33. data/docs/UploadImageToGallery.md +9 -0
  34. data/lib/sib-api-v3-sdk.rb +2 -0
  35. data/lib/sib-api-v3-sdk/api/account_api.rb +2 -2
  36. data/lib/sib-api-v3-sdk/api/attributes_api.rb +8 -8
  37. data/lib/sib-api-v3-sdk/api/contacts_api.rb +87 -30
  38. data/lib/sib-api-v3-sdk/api/email_campaigns_api.rb +65 -14
  39. data/lib/sib-api-v3-sdk/api/folders_api.rb +8 -8
  40. data/lib/sib-api-v3-sdk/api/lists_api.rb +8 -8
  41. data/lib/sib-api-v3-sdk/api/reseller_api.rb +20 -20
  42. data/lib/sib-api-v3-sdk/api/senders_api.rb +4 -4
  43. data/lib/sib-api-v3-sdk/api/sms_campaigns_api.rb +14 -14
  44. data/lib/sib-api-v3-sdk/api/smtp_api.rb +12 -12
  45. data/lib/sib-api-v3-sdk/api/transactional_sms_api.rb +4 -4
  46. data/lib/sib-api-v3-sdk/models/add_contact_to_list.rb +1 -1
  47. data/lib/sib-api-v3-sdk/models/create_attribute.rb +1 -1
  48. data/lib/sib-api-v3-sdk/models/create_contact.rb +2 -2
  49. data/lib/sib-api-v3-sdk/models/create_doi_contact.rb +253 -0
  50. data/lib/sib-api-v3-sdk/models/create_email_campaign.rb +1 -1
  51. data/lib/sib-api-v3-sdk/models/get_email_campaign.rb +11 -1
  52. data/lib/sib-api-v3-sdk/models/get_extended_campaign_overview.rb +14 -4
  53. data/lib/sib-api-v3-sdk/models/get_transac_blocked_contacts_contacts.rb +1 -1
  54. data/lib/sib-api-v3-sdk/models/get_transac_emails_list_transactional_emails.rb +26 -4
  55. data/lib/sib-api-v3-sdk/models/remaining_credit_model_child.rb +2 -2
  56. data/lib/sib-api-v3-sdk/models/remaining_credit_model_reseller.rb +2 -2
  57. data/lib/sib-api-v3-sdk/models/remove_contact_from_list.rb +1 -1
  58. data/lib/sib-api-v3-sdk/models/request_contact_export.rb +1 -1
  59. data/lib/sib-api-v3-sdk/models/request_contact_import.rb +1 -1
  60. data/lib/sib-api-v3-sdk/models/send_email.rb +3 -3
  61. data/lib/sib-api-v3-sdk/models/send_smtp_email.rb +3 -3
  62. data/lib/sib-api-v3-sdk/models/send_smtp_email_reply_to.rb +1 -1
  63. data/lib/sib-api-v3-sdk/models/send_smtp_email_sender.rb +1 -1
  64. data/lib/sib-api-v3-sdk/models/update_attribute.rb +1 -1
  65. data/lib/sib-api-v3-sdk/models/update_contact.rb +1 -1
  66. data/lib/sib-api-v3-sdk/models/update_email_campaign.rb +1 -1
  67. data/lib/sib-api-v3-sdk/models/upload_image_to_gallery.rb +199 -0
  68. data/lib/sib-api-v3-sdk/version.rb +1 -1
  69. data/sib-api-v3-sdk.gemspec +5 -5
  70. data/spec/api/account_api_spec.rb +1 -1
  71. data/spec/api/attributes_api_spec.rb +4 -4
  72. data/spec/api/contacts_api_spec.rb +28 -15
  73. data/spec/api/email_campaigns_api_spec.rb +18 -7
  74. data/spec/api/folders_api_spec.rb +4 -4
  75. data/spec/api/lists_api_spec.rb +4 -4
  76. data/spec/api/reseller_api_spec.rb +10 -10
  77. data/spec/api/senders_api_spec.rb +2 -2
  78. data/spec/api/sms_campaigns_api_spec.rb +7 -7
  79. data/spec/api/smtp_api_spec.rb +6 -6
  80. data/spec/api/transactional_sms_api_spec.rb +2 -2
  81. data/spec/models/create_doi_contact_spec.rb +71 -0
  82. data/spec/models/get_email_campaign_spec.rb +6 -0
  83. data/spec/models/get_extended_campaign_overview_spec.rb +6 -0
  84. data/spec/models/get_transac_emails_list_transactional_emails_spec.rb +12 -0
  85. data/spec/models/upload_image_to_gallery_spec.rb +47 -0
  86. metadata +10 -2
@@ -118,7 +118,7 @@ module SibApiV3Sdk
118
118
  end
119
119
  return data, status_code, headers
120
120
  end
121
- # Return all the dedicated IPs for your account
121
+ # Get all the dedicated IPs for your account
122
122
  # @param [Hash] opts the optional parameters
123
123
  # @return [GetIps]
124
124
  def get_ips(opts = {})
@@ -126,7 +126,7 @@ module SibApiV3Sdk
126
126
  data
127
127
  end
128
128
 
129
- # Return all the dedicated IPs for your account
129
+ # Get all the dedicated IPs for your account
130
130
  # @param [Hash] opts the optional parameters
131
131
  # @return [Array<(GetIps, Fixnum, Hash)>] GetIps data, response status code and response headers
132
132
  def get_ips_with_http_info(opts = {})
@@ -164,7 +164,7 @@ module SibApiV3Sdk
164
164
  end
165
165
  return data, status_code, headers
166
166
  end
167
- # Return all the dedicated IPs for a sender
167
+ # Get all the dedicated IPs for a sender
168
168
  # @param sender_id Id of the sender
169
169
  # @param [Hash] opts the optional parameters
170
170
  # @return [GetIpsFromSender]
@@ -173,7 +173,7 @@ module SibApiV3Sdk
173
173
  data
174
174
  end
175
175
 
176
- # Return all the dedicated IPs for a sender
176
+ # Get all the dedicated IPs for a sender
177
177
  # @param sender_id Id of the sender
178
178
  # @param [Hash] opts the optional parameters
179
179
  # @return [Array<(GetIpsFromSender, Fixnum, Hash)>] GetIpsFromSender data, response status code and response headers
@@ -71,7 +71,7 @@ module SibApiV3Sdk
71
71
  end
72
72
  return data, status_code, headers
73
73
  end
74
- # Delete the SMS campaign
74
+ # Delete an SMS campaign
75
75
  # @param campaign_id id of the SMS campaign
76
76
  # @param [Hash] opts the optional parameters
77
77
  # @return [nil]
@@ -80,7 +80,7 @@ module SibApiV3Sdk
80
80
  nil
81
81
  end
82
82
 
83
- # Delete the SMS campaign
83
+ # Delete an SMS campaign
84
84
  # @param campaign_id id of the SMS campaign
85
85
  # @param [Hash] opts the optional parameters
86
86
  # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
@@ -174,7 +174,7 @@ module SibApiV3Sdk
174
174
  end
175
175
  return data, status_code, headers
176
176
  end
177
- # Returns the informations for all your created SMS campaigns
177
+ # Returns the information for all your created SMS campaigns
178
178
  # @param [Hash] opts the optional parameters
179
179
  # @option opts [String] :status Status of campaign.
180
180
  # @option opts [DateTime] :start_date Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either &#39;status&#39; not passed and if passed is set to &#39;sent&#39; )
@@ -187,7 +187,7 @@ module SibApiV3Sdk
187
187
  data
188
188
  end
189
189
 
190
- # Returns the informations for all your created SMS campaigns
190
+ # Returns the information for all your created SMS campaigns
191
191
  # @param [Hash] opts the optional parameters
192
192
  # @option opts [String] :status Status of campaign.
193
193
  # @option opts [DateTime] :start_date Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent sms campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either &#39;status&#39; not passed and if passed is set to &#39;sent&#39; )
@@ -242,7 +242,7 @@ module SibApiV3Sdk
242
242
  end
243
243
  return data, status_code, headers
244
244
  end
245
- # Exports the recipients of the specified campaign.
245
+ # Export an SMS campaign's recipients
246
246
  # It returns the background process ID which on completion calls the notify URL that you have set in the input.
247
247
  # @param campaign_id id of the campaign
248
248
  # @param [Hash] opts the optional parameters
@@ -253,7 +253,7 @@ module SibApiV3Sdk
253
253
  data
254
254
  end
255
255
 
256
- # Exports the recipients of the specified campaign.
256
+ # Export an SMS campaign&#39;s recipients
257
257
  # It returns the background process ID which on completion calls the notify URL that you have set in the input.
258
258
  # @param campaign_id id of the campaign
259
259
  # @param [Hash] opts the optional parameters
@@ -349,7 +349,7 @@ module SibApiV3Sdk
349
349
  end
350
350
  return data, status_code, headers
351
351
  end
352
- # Send report of SMS campaigns
352
+ # Send an SMS campaign's report
353
353
  # Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail.
354
354
  # @param campaign_id id of the campaign
355
355
  # @param send_report Values for send a report
@@ -360,7 +360,7 @@ module SibApiV3Sdk
360
360
  nil
361
361
  end
362
362
 
363
- # Send report of SMS campaigns
363
+ # Send an SMS campaign&#39;s report
364
364
  # Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail.
365
365
  # @param campaign_id id of the campaign
366
366
  # @param send_report Values for send a report
@@ -408,7 +408,7 @@ module SibApiV3Sdk
408
408
  end
409
409
  return data, status_code, headers
410
410
  end
411
- # Send an SMS
411
+ # Send a test SMS campaign
412
412
  # @param campaign_id Id of the SMS campaign
413
413
  # @param phone_number Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted
414
414
  # @param [Hash] opts the optional parameters
@@ -418,7 +418,7 @@ module SibApiV3Sdk
418
418
  nil
419
419
  end
420
420
 
421
- # Send an SMS
421
+ # Send a test SMS campaign
422
422
  # @param campaign_id Id of the SMS campaign
423
423
  # @param phone_number Mobile number of the recipient with the country code. This number must belong to one of your contacts in SendinBlue account and must not be blacklisted
424
424
  # @param [Hash] opts the optional parameters
@@ -465,7 +465,7 @@ module SibApiV3Sdk
465
465
  end
466
466
  return data, status_code, headers
467
467
  end
468
- # Updates an SMS campaign
468
+ # Update an SMS campaign
469
469
  # @param campaign_id id of the SMS campaign
470
470
  # @param update_sms_campaign Values to update an SMS Campaign
471
471
  # @param [Hash] opts the optional parameters
@@ -475,7 +475,7 @@ module SibApiV3Sdk
475
475
  nil
476
476
  end
477
477
 
478
- # Updates an SMS campaign
478
+ # Update an SMS campaign
479
479
  # @param campaign_id id of the SMS campaign
480
480
  # @param update_sms_campaign Values to update an SMS Campaign
481
481
  # @param [Hash] opts the optional parameters
@@ -522,7 +522,7 @@ module SibApiV3Sdk
522
522
  end
523
523
  return data, status_code, headers
524
524
  end
525
- # Update the campaign status
525
+ # Update a campaign's status
526
526
  # @param campaign_id id of the campaign
527
527
  # @param status Status of the campaign.
528
528
  # @param [Hash] opts the optional parameters
@@ -532,7 +532,7 @@ module SibApiV3Sdk
532
532
  nil
533
533
  end
534
534
 
535
- # Update the campaign status
535
+ # Update a campaign&#39;s status
536
536
  # @param campaign_id id of the campaign
537
537
  # @param status Status of the campaign.
538
538
  # @param [Hash] opts the optional parameters
@@ -19,7 +19,7 @@ module SibApiV3Sdk
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Create a transactional email template
22
+ # Create an email template
23
23
  # @param smtp_template values to update in transactional email template
24
24
  # @param [Hash] opts the optional parameters
25
25
  # @return [CreateModel]
@@ -28,7 +28,7 @@ module SibApiV3Sdk
28
28
  data
29
29
  end
30
30
 
31
- # Create a transactional email template
31
+ # Create an email template
32
32
  # @param smtp_template values to update in transactional email template
33
33
  # @param [Hash] opts the optional parameters
34
34
  # @return [Array<(CreateModel, Fixnum, Hash)>] CreateModel data, response status code and response headers
@@ -120,7 +120,7 @@ module SibApiV3Sdk
120
120
  end
121
121
  return data, status_code, headers
122
122
  end
123
- # Delete an inactive transactional email template
123
+ # Delete an inactive email template
124
124
  # @param template_id id of the template
125
125
  # @param [Hash] opts the optional parameters
126
126
  # @return [nil]
@@ -129,7 +129,7 @@ module SibApiV3Sdk
129
129
  nil
130
130
  end
131
131
 
132
- # Delete an inactive transactional email template
132
+ # Delete an inactive email template
133
133
  # @param template_id id of the template
134
134
  # @param [Hash] opts the optional parameters
135
135
  # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
@@ -380,7 +380,7 @@ module SibApiV3Sdk
380
380
  end
381
381
  return data, status_code, headers
382
382
  end
383
- # Returns the template informations
383
+ # Returns the template information
384
384
  # @param template_id id of the template
385
385
  # @param [Hash] opts the optional parameters
386
386
  # @return [GetSmtpTemplateOverview]
@@ -389,7 +389,7 @@ module SibApiV3Sdk
389
389
  data
390
390
  end
391
391
 
392
- # Returns the template informations
392
+ # Returns the template information
393
393
  # @param template_id id of the template
394
394
  # @param [Hash] opts the optional parameters
395
395
  # @return [Array<(GetSmtpTemplateOverview, Fixnum, Hash)>] GetSmtpTemplateOverview data, response status code and response headers
@@ -432,7 +432,7 @@ module SibApiV3Sdk
432
432
  end
433
433
  return data, status_code, headers
434
434
  end
435
- # Get the list of transactional email templates
435
+ # Get the list of email templates
436
436
  # @param [Hash] opts the optional parameters
437
437
  # @option opts [BOOLEAN] :template_status Filter on the status of the template. Active &#x3D; true, inactive &#x3D; false
438
438
  # @option opts [Integer] :limit Number of documents returned per page (default to 50)
@@ -443,7 +443,7 @@ module SibApiV3Sdk
443
443
  data
444
444
  end
445
445
 
446
- # Get the list of transactional email templates
446
+ # Get the list of email templates
447
447
  # @param [Hash] opts the optional parameters
448
448
  # @option opts [BOOLEAN] :template_status Filter on the status of the template. Active &#x3D; true, inactive &#x3D; false
449
449
  # @option opts [Integer] :limit Number of documents returned per page
@@ -614,7 +614,7 @@ module SibApiV3Sdk
614
614
  # @option opts [String] :email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent.
615
615
  # @option opts [Integer] :template_id Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email.
616
616
  # @option opts [String] :message_id Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent.
617
- # @option opts [String] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month.
617
+ # @option opts [Date] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month.
618
618
  # @option opts [Date] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month.
619
619
  # @return [GetTransacEmailsList]
620
620
  def get_transac_emails_list(opts = {})
@@ -628,7 +628,7 @@ module SibApiV3Sdk
628
628
  # @option opts [String] :email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent.
629
629
  # @option opts [Integer] :template_id Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email.
630
630
  # @option opts [String] :message_id Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent.
631
- # @option opts [String] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month.
631
+ # @option opts [Date] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month.
632
632
  # @option opts [Date] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month.
633
633
  # @return [Array<(GetTransacEmailsList, Fixnum, Hash)>] GetTransacEmailsList data, response status code and response headers
634
634
  def get_transac_emails_list_with_http_info(opts = {})
@@ -942,7 +942,7 @@ module SibApiV3Sdk
942
942
  end
943
943
  return data, status_code, headers
944
944
  end
945
- # Updates a transactional email templates
945
+ # Update an email template
946
946
  # @param template_id id of the template
947
947
  # @param smtp_template values to update in transactional email template
948
948
  # @param [Hash] opts the optional parameters
@@ -952,7 +952,7 @@ module SibApiV3Sdk
952
952
  nil
953
953
  end
954
954
 
955
- # Updates a transactional email templates
955
+ # Update an email template
956
956
  # @param template_id id of the template
957
957
  # @param smtp_template values to update in transactional email template
958
958
  # @param [Hash] opts the optional parameters
@@ -19,7 +19,7 @@ module SibApiV3Sdk
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Get all the SMS activity (unaggregated events)
22
+ # Get all your SMS activity (unaggregated events)
23
23
  # @param [Hash] opts the optional parameters
24
24
  # @option opts [Integer] :limit Number of documents per page (default to 50)
25
25
  # @option opts [String] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report
@@ -35,7 +35,7 @@ module SibApiV3Sdk
35
35
  data
36
36
  end
37
37
 
38
- # Get all the SMS activity (unaggregated events)
38
+ # Get all your SMS activity (unaggregated events)
39
39
  # @param [Hash] opts the optional parameters
40
40
  # @option opts [Integer] :limit Number of documents per page
41
41
  # @option opts [String] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report
@@ -212,7 +212,7 @@ module SibApiV3Sdk
212
212
  end
213
213
  return data, status_code, headers
214
214
  end
215
- # Send the SMS campaign to the specified mobile number
215
+ # Send the SMS campaign to a mobile number
216
216
  # @param send_transac_sms Values to send a transactional SMS
217
217
  # @param [Hash] opts the optional parameters
218
218
  # @return [SendSms]
@@ -221,7 +221,7 @@ module SibApiV3Sdk
221
221
  data
222
222
  end
223
223
 
224
- # Send the SMS campaign to the specified mobile number
224
+ # Send the SMS campaign to a mobile number
225
225
  # @param send_transac_sms Values to send a transactional SMS
226
226
  # @param [Hash] opts the optional parameters
227
227
  # @return [Array<(SendSms, Fixnum, Hash)>] SendSms data, response status code and response headers
@@ -14,7 +14,7 @@ require 'date'
14
14
 
15
15
  module SibApiV3Sdk
16
16
  class AddContactToList
17
- # Emails to add to a list
17
+ # Emails to add to a list. You can pass a maximum of 150 emails for addition in one request. If you need to add the emails in bulk, please prefer /contacts/import api.
18
18
  attr_accessor :emails
19
19
 
20
20
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -17,7 +17,7 @@ module SibApiV3Sdk
17
17
  # Value of the attribute. Use only if the attribute's category is 'calculated' or 'global'
18
18
  attr_accessor :value
19
19
 
20
- # List of values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, [{'value':1, 'label':'male'}, {'value':2, 'label':'female'}]
20
+ # List of values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, [{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}]
21
21
  attr_accessor :enumeration
22
22
 
23
23
  # Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'boolean' is only available if the category is 'normal' attribute, type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute )
@@ -14,10 +14,10 @@ require 'date'
14
14
 
15
15
  module SibApiV3Sdk
16
16
  class CreateContact
17
- # Email address of the user. Mandatory if \"SMS\" field is not passed in \"attributes\" parameter. For example {'SMS':'+91xxxxxxxxxx'}
17
+ # Email address of the user. Mandatory if \"SMS\" field is not passed in \"attributes\" parameter. Mobile Number in \"SMS\" field should be passed with proper country code. For example {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"}
18
18
  attr_accessor :email
19
19
 
20
- # Pass the set of attributes and their values. These attributes must be present in your SendinBlue account. For eg. {'FNAME':'Elly', 'LNAME':'Roger'}
20
+ # Pass the set of attributes and their values. These attributes must be present in your SendinBlue account. For eg. {\"FNAME\":\"Elly\", \"LNAME\":\"Roger\"}
21
21
  attr_accessor :attributes
22
22
 
23
23
  # Set this field to blacklist the contact for emails (emailBlacklisted = true)
@@ -0,0 +1,253 @@
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.12
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module SibApiV3Sdk
16
+ class CreateDoiContact
17
+ # Email address where the confirmation email will be sent. This email address will be the identifier for all other contact attributes.
18
+ attr_accessor :email
19
+
20
+ # Pass the set of attributes and their values. These attributes must be present in your SendinBlue account. For eg. {'FNAME':'Elly', 'LNAME':'Roger'}
21
+ attr_accessor :attributes
22
+
23
+ # Lists under user account where contact should be added
24
+ attr_accessor :include_list_ids
25
+
26
+ # Lists under user account where contact should not be added
27
+ attr_accessor :exclude_list_ids
28
+
29
+ # Id of the DOI template
30
+ attr_accessor :template_id
31
+
32
+ # URL of the web page that user will be redirected to after clicking on the double opt in URL.
33
+ attr_accessor :redirection_url
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'email' => :'email',
39
+ :'attributes' => :'attributes',
40
+ :'include_list_ids' => :'includeListIds',
41
+ :'exclude_list_ids' => :'excludeListIds',
42
+ :'template_id' => :'templateId',
43
+ :'redirection_url' => :'redirectionUrl'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.swagger_types
49
+ {
50
+ :'email' => :'String',
51
+ :'attributes' => :'Object',
52
+ :'include_list_ids' => :'Array<Integer>',
53
+ :'exclude_list_ids' => :'Array<Integer>',
54
+ :'template_id' => :'Integer',
55
+ :'redirection_url' => :'String'
56
+ }
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ return unless attributes.is_a?(Hash)
63
+
64
+ # convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
66
+
67
+ if attributes.has_key?(:'email')
68
+ self.email = attributes[:'email']
69
+ end
70
+
71
+ if attributes.has_key?(:'attributes')
72
+ self.attributes = attributes[:'attributes']
73
+ end
74
+
75
+ if attributes.has_key?(:'includeListIds')
76
+ if (value = attributes[:'includeListIds']).is_a?(Array)
77
+ self.include_list_ids = value
78
+ end
79
+ end
80
+
81
+ if attributes.has_key?(:'excludeListIds')
82
+ if (value = attributes[:'excludeListIds']).is_a?(Array)
83
+ self.exclude_list_ids = value
84
+ end
85
+ end
86
+
87
+ if attributes.has_key?(:'templateId')
88
+ self.template_id = attributes[:'templateId']
89
+ end
90
+
91
+ if attributes.has_key?(:'redirectionUrl')
92
+ self.redirection_url = attributes[:'redirectionUrl']
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ invalid_properties = Array.new
100
+ if @email.nil?
101
+ invalid_properties.push('invalid value for "email", email cannot be nil.')
102
+ end
103
+
104
+ if @include_list_ids.nil?
105
+ invalid_properties.push('invalid value for "include_list_ids", include_list_ids cannot be nil.')
106
+ end
107
+
108
+ if @template_id.nil?
109
+ invalid_properties.push('invalid value for "template_id", template_id cannot be nil.')
110
+ end
111
+
112
+ invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ return false if @email.nil?
119
+ return false if @include_list_ids.nil?
120
+ return false if @template_id.nil?
121
+ true
122
+ end
123
+
124
+ # Checks equality by comparing each attribute.
125
+ # @param [Object] Object to be compared
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ email == o.email &&
130
+ attributes == o.attributes &&
131
+ include_list_ids == o.include_list_ids &&
132
+ exclude_list_ids == o.exclude_list_ids &&
133
+ template_id == o.template_id &&
134
+ redirection_url == o.redirection_url
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Fixnum] Hash code
145
+ def hash
146
+ [email, attributes, include_list_ids, exclude_list_ids, template_id, redirection_url].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ self.class.swagger_types.each_pair do |key, type|
155
+ if type =~ /\AArray<(.*)>/i
156
+ # check to ensure the input is an array given that the the attribute
157
+ # is documented as an array but the input is not
158
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
159
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
160
+ end
161
+ elsif !attributes[self.class.attribute_map[key]].nil?
162
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
163
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
164
+ end
165
+
166
+ self
167
+ end
168
+
169
+ # Deserializes the data based on type
170
+ # @param string type Data type
171
+ # @param string value Value to be deserialized
172
+ # @return [Object] Deserialized data
173
+ def _deserialize(type, value)
174
+ case type.to_sym
175
+ when :DateTime
176
+ DateTime.parse(value)
177
+ when :Date
178
+ Date.parse(value)
179
+ when :String
180
+ value.to_s
181
+ when :Integer
182
+ value.to_i
183
+ when :Float
184
+ value.to_f
185
+ when :BOOLEAN
186
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
+ true
188
+ else
189
+ false
190
+ end
191
+ when :Object
192
+ # generic object (usually a Hash), return directly
193
+ value
194
+ when /\AArray<(?<inner_type>.+)>\z/
195
+ inner_type = Regexp.last_match[:inner_type]
196
+ value.map { |v| _deserialize(inner_type, v) }
197
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
198
+ k_type = Regexp.last_match[:k_type]
199
+ v_type = Regexp.last_match[:v_type]
200
+ {}.tap do |hash|
201
+ value.each do |k, v|
202
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
203
+ end
204
+ end
205
+ else # model
206
+ temp_model = SibApiV3Sdk.const_get(type).new
207
+ temp_model.build_from_hash(value)
208
+ end
209
+ end
210
+
211
+ # Returns the string representation of the object
212
+ # @return [String] String presentation of the object
213
+ def to_s
214
+ to_hash.to_s
215
+ end
216
+
217
+ # to_body is an alias to to_hash (backward compatibility)
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_body
220
+ to_hash
221
+ end
222
+
223
+ # Returns the object in the form of hash
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_hash
226
+ hash = {}
227
+ self.class.attribute_map.each_pair do |attr, param|
228
+ value = self.send(attr)
229
+ next if value.nil?
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ hash
233
+ end
234
+
235
+ # Outputs non-array value in the form of hash
236
+ # For object, use to_hash. Otherwise, just return the value
237
+ # @param [Object] value Any valid value
238
+ # @return [Hash] Returns the value in the form of hash
239
+ def _to_hash(value)
240
+ if value.is_a?(Array)
241
+ value.compact.map { |v| _to_hash(v) }
242
+ elsif value.is_a?(Hash)
243
+ {}.tap do |hash|
244
+ value.each { |k, v| hash[k] = _to_hash(v) }
245
+ end
246
+ elsif value.respond_to? :to_hash
247
+ value.to_hash
248
+ else
249
+ value
250
+ end
251
+ end
252
+ end
253
+ end