From 0f87d5bcf7f8125e6dc0e9407c27e7b962a69820 Mon Sep 17 00:00:00 2001 From: aayush-sib Date: Tue, 18 May 2021 18:40:49 +0530 Subject: [PATCH] for comparison --- .gitignore | 2 +- ...odegen-ignore => .openapi-generator-ignore | 6 +- .openapi-generator/FILES | 610 +++++++ .openapi-generator/VERSION | 1 + .rubocop.yml | 22 +- .swagger-codegen/VERSION | 1 - .travis.yml | 11 + Gemfile | 4 +- LICENSE.md | 21 - README.md | 130 +- Rakefile | 2 + docs/AbTestCampaignResult.md | 37 +- docs/AbTestCampaignResultClickedLinks.md | 19 +- docs/AbTestCampaignResultStatistics.md | 31 +- docs/AbTestVersionClicks.md | 7 - docs/AbTestVersionClicksInner.md | 10 - docs/AbTestVersionStats.md | 19 +- docs/AccountApi.md | 49 +- docs/AddChildDomain.md | 16 +- docs/AddContactToList.md | 19 +- docs/AddCredits.md | 19 +- docs/AttributesApi.md | 205 ++- docs/BlockDomain.md | 16 +- docs/ContactsApi.md | 1416 +++++++++++------ docs/CreateAttribute.md | 22 +- docs/CreateAttributeEnumeration.md | 19 +- docs/CreateChild.md | 31 +- docs/CreateContact.md | 34 +- docs/CreateDoiContact.md | 31 +- docs/CreateEmailCampaign.md | 97 +- docs/CreateEmailCampaignRecipients.md | 19 +- docs/CreateEmailCampaignSender.md | 22 +- docs/CreateList.md | 19 +- docs/CreateModel.md | 16 +- docs/CreateReseller.md | 19 +- docs/CreateSender.md | 22 +- docs/CreateSenderIps.md | 22 +- docs/CreateSenderModel.md | 22 +- docs/CreateSmsCampaign.md | 28 +- docs/CreateSmsCampaignRecipients.md | 19 +- docs/CreateSmtpEmail.md | 19 +- docs/CreateSmtpTemplate.md | 43 +- docs/CreateSmtpTemplateSender.md | 22 +- docs/CreateUpdateContactModel.md | 16 +- docs/CreateUpdateFolder.md | 16 +- docs/CreateWebhook.md | 25 +- docs/CreatedProcessId.md | 16 +- docs/DeleteHardbounces.md | 22 +- docs/EmailCampaignsApi.md | 677 +++++--- docs/EmailExportRecipients.md | 19 +- docs/ErrorModel.md | 19 +- docs/FoldersApi.md | 327 ++-- docs/GetAccount.md | 37 +- docs/GetAccountAllOf.md | 22 + docs/GetAccountAllOfMarketingAutomation.md | 20 + docs/GetAccountAllOfPlan.md | 28 + docs/GetAccountAllOfRelay.md | 20 + docs/GetAccountAllOfRelayData.md | 22 + docs/GetAccountMarketingAutomation.md | 9 - docs/GetAccountPlan.md | 13 - docs/GetAccountRelay.md | 9 - docs/GetAccountRelayData.md | 10 - docs/GetAggregatedReport.md | 52 +- docs/GetAttributes.md | 16 +- docs/GetAttributesAttributes.md | 28 +- docs/GetAttributesEnumeration.md | 19 +- docs/GetBlockedDomains.md | 16 +- docs/GetCampaignOverview.md | 52 +- docs/GetCampaignRecipients.md | 19 +- docs/GetCampaignStats.md | 52 +- docs/GetChildAccountCreationStatus.md | 16 +- docs/GetChildDomain.md | 19 +- docs/GetChildDomains.md | 7 - docs/GetChildInfo.md | 40 +- docs/GetChildInfoAllOf.md | 26 + docs/GetChildInfoAllOfApiKeys.md | 20 + docs/GetChildInfoAllOfApiKeysV2.md | 20 + docs/GetChildInfoAllOfApiKeysV3.md | 20 + docs/GetChildInfoAllOfCredits.md | 20 + docs/GetChildInfoAllOfStatistics.md | 22 + docs/GetChildInfoApiKeys.md | 9 - docs/GetChildInfoApiKeysV2.md | 9 - docs/GetChildInfoApiKeysV3.md | 9 - docs/GetChildInfoCredits.md | 9 - docs/GetChildInfoStatistics.md | 10 - docs/GetChildrenList.md | 19 +- docs/GetClient.md | 25 +- docs/GetContactCampaignStats.md | 37 +- docs/GetContactCampaignStatsClicked.md | 19 +- docs/GetContactCampaignStatsOpened.md | 25 +- ...etContactCampaignStatsTransacAttributes.md | 22 +- .../GetContactCampaignStatsUnsubscriptions.md | 19 +- docs/GetContactDetails.md | 40 +- docs/GetContacts.md | 19 +- docs/GetDeviceBrowserStats.md | 25 +- docs/GetEmailCampaign.md | 106 +- docs/GetEmailCampaignAllOf.md | 20 + docs/GetEmailCampaigns.md | 19 +- docs/GetEmailEventReport.md | 16 +- docs/GetEmailEventReportEvents.md | 46 +- docs/GetExtendedCampaignOverview.md | 100 +- docs/GetExtendedCampaignOverviewAllOf.md | 48 + .../GetExtendedCampaignOverviewAllOfSender.md | 22 + docs/GetExtendedCampaignOverviewSender.md | 10 - docs/GetExtendedCampaignStats.md | 37 +- docs/GetExtendedCampaignStatsGlobalStats.md | 7 - docs/GetExtendedClient.md | 28 +- docs/GetExtendedClientAddress.md | 11 - docs/GetExtendedClientAllOf.md | 18 + docs/GetExtendedClientAllOfAddress.md | 24 + docs/GetExtendedContactDetails.md | 43 +- docs/GetExtendedContactDetailsAllOf.md | 18 + ...etExtendedContactDetailsAllOfStatistics.md | 32 + ...dedContactDetailsAllOfStatisticsClicked.md | 20 + ...endedContactDetailsAllOfStatisticsLinks.md | 24 + ...ntactDetailsAllOfStatisticsMessagesSent.md | 20 + ...ndedContactDetailsAllOfStatisticsOpened.md | 24 + ...ctDetailsAllOfStatisticsUnsubscriptions.md | 20 + ...sticsUnsubscriptionsAdminUnsubscription.md | 20 + ...isticsUnsubscriptionsUserUnsubscription.md | 22 + docs/GetExtendedContactDetailsStatistics.md | 15 - ...ExtendedContactDetailsStatisticsClicked.md | 9 - ...etExtendedContactDetailsStatisticsLinks.md | 11 - ...dedContactDetailsStatisticsMessagesSent.md | 9 - ...tExtendedContactDetailsStatisticsOpened.md | 11 - ...ContactDetailsStatisticsUnsubscriptions.md | 9 - ...sticsUnsubscriptionsAdminUnsubscription.md | 9 - ...isticsUnsubscriptionsUserUnsubscription.md | 10 - docs/GetExtendedList.md | 39 +- docs/GetExtendedListAllOf.md | 24 + docs/GetExtendedListAllOfCampaignStats.md | 20 + docs/GetExtendedListCampaignStats.md | 9 - docs/GetFolder.md | 28 +- docs/GetFolderLists.md | 19 +- docs/GetFolders.md | 19 +- docs/GetIp.md | 25 +- docs/GetIpFromSender.md | 25 +- docs/GetIps.md | 16 +- docs/GetIpsFromSender.md | 16 +- docs/GetList.md | 27 +- docs/GetLists.md | 19 +- docs/GetProcess.md | 25 +- docs/GetProcesses.md | 19 +- docs/GetReports.md | 16 +- docs/GetReportsReports.md | 52 +- docs/GetSendersList.md | 16 +- docs/GetSendersListIps.md | 22 +- docs/GetSendersListSenders.md | 28 +- docs/GetSharedTemplateUrl.md | 16 +- docs/GetSmsCampaign.md | 43 +- docs/GetSmsCampaignAllOf.md | 20 + docs/GetSmsCampaignOverview.md | 37 +- docs/GetSmsCampaignRecipients.md | 7 - docs/GetSmsCampaignStats.md | 34 +- docs/GetSmsCampaigns.md | 19 +- docs/GetSmsEventReport.md | 16 +- docs/GetSmsEventReportEvents.md | 34 +- docs/GetSmtpTemplateOverview.md | 52 +- docs/GetSmtpTemplateOverviewSender.md | 22 +- docs/GetSmtpTemplates.md | 19 +- docs/GetSsoToken.md | 16 +- docs/GetStatsByBrowser.md | 7 - docs/GetStatsByDevice.md | 25 +- docs/GetStatsByDomain.md | 7 - docs/GetTransacAggregatedSmsReport.md | 43 +- docs/GetTransacBlockedContacts.md | 19 +- docs/GetTransacBlockedContactsContacts.md | 25 +- docs/GetTransacBlockedContactsReason.md | 19 +- docs/GetTransacEmailContent.md | 34 +- docs/GetTransacEmailContentEvents.md | 19 +- docs/GetTransacEmailsList.md | 18 +- ...GetTransacEmailsListTransactionalEmails.md | 37 +- docs/GetTransacSmsReport.md | 16 +- docs/GetTransacSmsReportReports.md | 43 +- docs/GetWebhook.md | 34 +- docs/GetWebhooks.md | 16 +- docs/ListsApi.md | 500 ++++-- docs/ManageIp.md | 16 +- docs/PostContactInfo.md | 16 +- docs/PostContactInfoContacts.md | 25 +- docs/PostSendFailed.md | 28 +- docs/PostSendSmsTestFailed.md | 25 +- docs/ProcessApi.md | 116 +- docs/RemainingCreditModel.md | 19 +- docs/RemainingCreditModelChild.md | 19 +- docs/RemainingCreditModelReseller.md | 19 +- docs/RemoveContactFromList.md | 22 +- docs/RemoveCredits.md | 19 +- docs/RequestContactExport.md | 25 +- ...RequestContactExportCustomContactFilter.md | 31 +- docs/RequestContactImport.md | 40 +- docs/RequestContactImportNewList.md | 19 +- docs/RequestSMSRecipientExport.md | 19 +- docs/ResellerApi.md | 821 ++++++---- docs/SMSCampaignsApi.md | 528 +++--- docs/SendEmail.md | 40 +- docs/SendEmailAttachment.md | 19 +- docs/SendReport.md | 19 +- docs/SendReportEmail.md | 19 +- docs/SendSms.md | 28 +- docs/SendSmtpEmail.md | 55 +- docs/SendSmtpEmailAttachment.md | 22 +- docs/SendSmtpEmailBcc.md | 19 +- docs/SendSmtpEmailCc.md | 19 +- docs/SendSmtpEmailMessageVersions.md | 31 +- docs/SendSmtpEmailReplyTo.md | 19 +- docs/SendSmtpEmailReplyTo1.md | 19 +- docs/SendSmtpEmailSender.md | 22 +- docs/SendSmtpEmailTo.md | 19 +- docs/SendSmtpEmailTo1.md | 19 +- docs/SendTemplateEmail.md | 16 +- docs/SendTestEmail.md | 16 +- docs/SendTestSms.md | 16 +- docs/SendTransacSms.md | 31 +- docs/SendersApi.md | 300 ++-- docs/TransactionalEmailsApi.md | 1094 ++++++++----- docs/TransactionalSMSApi.md | 248 +-- docs/UpdateAttribute.md | 19 +- docs/UpdateAttributeEnumeration.md | 19 +- docs/UpdateCampaignStatus.md | 16 +- docs/UpdateChild.md | 28 +- docs/UpdateChildAccountStatus.md | 25 +- docs/UpdateChildDomain.md | 16 +- docs/UpdateContact.md | 31 +- docs/UpdateEmailCampaign.md | 97 +- docs/UpdateEmailCampaignRecipients.md | 19 +- docs/UpdateEmailCampaignSender.md | 22 +- docs/UpdateList.md | 19 +- docs/UpdateSender.md | 22 +- docs/UpdateSmsCampaign.md | 28 +- docs/UpdateSmtpTemplate.md | 43 +- docs/UpdateSmtpTemplateSender.md | 22 +- docs/UpdateWebhook.md | 22 +- docs/UploadImageToGallery.md | 19 +- docs/WebhooksApi.md | 258 ++- git_push.sh | 58 + lib/sib-api-v3-sdk.rb | 65 +- lib/sib-api-v3-sdk/api/account_api.rb | 46 +- lib/sib-api-v3-sdk/api/attributes_api.rb | 185 ++- lib/sib-api-v3-sdk/api/contacts_api.rb | 1016 +++++++----- lib/sib-api-v3-sdk/api/email_campaigns_api.rb | 490 +++--- lib/sib-api-v3-sdk/api/folders_api.rb | 243 +-- lib/sib-api-v3-sdk/api/lists_api.rb | 351 ++-- lib/sib-api-v3-sdk/api/process_api.rb | 88 +- lib/sib-api-v3-sdk/api/reseller_api.rb | 597 ++++--- lib/sib-api-v3-sdk/api/senders_api.rb | 207 ++- lib/sib-api-v3-sdk/api/sms_campaigns_api.rb | 381 +++-- .../api/transactional_emails_api.rb | 731 ++++++--- .../api/transactional_sms_api.rb | 154 +- lib/sib-api-v3-sdk/api/webhooks_api.rb | 200 ++- lib/sib-api-v3-sdk/api_client.rb | 173 +- lib/sib-api-v3-sdk/api_error.rb | 25 +- lib/sib-api-v3-sdk/configuration.rb | 90 +- .../models/ab_test_campaign_result.rb | 110 +- .../ab_test_campaign_result_clicked_links.rb | 86 +- .../ab_test_campaign_result_statistics.rb | 84 +- .../models/ab_test_version_clicks.rb | 176 -- .../models/ab_test_version_stats.rb | 76 +- lib/sib-api-v3-sdk/models/add_child_domain.rb | 70 +- .../models/add_contact_to_list.rb | 120 +- lib/sib-api-v3-sdk/models/add_credits.rb | 72 +- lib/sib-api-v3-sdk/models/block_domain.rb | 70 +- lib/sib-api-v3-sdk/models/create_attribute.rb | 80 +- .../models/create_attribute_enumeration.rb | 72 +- lib/sib-api-v3-sdk/models/create_child.rb | 92 +- lib/sib-api-v3-sdk/models/create_contact.rb | 98 +- .../models/create_doi_contact.rb | 88 +- .../models/create_email_campaign.rb | 180 ++- .../create_email_campaign_recipients.rb | 76 +- .../models/create_email_campaign_sender.rb | 74 +- lib/sib-api-v3-sdk/models/create_list.rb | 74 +- lib/sib-api-v3-sdk/models/create_model.rb | 70 +- lib/sib-api-v3-sdk/models/create_reseller.rb | 74 +- lib/sib-api-v3-sdk/models/create_sender.rb | 74 +- .../models/create_sender_ips.rb | 74 +- .../models/create_sender_model.rb | 82 +- .../models/create_sms_campaign.rb | 80 +- .../models/create_sms_campaign_recipients.rb | 76 +- .../models/create_smtp_email.rb | 76 +- .../models/create_smtp_template.rb | 104 +- .../models/create_smtp_template_sender.rb | 74 +- .../models/create_update_contact_model.rb | 70 +- .../models/create_update_folder.rb | 70 +- lib/sib-api-v3-sdk/models/create_webhook.rb | 82 +- .../models/created_process_id.rb | 72 +- .../models/delete_hardbounces.rb | 80 +- .../models/email_export_recipients.rb | 82 +- lib/sib-api-v3-sdk/models/error_model.rb | 78 +- lib/sib-api-v3-sdk/models/get_account.rb | 108 +- ..._clicks_inner.rb => get_account_all_of.rb} | 131 +- ...et_account_all_of_marketing_automation.rb} | 76 +- ...unt_plan.rb => get_account_all_of_plan.rb} | 102 +- ...t_relay.rb => get_account_all_of_relay.rb} | 78 +- ...ta.rb => get_account_all_of_relay_data.rb} | 78 +- .../models/get_aggregated_report.rb | 104 +- lib/sib-api-v3-sdk/models/get_attributes.rb | 70 +- .../models/get_attributes_attributes.rb | 92 +- .../models/get_attributes_enumeration.rb | 72 +- .../models/get_blocked_domains.rb | 70 +- .../models/get_campaign_overview.rb | 126 +- .../models/get_campaign_recipients.rb | 74 +- .../models/get_campaign_stats.rb | 106 +- .../get_child_account_creation_status.rb | 74 +- lib/sib-api-v3-sdk/models/get_child_domain.rb | 74 +- .../models/get_child_domains.rb | 175 -- lib/sib-api-v3-sdk/models/get_child_info.rb | 108 +- .../models/get_child_info_all_of.rb | 263 +++ ...s.rb => get_child_info_all_of_api_keys.rb} | 78 +- ...b => get_child_info_all_of_api_keys_v2.rb} | 74 +- ...b => get_child_info_all_of_api_keys_v3.rb} | 74 +- ...ts.rb => get_child_info_all_of_credits.rb} | 78 +- ...rb => get_child_info_all_of_statistics.rb} | 82 +- .../models/get_children_list.rb | 74 +- lib/sib-api-v3-sdk/models/get_client.rb | 82 +- .../models/get_contact_campaign_stats.rb | 100 +- .../get_contact_campaign_stats_clicked.rb | 76 +- .../get_contact_campaign_stats_opened.rb | 80 +- ...ntact_campaign_stats_transac_attributes.rb | 80 +- ..._contact_campaign_stats_unsubscriptions.rb | 80 +- .../models/get_contact_details.rb | 102 +- lib/sib-api-v3-sdk/models/get_contacts.rb | 74 +- .../models/get_device_browser_stats.rb | 80 +- .../models/get_email_campaign.rb | 206 ++- .../models/get_email_campaign_all_of.rb | 237 +++ .../models/get_email_campaigns.rb | 74 +- .../models/get_email_event_report.rb | 70 +- .../models/get_email_event_report_events.rb | 100 +- .../models/get_extended_campaign_overview.rb | 198 ++- .../get_extended_campaign_overview_all_of.rb | 408 +++++ ...tended_campaign_overview_all_of_sender.rb} | 76 +- .../models/get_extended_campaign_stats.rb | 113 +- ...et_extended_campaign_stats_global_stats.rb | 176 -- .../models/get_extended_client.rb | 94 +- .../models/get_extended_client_all_of.rb | 223 +++ ... => get_extended_client_all_of_address.rb} | 80 +- .../models/get_extended_contact_details.rb | 114 +- .../get_extended_contact_details_all_of.rb | 223 +++ ...nded_contact_details_all_of_statistics.rb} | 108 +- ...tact_details_all_of_statistics_clicked.rb} | 78 +- ...ontact_details_all_of_statistics_links.rb} | 80 +- ...etails_all_of_statistics_messages_sent.rb} | 78 +- ...ntact_details_all_of_statistics_opened.rb} | 82 +- ...ails_all_of_statistics_unsubscriptions.rb} | 82 +- ...s_unsubscriptions_admin_unsubscription.rb} | 76 +- ...cs_unsubscriptions_user_unsubscription.rb} | 80 +- .../models/get_extended_list.rb | 125 +- .../models/get_extended_list_all_of.rb | 260 +++ ...et_extended_list_all_of_campaign_stats.rb} | 76 +- lib/sib-api-v3-sdk/models/get_folder.rb | 84 +- lib/sib-api-v3-sdk/models/get_folder_lists.rb | 74 +- lib/sib-api-v3-sdk/models/get_folders.rb | 74 +- lib/sib-api-v3-sdk/models/get_ip.rb | 78 +- .../models/get_ip_from_sender.rb | 76 +- lib/sib-api-v3-sdk/models/get_ips.rb | 70 +- .../models/get_ips_from_sender.rb | 70 +- lib/sib-api-v3-sdk/models/get_list.rb | 103 +- lib/sib-api-v3-sdk/models/get_lists.rb | 74 +- lib/sib-api-v3-sdk/models/get_process.rb | 82 +- lib/sib-api-v3-sdk/models/get_processes.rb | 72 +- lib/sib-api-v3-sdk/models/get_reports.rb | 70 +- .../models/get_reports_reports.rb | 104 +- lib/sib-api-v3-sdk/models/get_senders_list.rb | 70 +- .../models/get_senders_list_ips.rb | 74 +- .../models/get_senders_list_senders.rb | 80 +- .../models/get_shared_template_url.rb | 72 +- lib/sib-api-v3-sdk/models/get_sms_campaign.rb | 112 +- .../models/get_sms_campaign_all_of.rb | 237 +++ .../models/get_sms_campaign_overview.rb | 96 +- .../models/get_sms_campaign_recipients.rb | 175 -- .../models/get_sms_campaign_stats.rb | 86 +- .../models/get_sms_campaigns.rb | 74 +- .../models/get_sms_event_report.rb | 70 +- .../models/get_sms_event_report_events.rb | 92 +- .../models/get_smtp_template_overview.rb | 116 +- .../get_smtp_template_overview_sender.rb | 74 +- .../models/get_smtp_templates.rb | 72 +- lib/sib-api-v3-sdk/models/get_sso_token.rb | 70 +- .../models/get_stats_by_browser.rb | 175 -- .../models/get_stats_by_device.rb | 76 +- .../models/get_stats_by_domain.rb | 175 -- .../get_transac_aggregated_sms_report.rb | 92 +- .../models/get_transac_blocked_contacts.rb | 72 +- .../get_transac_blocked_contacts_contacts.rb | 80 +- .../get_transac_blocked_contacts_reason.rb | 78 +- .../models/get_transac_email_content.rb | 86 +- .../get_transac_email_content_events.rb | 72 +- .../models/get_transac_emails_list.rb | 84 +- ...ransac_emails_list_transactional_emails.rb | 88 +- .../models/get_transac_sms_report.rb | 70 +- .../models/get_transac_sms_report_reports.rb | 92 +- lib/sib-api-v3-sdk/models/get_webhook.rb | 92 +- lib/sib-api-v3-sdk/models/get_webhooks.rb | 72 +- lib/sib-api-v3-sdk/models/manage_ip.rb | 70 +- .../models/post_contact_info.rb | 70 +- .../models/post_contact_info_contacts.rb | 78 +- lib/sib-api-v3-sdk/models/post_send_failed.rb | 84 +- .../models/post_send_sms_test_failed.rb | 80 +- .../models/remaining_credit_model.rb | 72 +- .../models/remaining_credit_model_child.rb | 72 +- .../models/remaining_credit_model_reseller.rb | 72 +- .../models/remove_contact_from_list.rb | 124 +- lib/sib-api-v3-sdk/models/remove_credits.rb | 72 +- .../models/request_contact_export.rb | 84 +- ...st_contact_export_custom_contact_filter.rb | 110 +- .../models/request_contact_import.rb | 112 +- .../models/request_contact_import_new_list.rb | 76 +- .../models/request_sms_recipient_export.rb | 82 +- lib/sib-api-v3-sdk/models/send_email.rb | 96 +- .../models/send_email_attachment.rb | 82 +- lib/sib-api-v3-sdk/models/send_report.rb | 78 +- .../models/send_report_email.rb | 72 +- lib/sib-api-v3-sdk/models/send_sms.rb | 86 +- lib/sib-api-v3-sdk/models/send_smtp_email.rb | 106 +- .../models/send_smtp_email_attachment.rb | 84 +- .../models/send_smtp_email_bcc.rb | 72 +- .../models/send_smtp_email_cc.rb | 72 +- .../send_smtp_email_message_versions.rb | 82 +- .../models/send_smtp_email_reply_to.rb | 72 +- ...y_to_1.rb => send_smtp_email_reply_to1.rb} | 72 +- .../models/send_smtp_email_sender.rb | 74 +- .../models/send_smtp_email_to.rb | 72 +- ...p_email_to_1.rb => send_smtp_email_to1.rb} | 72 +- .../models/send_template_email.rb | 72 +- lib/sib-api-v3-sdk/models/send_test_email.rb | 72 +- lib/sib-api-v3-sdk/models/send_test_sms.rb | 72 +- lib/sib-api-v3-sdk/models/send_transac_sms.rb | 88 +- lib/sib-api-v3-sdk/models/update_attribute.rb | 72 +- .../models/update_attribute_enumeration.rb | 72 +- .../models/update_campaign_status.rb | 76 +- lib/sib-api-v3-sdk/models/update_child.rb | 84 +- .../models/update_child_account_status.rb | 92 +- .../models/update_child_domain.rb | 70 +- lib/sib-api-v3-sdk/models/update_contact.rb | 94 +- .../models/update_email_campaign.rb | 180 ++- .../update_email_campaign_recipients.rb | 76 +- .../models/update_email_campaign_sender.rb | 74 +- lib/sib-api-v3-sdk/models/update_list.rb | 74 +- lib/sib-api-v3-sdk/models/update_sender.rb | 74 +- .../models/update_sms_campaign.rb | 80 +- .../models/update_smtp_template.rb | 104 +- .../models/update_smtp_template_sender.rb | 74 +- lib/sib-api-v3-sdk/models/update_webhook.rb | 74 +- .../models/upload_image_to_gallery.rb | 74 +- lib/sib-api-v3-sdk/version.rb | 8 +- sib-api-v3-sdk.gemspec | 17 +- spec/api/account_api_spec.rb | 12 +- spec/api/attributes_api_spec.rb | 12 +- spec/api/contacts_api_spec.rb | 16 +- spec/api/email_campaigns_api_spec.rb | 12 +- spec/api/folders_api_spec.rb | 12 +- spec/api/lists_api_spec.rb | 12 +- spec/api/process_api_spec.rb | 12 +- spec/api/reseller_api_spec.rb | 14 +- spec/api/senders_api_spec.rb | 12 +- spec/api/sms_campaigns_api_spec.rb | 12 +- spec/api/transactional_emails_api_spec.rb | 20 +- spec/api/transactional_sms_api_spec.rb | 12 +- spec/api/webhooks_api_spec.rb | 13 +- spec/api_client_spec.rb | 25 +- spec/configuration_spec.rb | 6 +- ...test_campaign_result_clicked_links_spec.rb | 21 +- spec/models/ab_test_campaign_result_spec.rb | 25 +- ...ab_test_campaign_result_statistics_spec.rb | 21 +- spec/models/ab_test_version_clicks_spec.rb | 35 - spec/models/ab_test_version_stats_spec.rb | 21 +- spec/models/add_child_domain_spec.rb | 21 +- spec/models/add_contact_to_list_spec.rb | 21 +- spec/models/add_credits_spec.rb | 21 +- spec/models/block_domain_spec.rb | 21 +- .../create_attribute_enumeration_spec.rb | 21 +- spec/models/create_attribute_spec.rb | 23 +- spec/models/create_child_spec.rb | 23 +- spec/models/create_contact_spec.rb | 21 +- spec/models/create_doi_contact_spec.rb | 21 +- .../create_email_campaign_recipients_spec.rb | 21 +- .../create_email_campaign_sender_spec.rb | 21 +- spec/models/create_email_campaign_spec.rb | 23 +- spec/models/create_list_spec.rb | 21 +- spec/models/create_model_spec.rb | 21 +- spec/models/create_reseller_spec.rb | 21 +- spec/models/create_sender_ips_spec.rb | 21 +- spec/models/create_sender_model_spec.rb | 21 +- spec/models/create_sender_spec.rb | 21 +- .../create_sms_campaign_recipients_spec.rb | 21 +- spec/models/create_sms_campaign_spec.rb | 21 +- spec/models/create_smtp_email_spec.rb | 21 +- .../create_smtp_template_sender_spec.rb | 21 +- spec/models/create_smtp_template_spec.rb | 21 +- .../create_update_contact_model_spec.rb | 21 +- spec/models/create_update_folder_spec.rb | 21 +- spec/models/create_webhook_spec.rb | 25 +- spec/models/created_process_id_spec.rb | 21 +- spec/models/delete_hardbounces_spec.rb | 21 +- spec/models/email_export_recipients_spec.rb | 23 +- spec/models/error_model_spec.rb | 23 +- ...count_all_of_marketing_automation_spec.rb} | 27 +- ...pec.rb => get_account_all_of_plan_spec.rb} | 31 +- ... => get_account_all_of_relay_data_spec.rb} | 27 +- ...ec.rb => get_account_all_of_relay_spec.rb} | 27 +- ...ner_spec.rb => get_account_all_of_spec.rb} | 33 +- spec/models/get_account_spec.rb | 21 +- spec/models/get_aggregated_report_spec.rb | 21 +- spec/models/get_attributes_attributes_spec.rb | 25 +- .../models/get_attributes_enumeration_spec.rb | 21 +- spec/models/get_attributes_spec.rb | 21 +- spec/models/get_blocked_domains_spec.rb | 21 +- spec/models/get_campaign_overview_spec.rb | 25 +- spec/models/get_campaign_recipients_spec.rb | 21 +- spec/models/get_campaign_stats_spec.rb | 21 +- .../get_child_account_creation_status_spec.rb | 21 +- spec/models/get_child_domain_spec.rb | 21 +- spec/models/get_child_domains_spec.rb | 35 - ...=> get_child_info_all_of_api_keys_spec.rb} | 27 +- ...get_child_info_all_of_api_keys_v2_spec.rb} | 27 +- ...get_child_info_all_of_api_keys_v3_spec.rb} | 27 +- ... => get_child_info_all_of_credits_spec.rb} | 27 +- spec/models/get_child_info_all_of_spec.rb | 58 + ... get_child_info_all_of_statistics_spec.rb} | 27 +- spec/models/get_child_info_spec.rb | 21 +- spec/models/get_children_list_spec.rb | 21 +- spec/models/get_client_spec.rb | 21 +- ...get_contact_campaign_stats_clicked_spec.rb | 21 +- .../get_contact_campaign_stats_opened_spec.rb | 21 +- .../models/get_contact_campaign_stats_spec.rb | 21 +- ..._campaign_stats_transac_attributes_spec.rb | 21 +- ...act_campaign_stats_unsubscriptions_spec.rb | 21 +- spec/models/get_contact_details_spec.rb | 21 +- spec/models/get_contacts_spec.rb | 21 +- spec/models/get_device_browser_stats_spec.rb | 21 +- spec/models/get_email_campaign_all_of_spec.rb | 40 + spec/models/get_email_campaign_spec.rb | 25 +- spec/models/get_email_campaigns_spec.rb | 21 +- .../get_email_event_report_events_spec.rb | 23 +- spec/models/get_email_event_report_spec.rb | 21 +- ...d_campaign_overview_all_of_sender_spec.rb} | 27 +- ..._extended_campaign_overview_all_of_spec.rb | 124 ++ .../get_extended_campaign_overview_spec.rb | 25 +- .../get_extended_campaign_stats_spec.rb | 21 +- ...et_extended_client_all_of_address_spec.rb} | 27 +- ....rb => get_extended_client_all_of_spec.rb} | 31 +- spec/models/get_extended_client_spec.rb | 21 +- ...et_extended_contact_details_all_of_spec.rb | 34 + ...details_all_of_statistics_clicked_spec.rb} | 27 +- ...t_details_all_of_statistics_links_spec.rb} | 27 +- ...s_all_of_statistics_messages_sent_spec.rb} | 27 +- ..._details_all_of_statistics_opened_spec.rb} | 27 +- ...contact_details_all_of_statistics_spec.rb} | 27 +- ...ubscriptions_admin_unsubscription_spec.rb} | 27 +- ...all_of_statistics_unsubscriptions_spec.rb} | 27 +- ...subscriptions_user_unsubscription_spec.rb} | 27 +- .../get_extended_contact_details_spec.rb | 21 +- ...tended_list_all_of_campaign_stats_spec.rb} | 27 +- spec/models/get_extended_list_all_of_spec.rb | 52 + spec/models/get_extended_list_spec.rb | 27 +- spec/models/get_folder_lists_spec.rb | 21 +- spec/models/get_folder_spec.rb | 21 +- spec/models/get_folders_spec.rb | 21 +- spec/models/get_ip_from_sender_spec.rb | 21 +- spec/models/get_ip_spec.rb | 21 +- spec/models/get_ips_from_sender_spec.rb | 21 +- spec/models/get_ips_spec.rb | 21 +- spec/models/get_list_spec.rb | 27 +- spec/models/get_lists_spec.rb | 21 +- spec/models/get_process_spec.rb | 23 +- spec/models/get_processes_spec.rb | 21 +- spec/models/get_reports_reports_spec.rb | 21 +- spec/models/get_reports_spec.rb | 21 +- spec/models/get_senders_list_ips_spec.rb | 21 +- spec/models/get_senders_list_senders_spec.rb | 21 +- spec/models/get_senders_list_spec.rb | 21 +- spec/models/get_shared_template_url_spec.rb | 21 +- spec/models/get_sms_campaign_all_of_spec.rb | 40 + spec/models/get_sms_campaign_overview_spec.rb | 23 +- .../get_sms_campaign_recipients_spec.rb | 35 - spec/models/get_sms_campaign_spec.rb | 23 +- spec/models/get_sms_campaign_stats_spec.rb | 21 +- spec/models/get_sms_campaigns_spec.rb | 21 +- .../get_sms_event_report_events_spec.rb | 23 +- spec/models/get_sms_event_report_spec.rb | 21 +- .../get_smtp_template_overview_sender_spec.rb | 21 +- .../models/get_smtp_template_overview_spec.rb | 21 +- spec/models/get_smtp_templates_spec.rb | 21 +- spec/models/get_sso_token_spec.rb | 21 +- spec/models/get_stats_by_browser_spec.rb | 35 - spec/models/get_stats_by_device_spec.rb | 21 +- spec/models/get_stats_by_domain_spec.rb | 35 - .../get_transac_aggregated_sms_report_spec.rb | 21 +- ..._transac_blocked_contacts_contacts_spec.rb | 21 +- ...et_transac_blocked_contacts_reason_spec.rb | 23 +- .../get_transac_blocked_contacts_spec.rb | 21 +- .../get_transac_email_content_events_spec.rb | 21 +- spec/models/get_transac_email_content_spec.rb | 21 +- spec/models/get_transac_emails_list_spec.rb | 27 +- ...c_emails_list_transactional_emails_spec.rb | 21 +- .../get_transac_sms_report_reports_spec.rb | 21 +- spec/models/get_transac_sms_report_spec.rb | 21 +- spec/models/get_webhook_spec.rb | 23 +- spec/models/get_webhooks_spec.rb | 21 +- spec/models/manage_ip_spec.rb | 21 +- .../models/post_contact_info_contacts_spec.rb | 21 +- spec/models/post_contact_info_spec.rb | 21 +- spec/models/post_send_failed_spec.rb | 21 +- spec/models/post_send_sms_test_failed_spec.rb | 21 +- .../remaining_credit_model_child_spec.rb | 21 +- .../remaining_credit_model_reseller_spec.rb | 21 +- spec/models/remaining_credit_model_spec.rb | 21 +- spec/models/remove_contact_from_list_spec.rb | 21 +- spec/models/remove_credits_spec.rb | 21 +- ...ntact_export_custom_contact_filter_spec.rb | 27 +- spec/models/request_contact_export_spec.rb | 21 +- .../request_contact_import_new_list_spec.rb | 21 +- spec/models/request_contact_import_spec.rb | 21 +- .../request_sms_recipient_export_spec.rb | 23 +- spec/models/send_email_attachment_spec.rb | 21 +- spec/models/send_email_spec.rb | 21 +- spec/models/send_report_email_spec.rb | 21 +- spec/models/send_report_spec.rb | 23 +- spec/models/send_sms_spec.rb | 21 +- .../models/send_smtp_email_attachment_spec.rb | 21 +- spec/models/send_smtp_email_bcc_spec.rb | 21 +- spec/models/send_smtp_email_cc_spec.rb | 21 +- .../send_smtp_email_message_versions_spec.rb | 21 +- ...c.rb => send_smtp_email_reply_to1_spec.rb} | 21 +- spec/models/send_smtp_email_reply_to_spec.rb | 21 +- spec/models/send_smtp_email_sender_spec.rb | 21 +- spec/models/send_smtp_email_spec.rb | 21 +- ..._1_spec.rb => send_smtp_email_to1_spec.rb} | 21 +- spec/models/send_smtp_email_to_spec.rb | 21 +- spec/models/send_template_email_spec.rb | 21 +- spec/models/send_test_email_spec.rb | 21 +- spec/models/send_test_sms_spec.rb | 21 +- spec/models/send_transac_sms_spec.rb | 23 +- .../update_attribute_enumeration_spec.rb | 21 +- spec/models/update_attribute_spec.rb | 21 +- spec/models/update_campaign_status_spec.rb | 23 +- .../update_child_account_status_spec.rb | 21 +- spec/models/update_child_domain_spec.rb | 21 +- spec/models/update_child_spec.rb | 21 +- spec/models/update_contact_spec.rb | 21 +- .../update_email_campaign_recipients_spec.rb | 21 +- .../update_email_campaign_sender_spec.rb | 21 +- spec/models/update_email_campaign_spec.rb | 23 +- spec/models/update_list_spec.rb | 21 +- spec/models/update_sender_spec.rb | 21 +- spec/models/update_sms_campaign_spec.rb | 21 +- .../update_smtp_template_sender_spec.rb | 21 +- spec/models/update_smtp_template_spec.rb | 21 +- spec/models/update_webhook_spec.rb | 23 +- spec/models/upload_image_to_gallery_spec.rb | 21 +- spec/spec_helper.rb | 6 +- test.rb | 16 + 651 files changed, 26332 insertions(+), 13846 deletions(-) rename .swagger-codegen-ignore => .openapi-generator-ignore (78%) create mode 100644 .openapi-generator/FILES create mode 100644 .openapi-generator/VERSION delete mode 100644 .swagger-codegen/VERSION create mode 100644 .travis.yml delete mode 100644 LICENSE.md delete mode 100644 docs/AbTestVersionClicks.md delete mode 100644 docs/AbTestVersionClicksInner.md create mode 100644 docs/GetAccountAllOf.md create mode 100644 docs/GetAccountAllOfMarketingAutomation.md create mode 100644 docs/GetAccountAllOfPlan.md create mode 100644 docs/GetAccountAllOfRelay.md create mode 100644 docs/GetAccountAllOfRelayData.md delete mode 100644 docs/GetAccountMarketingAutomation.md delete mode 100644 docs/GetAccountPlan.md delete mode 100644 docs/GetAccountRelay.md delete mode 100644 docs/GetAccountRelayData.md delete mode 100644 docs/GetChildDomains.md create mode 100644 docs/GetChildInfoAllOf.md create mode 100644 docs/GetChildInfoAllOfApiKeys.md create mode 100644 docs/GetChildInfoAllOfApiKeysV2.md create mode 100644 docs/GetChildInfoAllOfApiKeysV3.md create mode 100644 docs/GetChildInfoAllOfCredits.md create mode 100644 docs/GetChildInfoAllOfStatistics.md delete mode 100644 docs/GetChildInfoApiKeys.md delete mode 100644 docs/GetChildInfoApiKeysV2.md delete mode 100644 docs/GetChildInfoApiKeysV3.md delete mode 100644 docs/GetChildInfoCredits.md delete mode 100644 docs/GetChildInfoStatistics.md create mode 100644 docs/GetEmailCampaignAllOf.md create mode 100644 docs/GetExtendedCampaignOverviewAllOf.md create mode 100644 docs/GetExtendedCampaignOverviewAllOfSender.md delete mode 100644 docs/GetExtendedCampaignOverviewSender.md delete mode 100644 docs/GetExtendedCampaignStatsGlobalStats.md delete mode 100644 docs/GetExtendedClientAddress.md create mode 100644 docs/GetExtendedClientAllOf.md create mode 100644 docs/GetExtendedClientAllOfAddress.md create mode 100644 docs/GetExtendedContactDetailsAllOf.md create mode 100644 docs/GetExtendedContactDetailsAllOfStatistics.md create mode 100644 docs/GetExtendedContactDetailsAllOfStatisticsClicked.md create mode 100644 docs/GetExtendedContactDetailsAllOfStatisticsLinks.md create mode 100644 docs/GetExtendedContactDetailsAllOfStatisticsMessagesSent.md create mode 100644 docs/GetExtendedContactDetailsAllOfStatisticsOpened.md create mode 100644 docs/GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.md create mode 100644 docs/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.md create mode 100644 docs/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.md delete mode 100644 docs/GetExtendedContactDetailsStatistics.md delete mode 100644 docs/GetExtendedContactDetailsStatisticsClicked.md delete mode 100644 docs/GetExtendedContactDetailsStatisticsLinks.md delete mode 100644 docs/GetExtendedContactDetailsStatisticsMessagesSent.md delete mode 100644 docs/GetExtendedContactDetailsStatisticsOpened.md delete mode 100644 docs/GetExtendedContactDetailsStatisticsUnsubscriptions.md delete mode 100644 docs/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.md delete mode 100644 docs/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.md create mode 100644 docs/GetExtendedListAllOf.md create mode 100644 docs/GetExtendedListAllOfCampaignStats.md delete mode 100644 docs/GetExtendedListCampaignStats.md create mode 100644 docs/GetSmsCampaignAllOf.md delete mode 100644 docs/GetSmsCampaignRecipients.md delete mode 100644 docs/GetStatsByBrowser.md delete mode 100644 docs/GetStatsByDomain.md create mode 100644 git_push.sh delete mode 100644 lib/sib-api-v3-sdk/models/ab_test_version_clicks.rb rename lib/sib-api-v3-sdk/models/{ab_test_version_clicks_inner.rb => get_account_all_of.rb} (62%) rename lib/sib-api-v3-sdk/models/{get_account_marketing_automation.rb => get_account_all_of_marketing_automation.rb} (72%) rename lib/sib-api-v3-sdk/models/{get_account_plan.rb => get_account_all_of_plan.rb} (74%) rename lib/sib-api-v3-sdk/models/{get_account_relay.rb => get_account_all_of_relay.rb} (73%) rename lib/sib-api-v3-sdk/models/{get_account_relay_data.rb => get_account_all_of_relay_data.rb} (74%) delete mode 100644 lib/sib-api-v3-sdk/models/get_child_domains.rb create mode 100644 lib/sib-api-v3-sdk/models/get_child_info_all_of.rb rename lib/sib-api-v3-sdk/models/{get_child_info_api_keys.rb => get_child_info_all_of_api_keys.rb} (72%) rename lib/sib-api-v3-sdk/models/{get_child_info_api_keys_v2.rb => get_child_info_all_of_api_keys_v2.rb} (73%) rename lib/sib-api-v3-sdk/models/{get_child_info_api_keys_v3.rb => get_child_info_all_of_api_keys_v3.rb} (73%) rename lib/sib-api-v3-sdk/models/{get_child_info_credits.rb => get_child_info_all_of_credits.rb} (71%) rename lib/sib-api-v3-sdk/models/{get_child_info_statistics.rb => get_child_info_all_of_statistics.rb} (71%) create mode 100644 lib/sib-api-v3-sdk/models/get_email_campaign_all_of.rb create mode 100644 lib/sib-api-v3-sdk/models/get_extended_campaign_overview_all_of.rb rename lib/sib-api-v3-sdk/models/{get_extended_campaign_overview_sender.rb => get_extended_campaign_overview_all_of_sender.rb} (72%) delete mode 100644 lib/sib-api-v3-sdk/models/get_extended_campaign_stats_global_stats.rb create mode 100644 lib/sib-api-v3-sdk/models/get_extended_client_all_of.rb rename lib/sib-api-v3-sdk/models/{get_extended_client_address.rb => get_extended_client_all_of_address.rb} (74%) create mode 100644 lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of.rb rename lib/sib-api-v3-sdk/models/{get_extended_contact_details_statistics.rb => get_extended_contact_details_all_of_statistics.rb} (69%) rename lib/sib-api-v3-sdk/models/{get_extended_contact_details_statistics_clicked.rb => get_extended_contact_details_all_of_statistics_clicked.rb} (72%) rename lib/sib-api-v3-sdk/models/{get_extended_contact_details_statistics_links.rb => get_extended_contact_details_all_of_statistics_links.rb} (74%) rename lib/sib-api-v3-sdk/models/{get_extended_contact_details_statistics_messages_sent.rb => get_extended_contact_details_all_of_statistics_messages_sent.rb} (72%) rename lib/sib-api-v3-sdk/models/{get_extended_contact_details_statistics_opened.rb => get_extended_contact_details_all_of_statistics_opened.rb} (74%) rename lib/sib-api-v3-sdk/models/{get_extended_contact_details_statistics_unsubscriptions.rb => get_extended_contact_details_all_of_statistics_unsubscriptions.rb} (72%) rename lib/sib-api-v3-sdk/models/{get_extended_contact_details_statistics_unsubscriptions_admin_unsubscription.rb => get_extended_contact_details_all_of_statistics_unsubscriptions_admin_unsubscription.rb} (71%) rename lib/sib-api-v3-sdk/models/{get_extended_contact_details_statistics_unsubscriptions_user_unsubscription.rb => get_extended_contact_details_all_of_statistics_unsubscriptions_user_unsubscription.rb} (72%) create mode 100644 lib/sib-api-v3-sdk/models/get_extended_list_all_of.rb rename lib/sib-api-v3-sdk/models/{get_extended_list_campaign_stats.rb => get_extended_list_all_of_campaign_stats.rb} (73%) create mode 100644 lib/sib-api-v3-sdk/models/get_sms_campaign_all_of.rb delete mode 100644 lib/sib-api-v3-sdk/models/get_sms_campaign_recipients.rb delete mode 100644 lib/sib-api-v3-sdk/models/get_stats_by_browser.rb delete mode 100644 lib/sib-api-v3-sdk/models/get_stats_by_domain.rb rename lib/sib-api-v3-sdk/models/{send_smtp_email_reply_to_1.rb => send_smtp_email_reply_to1.rb} (74%) rename lib/sib-api-v3-sdk/models/{send_smtp_email_to_1.rb => send_smtp_email_to1.rb} (74%) delete mode 100644 spec/models/ab_test_version_clicks_spec.rb rename spec/models/{get_account_marketing_automation_spec.rb => get_account_all_of_marketing_automation_spec.rb} (67%) rename spec/models/{get_account_plan_spec.rb => get_account_all_of_plan_spec.rb} (77%) rename spec/models/{get_account_relay_data_spec.rb => get_account_all_of_relay_data_spec.rb} (71%) rename spec/models/{get_account_relay_spec.rb => get_account_all_of_relay_spec.rb} (69%) rename spec/models/{ab_test_version_clicks_inner_spec.rb => get_account_all_of_spec.rb} (64%) delete mode 100644 spec/models/get_child_domains_spec.rb rename spec/models/{get_child_info_api_keys_spec.rb => get_child_info_all_of_api_keys_spec.rb} (68%) rename spec/models/{get_child_info_api_keys_v2_spec.rb => get_child_info_all_of_api_keys_v2_spec.rb} (68%) rename spec/models/{get_child_info_api_keys_v3_spec.rb => get_child_info_all_of_api_keys_v3_spec.rb} (68%) rename spec/models/{get_child_info_credits_spec.rb => get_child_info_all_of_credits_spec.rb} (68%) create mode 100644 spec/models/get_child_info_all_of_spec.rb rename spec/models/{get_child_info_statistics_spec.rb => get_child_info_all_of_statistics_spec.rb} (71%) create mode 100644 spec/models/get_email_campaign_all_of_spec.rb rename spec/models/{get_extended_campaign_overview_sender_spec.rb => get_extended_campaign_overview_all_of_sender_spec.rb} (71%) create mode 100644 spec/models/get_extended_campaign_overview_all_of_spec.rb rename spec/models/{get_extended_client_address_spec.rb => get_extended_client_all_of_address_spec.rb} (72%) rename spec/models/{get_extended_campaign_stats_global_stats_spec.rb => get_extended_client_all_of_spec.rb} (58%) create mode 100644 spec/models/get_extended_contact_details_all_of_spec.rb rename spec/models/{get_extended_contact_details_statistics_clicked_spec.rb => get_extended_contact_details_all_of_statistics_clicked_spec.rb} (65%) rename spec/models/{get_extended_contact_details_statistics_links_spec.rb => get_extended_contact_details_all_of_statistics_links_spec.rb} (70%) rename spec/models/{get_extended_contact_details_statistics_messages_sent_spec.rb => get_extended_contact_details_all_of_statistics_messages_sent_spec.rb} (64%) rename spec/models/{get_extended_contact_details_statistics_opened_spec.rb => get_extended_contact_details_all_of_statistics_opened_spec.rb} (70%) rename spec/models/{get_extended_contact_details_statistics_spec.rb => get_extended_contact_details_all_of_statistics_spec.rb} (78%) rename spec/models/{get_extended_contact_details_statistics_unsubscriptions_admin_unsubscription_spec.rb => get_extended_contact_details_all_of_statistics_unsubscriptions_admin_unsubscription_spec.rb} (61%) rename spec/models/{get_extended_contact_details_statistics_unsubscriptions_spec.rb => get_extended_contact_details_all_of_statistics_unsubscriptions_spec.rb} (64%) rename spec/models/{get_extended_contact_details_statistics_unsubscriptions_user_unsubscription_spec.rb => get_extended_contact_details_all_of_statistics_unsubscriptions_user_unsubscription_spec.rb} (64%) rename spec/models/{get_extended_list_campaign_stats_spec.rb => get_extended_list_all_of_campaign_stats_spec.rb} (67%) create mode 100644 spec/models/get_extended_list_all_of_spec.rb create mode 100644 spec/models/get_sms_campaign_all_of_spec.rb delete mode 100644 spec/models/get_sms_campaign_recipients_spec.rb delete mode 100644 spec/models/get_stats_by_browser_spec.rb delete mode 100644 spec/models/get_stats_by_domain_spec.rb rename spec/models/{send_smtp_email_reply_to_1_spec.rb => send_smtp_email_reply_to1_spec.rb} (76%) rename spec/models/{send_smtp_email_to_1_spec.rb => send_smtp_email_to1_spec.rb} (77%) create mode 100644 test.rb diff --git a/.gitignore b/.gitignore index c021594..05a17cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# Generated by: https://github.com/swagger-api/swagger-codegen.git +# Generated by: https://openapi-generator.tech # *.gem diff --git a/.swagger-codegen-ignore b/.openapi-generator-ignore similarity index 78% rename from .swagger-codegen-ignore rename to .openapi-generator-ignore index c5fa491..7484ee5 100644 --- a/.swagger-codegen-ignore +++ b/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..e8984a6 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,610 @@ +.gitignore +.openapi-generator-ignore +.rspec +.rubocop.yml +.travis.yml +Gemfile +README.md +Rakefile +docs/AbTestCampaignResult.md +docs/AbTestCampaignResultClickedLinks.md +docs/AbTestCampaignResultStatistics.md +docs/AbTestVersionStats.md +docs/AccountApi.md +docs/AddChildDomain.md +docs/AddContactToList.md +docs/AddCredits.md +docs/AttributesApi.md +docs/BlockDomain.md +docs/ContactsApi.md +docs/CreateAttribute.md +docs/CreateAttributeEnumeration.md +docs/CreateChild.md +docs/CreateContact.md +docs/CreateDoiContact.md +docs/CreateEmailCampaign.md +docs/CreateEmailCampaignRecipients.md +docs/CreateEmailCampaignSender.md +docs/CreateList.md +docs/CreateModel.md +docs/CreateReseller.md +docs/CreateSender.md +docs/CreateSenderIps.md +docs/CreateSenderModel.md +docs/CreateSmsCampaign.md +docs/CreateSmsCampaignRecipients.md +docs/CreateSmtpEmail.md +docs/CreateSmtpTemplate.md +docs/CreateSmtpTemplateSender.md +docs/CreateUpdateContactModel.md +docs/CreateUpdateFolder.md +docs/CreateWebhook.md +docs/CreatedProcessId.md +docs/DeleteHardbounces.md +docs/EmailCampaignsApi.md +docs/EmailExportRecipients.md +docs/ErrorModel.md +docs/FoldersApi.md +docs/GetAccount.md +docs/GetAccountAllOf.md +docs/GetAccountAllOfMarketingAutomation.md +docs/GetAccountAllOfPlan.md +docs/GetAccountAllOfRelay.md +docs/GetAccountAllOfRelayData.md +docs/GetAggregatedReport.md +docs/GetAttributes.md +docs/GetAttributesAttributes.md +docs/GetAttributesEnumeration.md +docs/GetBlockedDomains.md +docs/GetCampaignOverview.md +docs/GetCampaignRecipients.md +docs/GetCampaignStats.md +docs/GetChildAccountCreationStatus.md +docs/GetChildDomain.md +docs/GetChildInfo.md +docs/GetChildInfoAllOf.md +docs/GetChildInfoAllOfApiKeys.md +docs/GetChildInfoAllOfApiKeysV2.md +docs/GetChildInfoAllOfApiKeysV3.md +docs/GetChildInfoAllOfCredits.md +docs/GetChildInfoAllOfStatistics.md +docs/GetChildrenList.md +docs/GetClient.md +docs/GetContactCampaignStats.md +docs/GetContactCampaignStatsClicked.md +docs/GetContactCampaignStatsOpened.md +docs/GetContactCampaignStatsTransacAttributes.md +docs/GetContactCampaignStatsUnsubscriptions.md +docs/GetContactDetails.md +docs/GetContacts.md +docs/GetDeviceBrowserStats.md +docs/GetEmailCampaign.md +docs/GetEmailCampaignAllOf.md +docs/GetEmailCampaigns.md +docs/GetEmailEventReport.md +docs/GetEmailEventReportEvents.md +docs/GetExtendedCampaignOverview.md +docs/GetExtendedCampaignOverviewAllOf.md +docs/GetExtendedCampaignOverviewAllOfSender.md +docs/GetExtendedCampaignStats.md +docs/GetExtendedClient.md +docs/GetExtendedClientAllOf.md +docs/GetExtendedClientAllOfAddress.md +docs/GetExtendedContactDetails.md +docs/GetExtendedContactDetailsAllOf.md +docs/GetExtendedContactDetailsAllOfStatistics.md +docs/GetExtendedContactDetailsAllOfStatisticsClicked.md +docs/GetExtendedContactDetailsAllOfStatisticsLinks.md +docs/GetExtendedContactDetailsAllOfStatisticsMessagesSent.md +docs/GetExtendedContactDetailsAllOfStatisticsOpened.md +docs/GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.md +docs/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.md +docs/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.md +docs/GetExtendedList.md +docs/GetExtendedListAllOf.md +docs/GetExtendedListAllOfCampaignStats.md +docs/GetFolder.md +docs/GetFolderLists.md +docs/GetFolders.md +docs/GetIp.md +docs/GetIpFromSender.md +docs/GetIps.md +docs/GetIpsFromSender.md +docs/GetList.md +docs/GetLists.md +docs/GetProcess.md +docs/GetProcesses.md +docs/GetReports.md +docs/GetReportsReports.md +docs/GetSendersList.md +docs/GetSendersListIps.md +docs/GetSendersListSenders.md +docs/GetSharedTemplateUrl.md +docs/GetSmsCampaign.md +docs/GetSmsCampaignAllOf.md +docs/GetSmsCampaignOverview.md +docs/GetSmsCampaignStats.md +docs/GetSmsCampaigns.md +docs/GetSmsEventReport.md +docs/GetSmsEventReportEvents.md +docs/GetSmtpTemplateOverview.md +docs/GetSmtpTemplateOverviewSender.md +docs/GetSmtpTemplates.md +docs/GetSsoToken.md +docs/GetStatsByDevice.md +docs/GetTransacAggregatedSmsReport.md +docs/GetTransacBlockedContacts.md +docs/GetTransacBlockedContactsContacts.md +docs/GetTransacBlockedContactsReason.md +docs/GetTransacEmailContent.md +docs/GetTransacEmailContentEvents.md +docs/GetTransacEmailsList.md +docs/GetTransacEmailsListTransactionalEmails.md +docs/GetTransacSmsReport.md +docs/GetTransacSmsReportReports.md +docs/GetWebhook.md +docs/GetWebhooks.md +docs/ListsApi.md +docs/ManageIp.md +docs/PostContactInfo.md +docs/PostContactInfoContacts.md +docs/PostSendFailed.md +docs/PostSendSmsTestFailed.md +docs/ProcessApi.md +docs/RemainingCreditModel.md +docs/RemainingCreditModelChild.md +docs/RemainingCreditModelReseller.md +docs/RemoveContactFromList.md +docs/RemoveCredits.md +docs/RequestContactExport.md +docs/RequestContactExportCustomContactFilter.md +docs/RequestContactImport.md +docs/RequestContactImportNewList.md +docs/RequestSmsRecipientExport.md +docs/ResellerApi.md +docs/SMSCampaignsApi.md +docs/SendEmail.md +docs/SendEmailAttachment.md +docs/SendReport.md +docs/SendReportEmail.md +docs/SendSms.md +docs/SendSmtpEmail.md +docs/SendSmtpEmailAttachment.md +docs/SendSmtpEmailBcc.md +docs/SendSmtpEmailCc.md +docs/SendSmtpEmailMessageVersions.md +docs/SendSmtpEmailReplyTo.md +docs/SendSmtpEmailReplyTo1.md +docs/SendSmtpEmailSender.md +docs/SendSmtpEmailTo.md +docs/SendSmtpEmailTo1.md +docs/SendTemplateEmail.md +docs/SendTestEmail.md +docs/SendTestSms.md +docs/SendTransacSms.md +docs/SendersApi.md +docs/TransactionalEmailsApi.md +docs/TransactionalSMSApi.md +docs/UpdateAttribute.md +docs/UpdateAttributeEnumeration.md +docs/UpdateCampaignStatus.md +docs/UpdateChild.md +docs/UpdateChildAccountStatus.md +docs/UpdateChildDomain.md +docs/UpdateContact.md +docs/UpdateEmailCampaign.md +docs/UpdateEmailCampaignRecipients.md +docs/UpdateEmailCampaignSender.md +docs/UpdateList.md +docs/UpdateSender.md +docs/UpdateSmsCampaign.md +docs/UpdateSmtpTemplate.md +docs/UpdateSmtpTemplateSender.md +docs/UpdateWebhook.md +docs/UploadImageToGallery.md +docs/WebhooksApi.md +git_push.sh +lib/sib-api-v3-sdk.rb +lib/sib-api-v3-sdk/api/account_api.rb +lib/sib-api-v3-sdk/api/attributes_api.rb +lib/sib-api-v3-sdk/api/contacts_api.rb +lib/sib-api-v3-sdk/api/email_campaigns_api.rb +lib/sib-api-v3-sdk/api/folders_api.rb +lib/sib-api-v3-sdk/api/lists_api.rb +lib/sib-api-v3-sdk/api/process_api.rb +lib/sib-api-v3-sdk/api/reseller_api.rb +lib/sib-api-v3-sdk/api/senders_api.rb +lib/sib-api-v3-sdk/api/sms_campaigns_api.rb +lib/sib-api-v3-sdk/api/transactional_emails_api.rb +lib/sib-api-v3-sdk/api/transactional_sms_api.rb +lib/sib-api-v3-sdk/api/webhooks_api.rb +lib/sib-api-v3-sdk/api_client.rb +lib/sib-api-v3-sdk/api_error.rb +lib/sib-api-v3-sdk/configuration.rb +lib/sib-api-v3-sdk/configuration.rb +lib/sib-api-v3-sdk/models/ab_test_campaign_result.rb +lib/sib-api-v3-sdk/models/ab_test_campaign_result_clicked_links.rb +lib/sib-api-v3-sdk/models/ab_test_campaign_result_statistics.rb +lib/sib-api-v3-sdk/models/ab_test_version_stats.rb +lib/sib-api-v3-sdk/models/add_child_domain.rb +lib/sib-api-v3-sdk/models/add_contact_to_list.rb +lib/sib-api-v3-sdk/models/add_credits.rb +lib/sib-api-v3-sdk/models/block_domain.rb +lib/sib-api-v3-sdk/models/create_attribute.rb +lib/sib-api-v3-sdk/models/create_attribute_enumeration.rb +lib/sib-api-v3-sdk/models/create_child.rb +lib/sib-api-v3-sdk/models/create_contact.rb +lib/sib-api-v3-sdk/models/create_doi_contact.rb +lib/sib-api-v3-sdk/models/create_email_campaign.rb +lib/sib-api-v3-sdk/models/create_email_campaign_recipients.rb +lib/sib-api-v3-sdk/models/create_email_campaign_sender.rb +lib/sib-api-v3-sdk/models/create_list.rb +lib/sib-api-v3-sdk/models/create_model.rb +lib/sib-api-v3-sdk/models/create_reseller.rb +lib/sib-api-v3-sdk/models/create_sender.rb +lib/sib-api-v3-sdk/models/create_sender_ips.rb +lib/sib-api-v3-sdk/models/create_sender_model.rb +lib/sib-api-v3-sdk/models/create_sms_campaign.rb +lib/sib-api-v3-sdk/models/create_sms_campaign_recipients.rb +lib/sib-api-v3-sdk/models/create_smtp_email.rb +lib/sib-api-v3-sdk/models/create_smtp_template.rb +lib/sib-api-v3-sdk/models/create_smtp_template_sender.rb +lib/sib-api-v3-sdk/models/create_update_contact_model.rb +lib/sib-api-v3-sdk/models/create_update_folder.rb +lib/sib-api-v3-sdk/models/create_webhook.rb +lib/sib-api-v3-sdk/models/created_process_id.rb +lib/sib-api-v3-sdk/models/delete_hardbounces.rb +lib/sib-api-v3-sdk/models/email_export_recipients.rb +lib/sib-api-v3-sdk/models/error_model.rb +lib/sib-api-v3-sdk/models/get_account.rb +lib/sib-api-v3-sdk/models/get_account_all_of.rb +lib/sib-api-v3-sdk/models/get_account_all_of_marketing_automation.rb +lib/sib-api-v3-sdk/models/get_account_all_of_plan.rb +lib/sib-api-v3-sdk/models/get_account_all_of_relay.rb +lib/sib-api-v3-sdk/models/get_account_all_of_relay_data.rb +lib/sib-api-v3-sdk/models/get_aggregated_report.rb +lib/sib-api-v3-sdk/models/get_attributes.rb +lib/sib-api-v3-sdk/models/get_attributes_attributes.rb +lib/sib-api-v3-sdk/models/get_attributes_enumeration.rb +lib/sib-api-v3-sdk/models/get_blocked_domains.rb +lib/sib-api-v3-sdk/models/get_campaign_overview.rb +lib/sib-api-v3-sdk/models/get_campaign_recipients.rb +lib/sib-api-v3-sdk/models/get_campaign_stats.rb +lib/sib-api-v3-sdk/models/get_child_account_creation_status.rb +lib/sib-api-v3-sdk/models/get_child_domain.rb +lib/sib-api-v3-sdk/models/get_child_info.rb +lib/sib-api-v3-sdk/models/get_child_info_all_of.rb +lib/sib-api-v3-sdk/models/get_child_info_all_of_api_keys.rb +lib/sib-api-v3-sdk/models/get_child_info_all_of_api_keys_v2.rb +lib/sib-api-v3-sdk/models/get_child_info_all_of_api_keys_v3.rb +lib/sib-api-v3-sdk/models/get_child_info_all_of_credits.rb +lib/sib-api-v3-sdk/models/get_child_info_all_of_statistics.rb +lib/sib-api-v3-sdk/models/get_children_list.rb +lib/sib-api-v3-sdk/models/get_client.rb +lib/sib-api-v3-sdk/models/get_contact_campaign_stats.rb +lib/sib-api-v3-sdk/models/get_contact_campaign_stats_clicked.rb +lib/sib-api-v3-sdk/models/get_contact_campaign_stats_opened.rb +lib/sib-api-v3-sdk/models/get_contact_campaign_stats_transac_attributes.rb +lib/sib-api-v3-sdk/models/get_contact_campaign_stats_unsubscriptions.rb +lib/sib-api-v3-sdk/models/get_contact_details.rb +lib/sib-api-v3-sdk/models/get_contacts.rb +lib/sib-api-v3-sdk/models/get_device_browser_stats.rb +lib/sib-api-v3-sdk/models/get_email_campaign.rb +lib/sib-api-v3-sdk/models/get_email_campaign_all_of.rb +lib/sib-api-v3-sdk/models/get_email_campaigns.rb +lib/sib-api-v3-sdk/models/get_email_event_report.rb +lib/sib-api-v3-sdk/models/get_email_event_report_events.rb +lib/sib-api-v3-sdk/models/get_extended_campaign_overview.rb +lib/sib-api-v3-sdk/models/get_extended_campaign_overview_all_of.rb +lib/sib-api-v3-sdk/models/get_extended_campaign_overview_all_of_sender.rb +lib/sib-api-v3-sdk/models/get_extended_campaign_stats.rb +lib/sib-api-v3-sdk/models/get_extended_client.rb +lib/sib-api-v3-sdk/models/get_extended_client_all_of.rb +lib/sib-api-v3-sdk/models/get_extended_client_all_of_address.rb +lib/sib-api-v3-sdk/models/get_extended_contact_details.rb +lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of.rb +lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics.rb +lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_clicked.rb +lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_links.rb +lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_messages_sent.rb +lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_opened.rb +lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_unsubscriptions.rb +lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_unsubscriptions_admin_unsubscription.rb +lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_unsubscriptions_user_unsubscription.rb +lib/sib-api-v3-sdk/models/get_extended_list.rb +lib/sib-api-v3-sdk/models/get_extended_list_all_of.rb +lib/sib-api-v3-sdk/models/get_extended_list_all_of_campaign_stats.rb +lib/sib-api-v3-sdk/models/get_folder.rb +lib/sib-api-v3-sdk/models/get_folder_lists.rb +lib/sib-api-v3-sdk/models/get_folders.rb +lib/sib-api-v3-sdk/models/get_ip.rb +lib/sib-api-v3-sdk/models/get_ip_from_sender.rb +lib/sib-api-v3-sdk/models/get_ips.rb +lib/sib-api-v3-sdk/models/get_ips_from_sender.rb +lib/sib-api-v3-sdk/models/get_list.rb +lib/sib-api-v3-sdk/models/get_lists.rb +lib/sib-api-v3-sdk/models/get_process.rb +lib/sib-api-v3-sdk/models/get_processes.rb +lib/sib-api-v3-sdk/models/get_reports.rb +lib/sib-api-v3-sdk/models/get_reports_reports.rb +lib/sib-api-v3-sdk/models/get_senders_list.rb +lib/sib-api-v3-sdk/models/get_senders_list_ips.rb +lib/sib-api-v3-sdk/models/get_senders_list_senders.rb +lib/sib-api-v3-sdk/models/get_shared_template_url.rb +lib/sib-api-v3-sdk/models/get_sms_campaign.rb +lib/sib-api-v3-sdk/models/get_sms_campaign_all_of.rb +lib/sib-api-v3-sdk/models/get_sms_campaign_overview.rb +lib/sib-api-v3-sdk/models/get_sms_campaign_stats.rb +lib/sib-api-v3-sdk/models/get_sms_campaigns.rb +lib/sib-api-v3-sdk/models/get_sms_event_report.rb +lib/sib-api-v3-sdk/models/get_sms_event_report_events.rb +lib/sib-api-v3-sdk/models/get_smtp_template_overview.rb +lib/sib-api-v3-sdk/models/get_smtp_template_overview_sender.rb +lib/sib-api-v3-sdk/models/get_smtp_templates.rb +lib/sib-api-v3-sdk/models/get_sso_token.rb +lib/sib-api-v3-sdk/models/get_stats_by_device.rb +lib/sib-api-v3-sdk/models/get_transac_aggregated_sms_report.rb +lib/sib-api-v3-sdk/models/get_transac_blocked_contacts.rb +lib/sib-api-v3-sdk/models/get_transac_blocked_contacts_contacts.rb +lib/sib-api-v3-sdk/models/get_transac_blocked_contacts_reason.rb +lib/sib-api-v3-sdk/models/get_transac_email_content.rb +lib/sib-api-v3-sdk/models/get_transac_email_content_events.rb +lib/sib-api-v3-sdk/models/get_transac_emails_list.rb +lib/sib-api-v3-sdk/models/get_transac_emails_list_transactional_emails.rb +lib/sib-api-v3-sdk/models/get_transac_sms_report.rb +lib/sib-api-v3-sdk/models/get_transac_sms_report_reports.rb +lib/sib-api-v3-sdk/models/get_webhook.rb +lib/sib-api-v3-sdk/models/get_webhooks.rb +lib/sib-api-v3-sdk/models/manage_ip.rb +lib/sib-api-v3-sdk/models/post_contact_info.rb +lib/sib-api-v3-sdk/models/post_contact_info_contacts.rb +lib/sib-api-v3-sdk/models/post_send_failed.rb +lib/sib-api-v3-sdk/models/post_send_sms_test_failed.rb +lib/sib-api-v3-sdk/models/remaining_credit_model.rb +lib/sib-api-v3-sdk/models/remaining_credit_model_child.rb +lib/sib-api-v3-sdk/models/remaining_credit_model_reseller.rb +lib/sib-api-v3-sdk/models/remove_contact_from_list.rb +lib/sib-api-v3-sdk/models/remove_credits.rb +lib/sib-api-v3-sdk/models/request_contact_export.rb +lib/sib-api-v3-sdk/models/request_contact_export_custom_contact_filter.rb +lib/sib-api-v3-sdk/models/request_contact_import.rb +lib/sib-api-v3-sdk/models/request_contact_import_new_list.rb +lib/sib-api-v3-sdk/models/request_sms_recipient_export.rb +lib/sib-api-v3-sdk/models/send_email.rb +lib/sib-api-v3-sdk/models/send_email_attachment.rb +lib/sib-api-v3-sdk/models/send_report.rb +lib/sib-api-v3-sdk/models/send_report_email.rb +lib/sib-api-v3-sdk/models/send_sms.rb +lib/sib-api-v3-sdk/models/send_smtp_email.rb +lib/sib-api-v3-sdk/models/send_smtp_email_attachment.rb +lib/sib-api-v3-sdk/models/send_smtp_email_bcc.rb +lib/sib-api-v3-sdk/models/send_smtp_email_cc.rb +lib/sib-api-v3-sdk/models/send_smtp_email_message_versions.rb +lib/sib-api-v3-sdk/models/send_smtp_email_reply_to.rb +lib/sib-api-v3-sdk/models/send_smtp_email_reply_to1.rb +lib/sib-api-v3-sdk/models/send_smtp_email_sender.rb +lib/sib-api-v3-sdk/models/send_smtp_email_to.rb +lib/sib-api-v3-sdk/models/send_smtp_email_to1.rb +lib/sib-api-v3-sdk/models/send_template_email.rb +lib/sib-api-v3-sdk/models/send_test_email.rb +lib/sib-api-v3-sdk/models/send_test_sms.rb +lib/sib-api-v3-sdk/models/send_transac_sms.rb +lib/sib-api-v3-sdk/models/update_attribute.rb +lib/sib-api-v3-sdk/models/update_attribute_enumeration.rb +lib/sib-api-v3-sdk/models/update_campaign_status.rb +lib/sib-api-v3-sdk/models/update_child.rb +lib/sib-api-v3-sdk/models/update_child_account_status.rb +lib/sib-api-v3-sdk/models/update_child_domain.rb +lib/sib-api-v3-sdk/models/update_contact.rb +lib/sib-api-v3-sdk/models/update_email_campaign.rb +lib/sib-api-v3-sdk/models/update_email_campaign_recipients.rb +lib/sib-api-v3-sdk/models/update_email_campaign_sender.rb +lib/sib-api-v3-sdk/models/update_list.rb +lib/sib-api-v3-sdk/models/update_sender.rb +lib/sib-api-v3-sdk/models/update_sms_campaign.rb +lib/sib-api-v3-sdk/models/update_smtp_template.rb +lib/sib-api-v3-sdk/models/update_smtp_template_sender.rb +lib/sib-api-v3-sdk/models/update_webhook.rb +lib/sib-api-v3-sdk/models/upload_image_to_gallery.rb +lib/sib-api-v3-sdk/version.rb +sib-api-v3-sdk.gemspec +spec/api/account_api_spec.rb +spec/api/attributes_api_spec.rb +spec/api/contacts_api_spec.rb +spec/api/email_campaigns_api_spec.rb +spec/api/folders_api_spec.rb +spec/api/lists_api_spec.rb +spec/api/process_api_spec.rb +spec/api/reseller_api_spec.rb +spec/api/senders_api_spec.rb +spec/api/sms_campaigns_api_spec.rb +spec/api/transactional_emails_api_spec.rb +spec/api/transactional_sms_api_spec.rb +spec/api/webhooks_api_spec.rb +spec/api_client_spec.rb +spec/configuration_spec.rb +spec/models/ab_test_campaign_result_clicked_links_spec.rb +spec/models/ab_test_campaign_result_spec.rb +spec/models/ab_test_campaign_result_statistics_spec.rb +spec/models/ab_test_version_stats_spec.rb +spec/models/add_child_domain_spec.rb +spec/models/add_contact_to_list_spec.rb +spec/models/add_credits_spec.rb +spec/models/block_domain_spec.rb +spec/models/create_attribute_enumeration_spec.rb +spec/models/create_attribute_spec.rb +spec/models/create_child_spec.rb +spec/models/create_contact_spec.rb +spec/models/create_doi_contact_spec.rb +spec/models/create_email_campaign_recipients_spec.rb +spec/models/create_email_campaign_sender_spec.rb +spec/models/create_email_campaign_spec.rb +spec/models/create_list_spec.rb +spec/models/create_model_spec.rb +spec/models/create_reseller_spec.rb +spec/models/create_sender_ips_spec.rb +spec/models/create_sender_model_spec.rb +spec/models/create_sender_spec.rb +spec/models/create_sms_campaign_recipients_spec.rb +spec/models/create_sms_campaign_spec.rb +spec/models/create_smtp_email_spec.rb +spec/models/create_smtp_template_sender_spec.rb +spec/models/create_smtp_template_spec.rb +spec/models/create_update_contact_model_spec.rb +spec/models/create_update_folder_spec.rb +spec/models/create_webhook_spec.rb +spec/models/created_process_id_spec.rb +spec/models/delete_hardbounces_spec.rb +spec/models/email_export_recipients_spec.rb +spec/models/error_model_spec.rb +spec/models/get_account_all_of_marketing_automation_spec.rb +spec/models/get_account_all_of_plan_spec.rb +spec/models/get_account_all_of_relay_data_spec.rb +spec/models/get_account_all_of_relay_spec.rb +spec/models/get_account_all_of_spec.rb +spec/models/get_account_spec.rb +spec/models/get_aggregated_report_spec.rb +spec/models/get_attributes_attributes_spec.rb +spec/models/get_attributes_enumeration_spec.rb +spec/models/get_attributes_spec.rb +spec/models/get_blocked_domains_spec.rb +spec/models/get_campaign_overview_spec.rb +spec/models/get_campaign_recipients_spec.rb +spec/models/get_campaign_stats_spec.rb +spec/models/get_child_account_creation_status_spec.rb +spec/models/get_child_domain_spec.rb +spec/models/get_child_info_all_of_api_keys_spec.rb +spec/models/get_child_info_all_of_api_keys_v2_spec.rb +spec/models/get_child_info_all_of_api_keys_v3_spec.rb +spec/models/get_child_info_all_of_credits_spec.rb +spec/models/get_child_info_all_of_spec.rb +spec/models/get_child_info_all_of_statistics_spec.rb +spec/models/get_child_info_spec.rb +spec/models/get_children_list_spec.rb +spec/models/get_client_spec.rb +spec/models/get_contact_campaign_stats_clicked_spec.rb +spec/models/get_contact_campaign_stats_opened_spec.rb +spec/models/get_contact_campaign_stats_spec.rb +spec/models/get_contact_campaign_stats_transac_attributes_spec.rb +spec/models/get_contact_campaign_stats_unsubscriptions_spec.rb +spec/models/get_contact_details_spec.rb +spec/models/get_contacts_spec.rb +spec/models/get_device_browser_stats_spec.rb +spec/models/get_email_campaign_all_of_spec.rb +spec/models/get_email_campaign_spec.rb +spec/models/get_email_campaigns_spec.rb +spec/models/get_email_event_report_events_spec.rb +spec/models/get_email_event_report_spec.rb +spec/models/get_extended_campaign_overview_all_of_sender_spec.rb +spec/models/get_extended_campaign_overview_all_of_spec.rb +spec/models/get_extended_campaign_overview_spec.rb +spec/models/get_extended_campaign_stats_spec.rb +spec/models/get_extended_client_all_of_address_spec.rb +spec/models/get_extended_client_all_of_spec.rb +spec/models/get_extended_client_spec.rb +spec/models/get_extended_contact_details_all_of_spec.rb +spec/models/get_extended_contact_details_all_of_statistics_clicked_spec.rb +spec/models/get_extended_contact_details_all_of_statistics_links_spec.rb +spec/models/get_extended_contact_details_all_of_statistics_messages_sent_spec.rb +spec/models/get_extended_contact_details_all_of_statistics_opened_spec.rb +spec/models/get_extended_contact_details_all_of_statistics_spec.rb +spec/models/get_extended_contact_details_all_of_statistics_unsubscriptions_admin_unsubscription_spec.rb +spec/models/get_extended_contact_details_all_of_statistics_unsubscriptions_spec.rb +spec/models/get_extended_contact_details_all_of_statistics_unsubscriptions_user_unsubscription_spec.rb +spec/models/get_extended_contact_details_spec.rb +spec/models/get_extended_list_all_of_campaign_stats_spec.rb +spec/models/get_extended_list_all_of_spec.rb +spec/models/get_extended_list_spec.rb +spec/models/get_folder_lists_spec.rb +spec/models/get_folder_spec.rb +spec/models/get_folders_spec.rb +spec/models/get_ip_from_sender_spec.rb +spec/models/get_ip_spec.rb +spec/models/get_ips_from_sender_spec.rb +spec/models/get_ips_spec.rb +spec/models/get_list_spec.rb +spec/models/get_lists_spec.rb +spec/models/get_process_spec.rb +spec/models/get_processes_spec.rb +spec/models/get_reports_reports_spec.rb +spec/models/get_reports_spec.rb +spec/models/get_senders_list_ips_spec.rb +spec/models/get_senders_list_senders_spec.rb +spec/models/get_senders_list_spec.rb +spec/models/get_shared_template_url_spec.rb +spec/models/get_sms_campaign_all_of_spec.rb +spec/models/get_sms_campaign_overview_spec.rb +spec/models/get_sms_campaign_spec.rb +spec/models/get_sms_campaign_stats_spec.rb +spec/models/get_sms_campaigns_spec.rb +spec/models/get_sms_event_report_events_spec.rb +spec/models/get_sms_event_report_spec.rb +spec/models/get_smtp_template_overview_sender_spec.rb +spec/models/get_smtp_template_overview_spec.rb +spec/models/get_smtp_templates_spec.rb +spec/models/get_sso_token_spec.rb +spec/models/get_stats_by_device_spec.rb +spec/models/get_transac_aggregated_sms_report_spec.rb +spec/models/get_transac_blocked_contacts_contacts_spec.rb +spec/models/get_transac_blocked_contacts_reason_spec.rb +spec/models/get_transac_blocked_contacts_spec.rb +spec/models/get_transac_email_content_events_spec.rb +spec/models/get_transac_email_content_spec.rb +spec/models/get_transac_emails_list_spec.rb +spec/models/get_transac_emails_list_transactional_emails_spec.rb +spec/models/get_transac_sms_report_reports_spec.rb +spec/models/get_transac_sms_report_spec.rb +spec/models/get_webhook_spec.rb +spec/models/get_webhooks_spec.rb +spec/models/manage_ip_spec.rb +spec/models/post_contact_info_contacts_spec.rb +spec/models/post_contact_info_spec.rb +spec/models/post_send_failed_spec.rb +spec/models/post_send_sms_test_failed_spec.rb +spec/models/remaining_credit_model_child_spec.rb +spec/models/remaining_credit_model_reseller_spec.rb +spec/models/remaining_credit_model_spec.rb +spec/models/remove_contact_from_list_spec.rb +spec/models/remove_credits_spec.rb +spec/models/request_contact_export_custom_contact_filter_spec.rb +spec/models/request_contact_export_spec.rb +spec/models/request_contact_import_new_list_spec.rb +spec/models/request_contact_import_spec.rb +spec/models/request_sms_recipient_export_spec.rb +spec/models/send_email_attachment_spec.rb +spec/models/send_email_spec.rb +spec/models/send_report_email_spec.rb +spec/models/send_report_spec.rb +spec/models/send_sms_spec.rb +spec/models/send_smtp_email_attachment_spec.rb +spec/models/send_smtp_email_bcc_spec.rb +spec/models/send_smtp_email_cc_spec.rb +spec/models/send_smtp_email_message_versions_spec.rb +spec/models/send_smtp_email_reply_to1_spec.rb +spec/models/send_smtp_email_reply_to_spec.rb +spec/models/send_smtp_email_sender_spec.rb +spec/models/send_smtp_email_spec.rb +spec/models/send_smtp_email_to1_spec.rb +spec/models/send_smtp_email_to_spec.rb +spec/models/send_template_email_spec.rb +spec/models/send_test_email_spec.rb +spec/models/send_test_sms_spec.rb +spec/models/send_transac_sms_spec.rb +spec/models/update_attribute_enumeration_spec.rb +spec/models/update_attribute_spec.rb +spec/models/update_campaign_status_spec.rb +spec/models/update_child_account_status_spec.rb +spec/models/update_child_domain_spec.rb +spec/models/update_child_spec.rb +spec/models/update_contact_spec.rb +spec/models/update_email_campaign_recipients_spec.rb +spec/models/update_email_campaign_sender_spec.rb +spec/models/update_email_campaign_spec.rb +spec/models/update_list_spec.rb +spec/models/update_sender_spec.rb +spec/models/update_sms_campaign_spec.rb +spec/models/update_smtp_template_sender_spec.rb +spec/models/update_smtp_template_spec.rb +spec/models/update_webhook_spec.rb +spec/models/upload_image_to_gallery_spec.rb +spec/spec_helper.rb diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..acf69b4 --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.1.0 \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml index 19a777e..d32b2b1 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,7 +1,7 @@ # This file is based on https://github.com/rails/rails/blob/master/.rubocop.yml (MIT license) -# Automatically generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen) +# Automatically generated by OpenAPI Generator (https://openapi-generator.tech) AllCops: - TargetRubyVersion: 2.2 + TargetRubyVersion: 2.4 # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop # to ignore them, so only the ones explicitly set in this file are enabled. DisabledByDefault: true @@ -14,12 +14,6 @@ AllCops: Style/AndOr: Enabled: true -# Do not use braces for hash literals when they are the last argument of a -# method call. -Style/BracesAroundHashParameters: - Enabled: true - EnforcedStyle: context_dependent - # Align `when` with `case`. Layout/CaseIndentation: Enabled: true @@ -46,7 +40,7 @@ Layout/EmptyLinesAroundMethodBody: Layout/EmptyLinesAroundModuleBody: Enabled: true -Layout/FirstParameterIndentation: +Layout/FirstArgumentIndentation: Enabled: true # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }. @@ -57,7 +51,7 @@ Style/HashSyntax: # extra level of indentation. Layout/IndentationConsistency: Enabled: true - EnforcedStyle: rails + EnforcedStyle: indented_internal_methods # Two spaces, no tabs (for indentation). Layout/IndentationWidth: @@ -119,11 +113,11 @@ Layout/SpaceInsideParens: # EnforcedStyle: single_quotes # Detect hard tabs, no hard tabs. -Layout/Tab: +Layout/IndentationStyle: Enabled: true # Blank lines should not have any spaces. -Layout/TrailingBlankLines: +Layout/TrailingEmptyLines: Enabled: true # No trailing whitespace. @@ -131,12 +125,12 @@ Layout/TrailingWhitespace: Enabled: false # Use quotes for string literals when they are enough. -Style/UnneededPercentQ: +Style/RedundantPercentQ: Enabled: true # Align `end` with the matching keyword or starting expression except for # assignments, where it should be aligned with the LHS. -Lint/EndAlignment: +Layout/EndAlignment: Enabled: true EnforcedStyleAlignWith: variable AutoCorrect: true diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION deleted file mode 100644 index cc2ff5a..0000000 --- a/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.4.18 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..7b9ac8c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +language: ruby +cache: bundler +rvm: + - 2.3 + - 2.4 + - 2.5 +script: + - bundle install --path vendor/bundle + - bundle exec rspec + - gem build sib-api-v3-sdk.gemspec + - gem install ./sib-api-v3-sdk-1.0.0.gem diff --git a/Gemfile b/Gemfile index dc92356..c2e3127 100644 --- a/Gemfile +++ b/Gemfile @@ -3,5 +3,7 @@ source 'https://rubygems.org' gemspec group :development, :test do - gem 'rake', '>= 12.3.3' + gem 'rake', '~> 13.0.1' + gem 'pry-byebug' + gem 'rubocop', '~> 0.66.0' end diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index ea594db..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2020 SendinBlue - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/README.md b/README.md index 0671cbd..8d8dc36 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,62 @@ -# SendinBlue's API v3 Ruby Library +# sib-api-v3-sdk -SendinBlue's API exposes the entire SendinBlue features via a standardized programmatic interface. Please refer to the full [documentation](https://developers.sendinblue.com) to learn more. +SibApiV3Sdk - the Ruby gem for the SendinBlue API -This is the wrapper for the API. It implements all the features of the API v3. +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... -SendinBlue's API matches the [OpenAPI v2 definition](https://www.openapis.org/). The specification can be downloaded [here](https://api.sendinblue.com/v3/swagger_definition.yml). +You can download our wrappers at https://github.com/orgs/sendinblue -This RUBY package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project and is reviewed and maintained by 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 | -- API version: 3.0.0 -- Build package: io.swagger.codegen.languages.RubyClientCodegen +This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 3.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit [https://account.sendinblue.com/support](https://account.sendinblue.com/support) ## Installation ### Build a gem -Add this line to your application's Gemfile: -```shell -gem 'sib-api-v3-sdk' -``` +To build the Ruby code into a gem: -And then execute: ```shell -$ bundle +gem build sib-api-v3-sdk.gemspec ``` -Or install it yourself as: +Then either install the gem locally: + ```shell -$ ( sudo ) gem install sib-api-v3-sdk +gem install ./sib-api-v3-sdk-1.0.0.gem ``` +(for development, run `gem install --dev ./sib-api-v3-sdk-1.0.0.gem` to install the development dependencies) + +or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). + +Finally add this to the Gemfile: + + gem 'sib-api-v3-sdk', '~> 1.0.0' + ### Install from Git If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile: @@ -49,6 +74,7 @@ ruby -Ilib script.rb ## Getting Started Please follow the [installation](#installation) procedure and then run the following code: + ```ruby # Load the gem require 'sib-api-v3-sdk' @@ -58,12 +84,12 @@ SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::AccountApi.new @@ -214,8 +240,6 @@ Class | Method | HTTP request | Description - [SibApiV3Sdk::AbTestCampaignResult](docs/AbTestCampaignResult.md) - [SibApiV3Sdk::AbTestCampaignResultClickedLinks](docs/AbTestCampaignResultClickedLinks.md) - [SibApiV3Sdk::AbTestCampaignResultStatistics](docs/AbTestCampaignResultStatistics.md) - - [SibApiV3Sdk::AbTestVersionClicks](docs/AbTestVersionClicks.md) - - [SibApiV3Sdk::AbTestVersionClicksInner](docs/AbTestVersionClicksInner.md) - [SibApiV3Sdk::AbTestVersionStats](docs/AbTestVersionStats.md) - [SibApiV3Sdk::AddChildDomain](docs/AddChildDomain.md) - [SibApiV3Sdk::AddContactToList](docs/AddContactToList.md) @@ -248,10 +272,11 @@ Class | Method | HTTP request | Description - [SibApiV3Sdk::EmailExportRecipients](docs/EmailExportRecipients.md) - [SibApiV3Sdk::ErrorModel](docs/ErrorModel.md) - [SibApiV3Sdk::GetAccount](docs/GetAccount.md) - - [SibApiV3Sdk::GetAccountMarketingAutomation](docs/GetAccountMarketingAutomation.md) - - [SibApiV3Sdk::GetAccountPlan](docs/GetAccountPlan.md) - - [SibApiV3Sdk::GetAccountRelay](docs/GetAccountRelay.md) - - [SibApiV3Sdk::GetAccountRelayData](docs/GetAccountRelayData.md) + - [SibApiV3Sdk::GetAccountAllOf](docs/GetAccountAllOf.md) + - [SibApiV3Sdk::GetAccountAllOfMarketingAutomation](docs/GetAccountAllOfMarketingAutomation.md) + - [SibApiV3Sdk::GetAccountAllOfPlan](docs/GetAccountAllOfPlan.md) + - [SibApiV3Sdk::GetAccountAllOfRelay](docs/GetAccountAllOfRelay.md) + - [SibApiV3Sdk::GetAccountAllOfRelayData](docs/GetAccountAllOfRelayData.md) - [SibApiV3Sdk::GetAggregatedReport](docs/GetAggregatedReport.md) - [SibApiV3Sdk::GetAttributes](docs/GetAttributes.md) - [SibApiV3Sdk::GetAttributesAttributes](docs/GetAttributesAttributes.md) @@ -262,13 +287,13 @@ Class | Method | HTTP request | Description - [SibApiV3Sdk::GetCampaignStats](docs/GetCampaignStats.md) - [SibApiV3Sdk::GetChildAccountCreationStatus](docs/GetChildAccountCreationStatus.md) - [SibApiV3Sdk::GetChildDomain](docs/GetChildDomain.md) - - [SibApiV3Sdk::GetChildDomains](docs/GetChildDomains.md) - [SibApiV3Sdk::GetChildInfo](docs/GetChildInfo.md) - - [SibApiV3Sdk::GetChildInfoApiKeys](docs/GetChildInfoApiKeys.md) - - [SibApiV3Sdk::GetChildInfoApiKeysV2](docs/GetChildInfoApiKeysV2.md) - - [SibApiV3Sdk::GetChildInfoApiKeysV3](docs/GetChildInfoApiKeysV3.md) - - [SibApiV3Sdk::GetChildInfoCredits](docs/GetChildInfoCredits.md) - - [SibApiV3Sdk::GetChildInfoStatistics](docs/GetChildInfoStatistics.md) + - [SibApiV3Sdk::GetChildInfoAllOf](docs/GetChildInfoAllOf.md) + - [SibApiV3Sdk::GetChildInfoAllOfApiKeys](docs/GetChildInfoAllOfApiKeys.md) + - [SibApiV3Sdk::GetChildInfoAllOfApiKeysV2](docs/GetChildInfoAllOfApiKeysV2.md) + - [SibApiV3Sdk::GetChildInfoAllOfApiKeysV3](docs/GetChildInfoAllOfApiKeysV3.md) + - [SibApiV3Sdk::GetChildInfoAllOfCredits](docs/GetChildInfoAllOfCredits.md) + - [SibApiV3Sdk::GetChildInfoAllOfStatistics](docs/GetChildInfoAllOfStatistics.md) - [SibApiV3Sdk::GetChildrenList](docs/GetChildrenList.md) - [SibApiV3Sdk::GetClient](docs/GetClient.md) - [SibApiV3Sdk::GetContactCampaignStats](docs/GetContactCampaignStats.md) @@ -280,26 +305,30 @@ Class | Method | HTTP request | Description - [SibApiV3Sdk::GetContacts](docs/GetContacts.md) - [SibApiV3Sdk::GetDeviceBrowserStats](docs/GetDeviceBrowserStats.md) - [SibApiV3Sdk::GetEmailCampaign](docs/GetEmailCampaign.md) + - [SibApiV3Sdk::GetEmailCampaignAllOf](docs/GetEmailCampaignAllOf.md) - [SibApiV3Sdk::GetEmailCampaigns](docs/GetEmailCampaigns.md) - [SibApiV3Sdk::GetEmailEventReport](docs/GetEmailEventReport.md) - [SibApiV3Sdk::GetEmailEventReportEvents](docs/GetEmailEventReportEvents.md) - [SibApiV3Sdk::GetExtendedCampaignOverview](docs/GetExtendedCampaignOverview.md) - - [SibApiV3Sdk::GetExtendedCampaignOverviewSender](docs/GetExtendedCampaignOverviewSender.md) + - [SibApiV3Sdk::GetExtendedCampaignOverviewAllOf](docs/GetExtendedCampaignOverviewAllOf.md) + - [SibApiV3Sdk::GetExtendedCampaignOverviewAllOfSender](docs/GetExtendedCampaignOverviewAllOfSender.md) - [SibApiV3Sdk::GetExtendedCampaignStats](docs/GetExtendedCampaignStats.md) - - [SibApiV3Sdk::GetExtendedCampaignStatsGlobalStats](docs/GetExtendedCampaignStatsGlobalStats.md) - [SibApiV3Sdk::GetExtendedClient](docs/GetExtendedClient.md) - - [SibApiV3Sdk::GetExtendedClientAddress](docs/GetExtendedClientAddress.md) + - [SibApiV3Sdk::GetExtendedClientAllOf](docs/GetExtendedClientAllOf.md) + - [SibApiV3Sdk::GetExtendedClientAllOfAddress](docs/GetExtendedClientAllOfAddress.md) - [SibApiV3Sdk::GetExtendedContactDetails](docs/GetExtendedContactDetails.md) - - [SibApiV3Sdk::GetExtendedContactDetailsStatistics](docs/GetExtendedContactDetailsStatistics.md) - - [SibApiV3Sdk::GetExtendedContactDetailsStatisticsClicked](docs/GetExtendedContactDetailsStatisticsClicked.md) - - [SibApiV3Sdk::GetExtendedContactDetailsStatisticsLinks](docs/GetExtendedContactDetailsStatisticsLinks.md) - - [SibApiV3Sdk::GetExtendedContactDetailsStatisticsMessagesSent](docs/GetExtendedContactDetailsStatisticsMessagesSent.md) - - [SibApiV3Sdk::GetExtendedContactDetailsStatisticsOpened](docs/GetExtendedContactDetailsStatisticsOpened.md) - - [SibApiV3Sdk::GetExtendedContactDetailsStatisticsUnsubscriptions](docs/GetExtendedContactDetailsStatisticsUnsubscriptions.md) - - [SibApiV3Sdk::GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription](docs/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.md) - - [SibApiV3Sdk::GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription](docs/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.md) + - [SibApiV3Sdk::GetExtendedContactDetailsAllOf](docs/GetExtendedContactDetailsAllOf.md) + - [SibApiV3Sdk::GetExtendedContactDetailsAllOfStatistics](docs/GetExtendedContactDetailsAllOfStatistics.md) + - [SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsClicked](docs/GetExtendedContactDetailsAllOfStatisticsClicked.md) + - [SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsLinks](docs/GetExtendedContactDetailsAllOfStatisticsLinks.md) + - [SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsMessagesSent](docs/GetExtendedContactDetailsAllOfStatisticsMessagesSent.md) + - [SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsOpened](docs/GetExtendedContactDetailsAllOfStatisticsOpened.md) + - [SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptions](docs/GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.md) + - [SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription](docs/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.md) + - [SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription](docs/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.md) - [SibApiV3Sdk::GetExtendedList](docs/GetExtendedList.md) - - [SibApiV3Sdk::GetExtendedListCampaignStats](docs/GetExtendedListCampaignStats.md) + - [SibApiV3Sdk::GetExtendedListAllOf](docs/GetExtendedListAllOf.md) + - [SibApiV3Sdk::GetExtendedListAllOfCampaignStats](docs/GetExtendedListAllOfCampaignStats.md) - [SibApiV3Sdk::GetFolder](docs/GetFolder.md) - [SibApiV3Sdk::GetFolderLists](docs/GetFolderLists.md) - [SibApiV3Sdk::GetFolders](docs/GetFolders.md) @@ -318,8 +347,8 @@ Class | Method | HTTP request | Description - [SibApiV3Sdk::GetSendersListSenders](docs/GetSendersListSenders.md) - [SibApiV3Sdk::GetSharedTemplateUrl](docs/GetSharedTemplateUrl.md) - [SibApiV3Sdk::GetSmsCampaign](docs/GetSmsCampaign.md) + - [SibApiV3Sdk::GetSmsCampaignAllOf](docs/GetSmsCampaignAllOf.md) - [SibApiV3Sdk::GetSmsCampaignOverview](docs/GetSmsCampaignOverview.md) - - [SibApiV3Sdk::GetSmsCampaignRecipients](docs/GetSmsCampaignRecipients.md) - [SibApiV3Sdk::GetSmsCampaignStats](docs/GetSmsCampaignStats.md) - [SibApiV3Sdk::GetSmsCampaigns](docs/GetSmsCampaigns.md) - [SibApiV3Sdk::GetSmsEventReport](docs/GetSmsEventReport.md) @@ -328,9 +357,7 @@ Class | Method | HTTP request | Description - [SibApiV3Sdk::GetSmtpTemplateOverviewSender](docs/GetSmtpTemplateOverviewSender.md) - [SibApiV3Sdk::GetSmtpTemplates](docs/GetSmtpTemplates.md) - [SibApiV3Sdk::GetSsoToken](docs/GetSsoToken.md) - - [SibApiV3Sdk::GetStatsByBrowser](docs/GetStatsByBrowser.md) - [SibApiV3Sdk::GetStatsByDevice](docs/GetStatsByDevice.md) - - [SibApiV3Sdk::GetStatsByDomain](docs/GetStatsByDomain.md) - [SibApiV3Sdk::GetTransacAggregatedSmsReport](docs/GetTransacAggregatedSmsReport.md) - [SibApiV3Sdk::GetTransacBlockedContacts](docs/GetTransacBlockedContacts.md) - [SibApiV3Sdk::GetTransacBlockedContactsContacts](docs/GetTransacBlockedContactsContacts.md) @@ -401,26 +428,15 @@ Class | Method | HTTP request | Description ### api-key + - **Type**: API key - **API key parameter name**: api-key - **Location**: HTTP header ### partner-key + - **Type**: API key - **API key parameter name**: partner-key - **Location**: HTTP header - -## Support and Feedback - -Be sure to visit the SendinBlue official [documentation website](https://sendinblue.readme.io/docs ) for additional information about our API. - -If you find a bug, please post the issue on [Github](https://github.com/sendinblue/APIv3-ruby-library/issues). - -As always, if you need additional assistance, drop us a note [here](https://account.sendinblue.com/support). - -## Recommendation - -Please follow camelCase convention for variables in the API's. For example, use customVariable instead of custom_variable. - diff --git a/Rakefile b/Rakefile index d52c3e3..c72ca30 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +require "bundler/gem_tasks" + begin require 'rspec/core/rake_task' diff --git a/docs/AbTestCampaignResult.md b/docs/AbTestCampaignResult.md index 0d0bb7d..eab03b0 100644 --- a/docs/AbTestCampaignResult.md +++ b/docs/AbTestCampaignResult.md @@ -1,15 +1,32 @@ # SibApiV3Sdk::AbTestCampaignResult ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**winning_version** | **String** | Winning Campaign Info. pending = Campaign has been picked for sending and winning version is yet to be decided, tie = A tie happened between both the versions, notAvailable = Campaign has not yet been picked for sending. | [optional] -**winning_criteria** | **String** | Criteria choosen for winning version (Open/Click) | [optional] -**winning_subject_line** | **String** | Subject Line of current winning version | [optional] -**open_rate** | **String** | Open rate for current winning version | [optional] -**click_rate** | **String** | Click rate for current winning version | [optional] -**winning_version_rate** | **String** | Open/Click rate for the winner version | [optional] -**statistics** | [**AbTestCampaignResultStatistics**](AbTestCampaignResultStatistics.md) | | [optional] -**clicked_links** | [**AbTestCampaignResultClickedLinks**](AbTestCampaignResultClickedLinks.md) | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **winning_version** | **String** | Winning Campaign Info. pending = Campaign has been picked for sending and winning version is yet to be decided, tie = A tie happened between both the versions, notAvailable = Campaign has not yet been picked for sending. | [optional] | +| **winning_criteria** | **String** | Criteria choosen for winning version (Open/Click) | [optional] | +| **winning_subject_line** | **String** | Subject Line of current winning version | [optional] | +| **open_rate** | **String** | Open rate for current winning version | [optional] | +| **click_rate** | **String** | Click rate for current winning version | [optional] | +| **winning_version_rate** | **String** | Open/Click rate for the winner version | [optional] | +| **statistics** | [**AbTestCampaignResultStatistics**](AbTestCampaignResultStatistics.md) | | [optional] | +| **clicked_links** | [**AbTestCampaignResultClickedLinks**](AbTestCampaignResultClickedLinks.md) | | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::AbTestCampaignResult.new( + winning_version: A, + winning_criteria: Open, + winning_subject_line: Subject Line A, + open_rate: 70%, + click_rate: 70%, + winning_version_rate: 70%, + statistics: null, + clicked_links: null +) +``` diff --git a/docs/AbTestCampaignResultClickedLinks.md b/docs/AbTestCampaignResultClickedLinks.md index c48b163..da13213 100644 --- a/docs/AbTestCampaignResultClickedLinks.md +++ b/docs/AbTestCampaignResultClickedLinks.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::AbTestCampaignResultClickedLinks ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**version_a** | [**AbTestVersionClicks**](AbTestVersionClicks.md) | | -**version_b** | [**AbTestVersionClicks**](AbTestVersionClicks.md) | | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **version_a** | **Array<Object>** | Information on clicked links for a particular version | | +| **version_b** | **Array<Object>** | Information on clicked links for a particular version | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::AbTestCampaignResultClickedLinks.new( + version_a: null, + version_b: null +) +``` diff --git a/docs/AbTestCampaignResultStatistics.md b/docs/AbTestCampaignResultStatistics.md index f3648b0..784f7db 100644 --- a/docs/AbTestCampaignResultStatistics.md +++ b/docs/AbTestCampaignResultStatistics.md @@ -1,13 +1,28 @@ # SibApiV3Sdk::AbTestCampaignResultStatistics ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**openers** | [**AbTestVersionStats**](AbTestVersionStats.md) | | -**clicks** | [**AbTestVersionStats**](AbTestVersionStats.md) | | -**unsubscribed** | [**AbTestVersionStats**](AbTestVersionStats.md) | | -**hard_bounces** | [**AbTestVersionStats**](AbTestVersionStats.md) | | -**soft_bounces** | [**AbTestVersionStats**](AbTestVersionStats.md) | | -**complaints** | [**AbTestVersionStats**](AbTestVersionStats.md) | | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **openers** | [**AbTestVersionStats**](AbTestVersionStats.md) | | | +| **clicks** | [**AbTestVersionStats**](AbTestVersionStats.md) | | | +| **unsubscribed** | [**AbTestVersionStats**](AbTestVersionStats.md) | | | +| **hard_bounces** | [**AbTestVersionStats**](AbTestVersionStats.md) | | | +| **soft_bounces** | [**AbTestVersionStats**](AbTestVersionStats.md) | | | +| **complaints** | [**AbTestVersionStats**](AbTestVersionStats.md) | | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::AbTestCampaignResultStatistics.new( + openers: null, + clicks: null, + unsubscribed: null, + hard_bounces: null, + soft_bounces: null, + complaints: null +) +``` diff --git a/docs/AbTestVersionClicks.md b/docs/AbTestVersionClicks.md deleted file mode 100644 index 1e8e4a6..0000000 --- a/docs/AbTestVersionClicks.md +++ /dev/null @@ -1,7 +0,0 @@ -# SibApiV3Sdk::AbTestVersionClicks - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - diff --git a/docs/AbTestVersionClicksInner.md b/docs/AbTestVersionClicksInner.md deleted file mode 100644 index 0fb222b..0000000 --- a/docs/AbTestVersionClicksInner.md +++ /dev/null @@ -1,10 +0,0 @@ -# SibApiV3Sdk::AbTestVersionClicksInner - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**link** | **String** | URL of the link | -**clicks_count** | **Float** | Number of times a link is clicked | -**click_rate** | **String** | Percentage of clicks of link with respect to total clicks | - - diff --git a/docs/AbTestVersionStats.md b/docs/AbTestVersionStats.md index f9aed6f..2f0c748 100644 --- a/docs/AbTestVersionStats.md +++ b/docs/AbTestVersionStats.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::AbTestVersionStats ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**version_a** | **String** | percentage of an event for version A | -**version_b** | **String** | percentage of an event for version B | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **version_a** | **String** | percentage of an event for version A | | +| **version_b** | **String** | percentage of an event for version B | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::AbTestVersionStats.new( + version_a: 50%, + version_b: 50% +) +``` diff --git a/docs/AccountApi.md b/docs/AccountApi.md index 4352ea4..946987a 100644 --- a/docs/AccountApi.md +++ b/docs/AccountApi.md @@ -2,45 +2,66 @@ All URIs are relative to *https://api.sendinblue.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_account**](AccountApi.md#get_account) | **GET** /account | Get your account information, plan and credits details +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**get_account**](AccountApi.md#get_account) | **GET** /account | Get your account information, plan and credits details | -# **get_account** -> GetAccount get_account +## get_account + +> get_account Get your account information, plan and credits details -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::AccountApi.new begin - #Get your account information, plan and credits details + # Get your account information, plan and credits details result = api_instance.get_account p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling AccountApi->get_account: #{e}" + puts "Error when calling AccountApi->get_account: #{e}" +end +``` + +#### Using the get_account_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_account_with_http_info + +```ruby +begin + # Get your account information, plan and credits details + data, status_code, headers = api_instance.get_account_with_http_info + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling AccountApi->get_account_with_http_info: #{e}" end ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -53,8 +74,6 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - - +- **Content-Type**: Not defined +- **Accept**: application/json diff --git a/docs/AddChildDomain.md b/docs/AddChildDomain.md index def017c..97214f5 100644 --- a/docs/AddChildDomain.md +++ b/docs/AddChildDomain.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::AddChildDomain ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**domain** | **String** | Sender domain to add for a specific child account | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **domain** | **String** | Sender domain to add for a specific child account | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::AddChildDomain.new( + domain: mychilddomain.com +) +``` diff --git a/docs/AddContactToList.md b/docs/AddContactToList.md index 234151e..41f26d3 100644 --- a/docs/AddContactToList.md +++ b/docs/AddContactToList.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::AddContactToList ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**emails** | **Array<String>** | Mandatory if IDs are not passed, ignored otherwise. 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. | [optional] -**ids** | **Array<Integer>** | Mandatory if Emails are not passed, ignored otherwise. 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. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **emails** | **Array<String>** | Mandatory if IDs are not passed, ignored otherwise. 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. | [optional] | +| **ids** | **Array<Integer>** | Mandatory if Emails are not passed, ignored otherwise. 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. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::AddContactToList.new( + emails: null, + ids: null +) +``` diff --git a/docs/AddCredits.md b/docs/AddCredits.md index 9e08ab1..b89d89c 100644 --- a/docs/AddCredits.md +++ b/docs/AddCredits.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::AddCredits ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sms** | **Integer** | Required if email credits are empty. SMS credits to be added to the child account | [optional] -**email** | **Integer** | Required if sms credits are empty. Email credits to be added to the child account | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **sms** | **Integer** | Required if email credits are empty. SMS credits to be added to the child account | [optional] | +| **email** | **Integer** | Required if sms credits are empty. Email credits to be added to the child account | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::AddCredits.new( + sms: 450, + email: 1200 +) +``` diff --git a/docs/AttributesApi.md b/docs/AttributesApi.md index ee475a6..9b2c783 100644 --- a/docs/AttributesApi.md +++ b/docs/AttributesApi.md @@ -2,60 +2,76 @@ All URIs are relative to *https://api.sendinblue.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_attribute**](AttributesApi.md#create_attribute) | **POST** /contacts/attributes/{attributeCategory}/{attributeName} | Create contact attribute -[**delete_attribute**](AttributesApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Delete an attribute -[**get_attributes**](AttributesApi.md#get_attributes) | **GET** /contacts/attributes | List all attributes -[**update_attribute**](AttributesApi.md#update_attribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Update contact attribute +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**create_attribute**](AttributesApi.md#create_attribute) | **POST** /contacts/attributes/{attributeCategory}/{attributeName} | Create contact attribute | +| [**delete_attribute**](AttributesApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Delete an attribute | +| [**get_attributes**](AttributesApi.md#get_attributes) | **GET** /contacts/attributes | List all attributes | +| [**update_attribute**](AttributesApi.md#update_attribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Update contact attribute | -# **create_attribute** +## create_attribute + > create_attribute(attribute_category, attribute_name, create_attribute) Create contact attribute -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::AttributesApi.new +attribute_category = 'normal' # String | Category of the attribute +attribute_name = 'attribute_name_example' # String | Name of the attribute +create_attribute = SibApiV3Sdk::CreateAttribute.new # CreateAttribute | Values to create an attribute -attribute_category = 'attribute_category_example' # String | Category of the attribute +begin + # Create contact attribute + api_instance.create_attribute(attribute_category, attribute_name, create_attribute) +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling AttributesApi->create_attribute: #{e}" +end +``` -attribute_name = 'attribute_name_example' # String | Name of the attribute +#### Using the create_attribute_with_http_info variant -create_attribute = SibApiV3Sdk::CreateAttribute.new # CreateAttribute | Values to create an attribute +This returns an Array which contains the response data (`nil` in this case), status code and headers. +> create_attribute_with_http_info(attribute_category, attribute_name, create_attribute) +```ruby begin - #Create contact attribute - api_instance.create_attribute(attribute_category, attribute_name, create_attribute) + # Create contact attribute + data, status_code, headers = api_instance.create_attribute_with_http_info(attribute_category, attribute_name, create_attribute) + p status_code # => 2xx + p headers # => { ... } + p data # => nil rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling AttributesApi->create_attribute: #{e}" + puts "Error when calling AttributesApi->create_attribute_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **attribute_category** | **String**| Category of the attribute | - **attribute_name** | **String**| Name of the attribute | - **create_attribute** | [**CreateAttribute**](CreateAttribute.md)| Values to create an attribute | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **attribute_category** | **String** | Category of the attribute | | +| **attribute_name** | **String** | Name of the attribute | | +| **create_attribute** | [**CreateAttribute**](CreateAttribute.md) | Values to create an attribute | | ### Return type @@ -67,54 +83,70 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## delete_attribute -# **delete_attribute** > delete_attribute(attribute_category, attribute_name) Delete an attribute -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::AttributesApi.new +attribute_category = 'normal' # String | Category of the attribute +attribute_name = 'attribute_name_example' # String | Name of the existing attribute + +begin + # Delete an attribute + api_instance.delete_attribute(attribute_category, attribute_name) +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling AttributesApi->delete_attribute: #{e}" +end +``` -attribute_category = 'attribute_category_example' # String | Category of the attribute +#### Using the delete_attribute_with_http_info variant -attribute_name = 'attribute_name_example' # String | Name of the existing attribute +This returns an Array which contains the response data (`nil` in this case), status code and headers. +> delete_attribute_with_http_info(attribute_category, attribute_name) +```ruby begin - #Delete an attribute - api_instance.delete_attribute(attribute_category, attribute_name) + # Delete an attribute + data, status_code, headers = api_instance.delete_attribute_with_http_info(attribute_category, attribute_name) + p status_code # => 2xx + p headers # => { ... } + p data # => nil rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling AttributesApi->delete_attribute: #{e}" + puts "Error when calling AttributesApi->delete_attribute_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **attribute_category** | **String**| Category of the attribute | - **attribute_name** | **String**| Name of the existing attribute | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **attribute_category** | **String** | Category of the attribute | | +| **attribute_name** | **String** | Name of the existing attribute | | ### Return type @@ -126,45 +158,65 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_attributes -# **get_attributes** -> GetAttributes get_attributes +> get_attributes List all attributes -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::AttributesApi.new begin - #List all attributes + # List all attributes result = api_instance.get_attributes p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling AttributesApi->get_attributes: #{e}" + puts "Error when calling AttributesApi->get_attributes: #{e}" +end +``` + +#### Using the get_attributes_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_attributes_with_http_info + +```ruby +begin + # List all attributes + data, status_code, headers = api_instance.get_attributes_with_http_info + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling AttributesApi->get_attributes_with_http_info: #{e}" end ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -177,57 +229,72 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## update_attribute -# **update_attribute** > update_attribute(attribute_category, attribute_name, update_attribute) Update contact attribute -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::AttributesApi.new +attribute_category = 'category' # String | Category of the attribute +attribute_name = 'attribute_name_example' # String | Name of the existing attribute +update_attribute = SibApiV3Sdk::UpdateAttribute.new # UpdateAttribute | Values to update an attribute -attribute_category = 'attribute_category_example' # String | Category of the attribute +begin + # Update contact attribute + api_instance.update_attribute(attribute_category, attribute_name, update_attribute) +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling AttributesApi->update_attribute: #{e}" +end +``` -attribute_name = 'attribute_name_example' # String | Name of the existing attribute +#### Using the update_attribute_with_http_info variant -update_attribute = SibApiV3Sdk::UpdateAttribute.new # UpdateAttribute | Values to update an attribute +This returns an Array which contains the response data (`nil` in this case), status code and headers. +> update_attribute_with_http_info(attribute_category, attribute_name, update_attribute) +```ruby begin - #Update contact attribute - api_instance.update_attribute(attribute_category, attribute_name, update_attribute) + # Update contact attribute + data, status_code, headers = api_instance.update_attribute_with_http_info(attribute_category, attribute_name, update_attribute) + p status_code # => 2xx + p headers # => { ... } + p data # => nil rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling AttributesApi->update_attribute: #{e}" + puts "Error when calling AttributesApi->update_attribute_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **attribute_category** | **String**| Category of the attribute | - **attribute_name** | **String**| Name of the existing attribute | - **update_attribute** | [**UpdateAttribute**](UpdateAttribute.md)| Values to update an attribute | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **attribute_category** | **String** | Category of the attribute | | +| **attribute_name** | **String** | Name of the existing attribute | | +| **update_attribute** | [**UpdateAttribute**](UpdateAttribute.md) | Values to update an attribute | | ### Return type @@ -239,8 +306,6 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - - +- **Content-Type**: application/json +- **Accept**: application/json diff --git a/docs/BlockDomain.md b/docs/BlockDomain.md index eb731f9..0102c89 100644 --- a/docs/BlockDomain.md +++ b/docs/BlockDomain.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::BlockDomain ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**domain** | **String** | name of the domain to be blocked | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **domain** | **String** | name of the domain to be blocked | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::BlockDomain.new( + domain: example.com +) +``` diff --git a/docs/ContactsApi.md b/docs/ContactsApi.md index ea497da..65b7c87 100644 --- a/docs/ContactsApi.md +++ b/docs/ContactsApi.md @@ -2,81 +2,98 @@ All URIs are relative to *https://api.sendinblue.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_contact_to_list**](ContactsApi.md#add_contact_to_list) | **POST** /contacts/lists/{listId}/contacts/add | Add existing contacts to a list -[**create_attribute**](ContactsApi.md#create_attribute) | **POST** /contacts/attributes/{attributeCategory}/{attributeName} | Create contact attribute -[**create_contact**](ContactsApi.md#create_contact) | **POST** /contacts | Create a contact -[**create_doi_contact**](ContactsApi.md#create_doi_contact) | **POST** /contacts/doubleOptinConfirmation | Create Contact via DOI (Double-Opt-In) Flow -[**create_folder**](ContactsApi.md#create_folder) | **POST** /contacts/folders | Create a folder -[**create_list**](ContactsApi.md#create_list) | **POST** /contacts/lists | Create a list -[**delete_attribute**](ContactsApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Delete an attribute -[**delete_contact**](ContactsApi.md#delete_contact) | **DELETE** /contacts/{identifier} | Delete a contact -[**delete_folder**](ContactsApi.md#delete_folder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists) -[**delete_list**](ContactsApi.md#delete_list) | **DELETE** /contacts/lists/{listId} | Delete a list -[**get_attributes**](ContactsApi.md#get_attributes) | **GET** /contacts/attributes | List all attributes -[**get_contact_info**](ContactsApi.md#get_contact_info) | **GET** /contacts/{identifier} | Get a contact's details -[**get_contact_stats**](ContactsApi.md#get_contact_stats) | **GET** /contacts/{identifier}/campaignStats | Get email campaigns' statistics for a contact -[**get_contacts**](ContactsApi.md#get_contacts) | **GET** /contacts | Get all the contacts -[**get_contacts_from_list**](ContactsApi.md#get_contacts_from_list) | **GET** /contacts/lists/{listId}/contacts | Get contacts in a list -[**get_folder**](ContactsApi.md#get_folder) | **GET** /contacts/folders/{folderId} | Returns a folder's details -[**get_folder_lists**](ContactsApi.md#get_folder_lists) | **GET** /contacts/folders/{folderId}/lists | Get lists in a folder -[**get_folders**](ContactsApi.md#get_folders) | **GET** /contacts/folders | Get all folders -[**get_list**](ContactsApi.md#get_list) | **GET** /contacts/lists/{listId} | Get a list's details -[**get_lists**](ContactsApi.md#get_lists) | **GET** /contacts/lists | Get all the lists -[**import_contacts**](ContactsApi.md#import_contacts) | **POST** /contacts/import | Import contacts -[**remove_contact_from_list**](ContactsApi.md#remove_contact_from_list) | **POST** /contacts/lists/{listId}/contacts/remove | Delete a contact from a list -[**request_contact_export**](ContactsApi.md#request_contact_export) | **POST** /contacts/export | Export contacts -[**update_attribute**](ContactsApi.md#update_attribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Update contact attribute -[**update_contact**](ContactsApi.md#update_contact) | **PUT** /contacts/{identifier} | Update a contact -[**update_folder**](ContactsApi.md#update_folder) | **PUT** /contacts/folders/{folderId} | Update a folder -[**update_list**](ContactsApi.md#update_list) | **PUT** /contacts/lists/{listId} | Update a list - - -# **add_contact_to_list** -> PostContactInfo add_contact_to_list(list_id, contact_emails) +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**add_contact_to_list**](ContactsApi.md#add_contact_to_list) | **POST** /contacts/lists/{listId}/contacts/add | Add existing contacts to a list | +| [**create_attribute**](ContactsApi.md#create_attribute) | **POST** /contacts/attributes/{attributeCategory}/{attributeName} | Create contact attribute | +| [**create_contact**](ContactsApi.md#create_contact) | **POST** /contacts | Create a contact | +| [**create_doi_contact**](ContactsApi.md#create_doi_contact) | **POST** /contacts/doubleOptinConfirmation | Create Contact via DOI (Double-Opt-In) Flow | +| [**create_folder**](ContactsApi.md#create_folder) | **POST** /contacts/folders | Create a folder | +| [**create_list**](ContactsApi.md#create_list) | **POST** /contacts/lists | Create a list | +| [**delete_attribute**](ContactsApi.md#delete_attribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Delete an attribute | +| [**delete_contact**](ContactsApi.md#delete_contact) | **DELETE** /contacts/{identifier} | Delete a contact | +| [**delete_folder**](ContactsApi.md#delete_folder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists) | +| [**delete_list**](ContactsApi.md#delete_list) | **DELETE** /contacts/lists/{listId} | Delete a list | +| [**get_attributes**](ContactsApi.md#get_attributes) | **GET** /contacts/attributes | List all attributes | +| [**get_contact_info**](ContactsApi.md#get_contact_info) | **GET** /contacts/{identifier} | Get a contact's details | +| [**get_contact_stats**](ContactsApi.md#get_contact_stats) | **GET** /contacts/{identifier}/campaignStats | Get email campaigns' statistics for a contact | +| [**get_contacts**](ContactsApi.md#get_contacts) | **GET** /contacts | Get all the contacts | +| [**get_contacts_from_list**](ContactsApi.md#get_contacts_from_list) | **GET** /contacts/lists/{listId}/contacts | Get contacts in a list | +| [**get_folder**](ContactsApi.md#get_folder) | **GET** /contacts/folders/{folderId} | Returns a folder's details | +| [**get_folder_lists**](ContactsApi.md#get_folder_lists) | **GET** /contacts/folders/{folderId}/lists | Get lists in a folder | +| [**get_folders**](ContactsApi.md#get_folders) | **GET** /contacts/folders | Get all folders | +| [**get_list**](ContactsApi.md#get_list) | **GET** /contacts/lists/{listId} | Get a list's details | +| [**get_lists**](ContactsApi.md#get_lists) | **GET** /contacts/lists | Get all the lists | +| [**import_contacts**](ContactsApi.md#import_contacts) | **POST** /contacts/import | Import contacts | +| [**remove_contact_from_list**](ContactsApi.md#remove_contact_from_list) | **POST** /contacts/lists/{listId}/contacts/remove | Delete a contact from a list | +| [**request_contact_export**](ContactsApi.md#request_contact_export) | **POST** /contacts/export | Export contacts | +| [**update_attribute**](ContactsApi.md#update_attribute) | **PUT** /contacts/attributes/{attributeCategory}/{attributeName} | Update contact attribute | +| [**update_contact**](ContactsApi.md#update_contact) | **PUT** /contacts/{identifier} | Update a contact | +| [**update_folder**](ContactsApi.md#update_folder) | **PUT** /contacts/folders/{folderId} | Update a folder | +| [**update_list**](ContactsApi.md#update_list) | **PUT** /contacts/lists/{listId} | Update a list | + + +## add_contact_to_list + +> add_contact_to_list(list_id, contact_emails) Add existing contacts to a list -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - list_id = 789 # Integer | Id of the list - contact_emails = SibApiV3Sdk::AddContactToList.new # AddContactToList | Emails addresses OR IDs of the contacts - begin - #Add existing contacts to a list + # Add existing contacts to a list result = api_instance.add_contact_to_list(list_id, contact_emails) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->add_contact_to_list: #{e}" + puts "Error when calling ContactsApi->add_contact_to_list: #{e}" +end +``` + +#### Using the add_contact_to_list_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> add_contact_to_list_with_http_info(list_id, contact_emails) + +```ruby +begin + # Add existing contacts to a list + data, status_code, headers = api_instance.add_contact_to_list_with_http_info(list_id, contact_emails) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->add_contact_to_list_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **Integer**| Id of the list | - **contact_emails** | [**AddContactToList**](AddContactToList.md)| Emails addresses OR IDs of the contacts | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **list_id** | **Integer** | Id of the list | | +| **contact_emails** | [**AddContactToList**](AddContactToList.md) | Emails addresses OR IDs of the contacts | | ### Return type @@ -88,57 +105,72 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## create_attribute -# **create_attribute** > create_attribute(attribute_category, attribute_name, create_attribute) Create contact attribute -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new +attribute_category = 'normal' # String | Category of the attribute +attribute_name = 'attribute_name_example' # String | Name of the attribute +create_attribute = SibApiV3Sdk::CreateAttribute.new # CreateAttribute | Values to create an attribute -attribute_category = 'attribute_category_example' # String | Category of the attribute +begin + # Create contact attribute + api_instance.create_attribute(attribute_category, attribute_name, create_attribute) +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->create_attribute: #{e}" +end +``` -attribute_name = 'attribute_name_example' # String | Name of the attribute +#### Using the create_attribute_with_http_info variant -create_attribute = SibApiV3Sdk::CreateAttribute.new # CreateAttribute | Values to create an attribute +This returns an Array which contains the response data (`nil` in this case), status code and headers. +> create_attribute_with_http_info(attribute_category, attribute_name, create_attribute) +```ruby begin - #Create contact attribute - api_instance.create_attribute(attribute_category, attribute_name, create_attribute) + # Create contact attribute + data, status_code, headers = api_instance.create_attribute_with_http_info(attribute_category, attribute_name, create_attribute) + p status_code # => 2xx + p headers # => { ... } + p data # => nil rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->create_attribute: #{e}" + puts "Error when calling ContactsApi->create_attribute_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **attribute_category** | **String**| Category of the attribute | - **attribute_name** | **String**| Name of the attribute | - **create_attribute** | [**CreateAttribute**](CreateAttribute.md)| Values to create an attribute | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **attribute_category** | **String** | Category of the attribute | | +| **attribute_name** | **String** | Name of the attribute | | +| **create_attribute** | [**CreateAttribute**](CreateAttribute.md) | Values to create an attribute | | ### Return type @@ -150,52 +182,69 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## create_contact -# **create_contact** -> CreateUpdateContactModel create_contact(create_contact) +> create_contact(create_contact) Create a contact -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - create_contact = SibApiV3Sdk::CreateContact.new # CreateContact | Values to create a contact - begin - #Create a contact + # Create a contact result = api_instance.create_contact(create_contact) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->create_contact: #{e}" + puts "Error when calling ContactsApi->create_contact: #{e}" +end +``` + +#### Using the create_contact_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_contact_with_http_info(create_contact) + +```ruby +begin + # Create a contact + data, status_code, headers = api_instance.create_contact_with_http_info(create_contact) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->create_contact_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **create_contact** | [**CreateContact**](CreateContact.md)| Values to create a contact | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **create_contact** | [**CreateContact**](CreateContact.md) | Values to create a contact | | ### Return type @@ -207,51 +256,68 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## create_doi_contact -# **create_doi_contact** > create_doi_contact(create_doi_contact) Create Contact via DOI (Double-Opt-In) Flow -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new +create_doi_contact = SibApiV3Sdk::CreateDoiContact.new({email: 'elly@example.com', include_list_ids: [36], template_id: 2, redirection_url: 'http://requestb.in/173lyyx1'}) # CreateDoiContact | Values to create the Double opt-in (DOI) contact + +begin + # Create Contact via DOI (Double-Opt-In) Flow + api_instance.create_doi_contact(create_doi_contact) +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->create_doi_contact: #{e}" +end +``` -create_doi_contact = SibApiV3Sdk::CreateDoiContact.new # CreateDoiContact | Values to create the Double opt-in (DOI) contact +#### Using the create_doi_contact_with_http_info variant +This returns an Array which contains the response data (`nil` in this case), status code and headers. +> create_doi_contact_with_http_info(create_doi_contact) + +```ruby begin - #Create Contact via DOI (Double-Opt-In) Flow - api_instance.create_doi_contact(create_doi_contact) + # Create Contact via DOI (Double-Opt-In) Flow + data, status_code, headers = api_instance.create_doi_contact_with_http_info(create_doi_contact) + p status_code # => 2xx + p headers # => { ... } + p data # => nil rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->create_doi_contact: #{e}" + puts "Error when calling ContactsApi->create_doi_contact_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **create_doi_contact** | [**CreateDoiContact**](CreateDoiContact.md)| Values to create the Double opt-in (DOI) contact | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **create_doi_contact** | [**CreateDoiContact**](CreateDoiContact.md) | Values to create the Double opt-in (DOI) contact | | ### Return type @@ -263,52 +329,69 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## create_folder -# **create_folder** -> CreateModel create_folder(create_folder) +> create_folder(create_folder) Create a folder -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - create_folder = SibApiV3Sdk::CreateUpdateFolder.new # CreateUpdateFolder | Name of the folder - begin - #Create a folder + # Create a folder result = api_instance.create_folder(create_folder) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->create_folder: #{e}" + puts "Error when calling ContactsApi->create_folder: #{e}" +end +``` + +#### Using the create_folder_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_folder_with_http_info(create_folder) + +```ruby +begin + # Create a folder + data, status_code, headers = api_instance.create_folder_with_http_info(create_folder) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->create_folder_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **create_folder** | [**CreateUpdateFolder**](CreateUpdateFolder.md)| Name of the folder | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **create_folder** | [**CreateUpdateFolder**](CreateUpdateFolder.md) | Name of the folder | | ### Return type @@ -320,52 +403,69 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## create_list -# **create_list** -> CreateModel create_list(create_list) +> create_list(create_list) Create a list -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - -create_list = SibApiV3Sdk::CreateList.new # CreateList | Values to create a list - +create_list = SibApiV3Sdk::CreateList.new({name: 'Magento Customer - ES', folder_id: 2}) # CreateList | Values to create a list begin - #Create a list + # Create a list result = api_instance.create_list(create_list) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->create_list: #{e}" + puts "Error when calling ContactsApi->create_list: #{e}" +end +``` + +#### Using the create_list_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_list_with_http_info(create_list) + +```ruby +begin + # Create a list + data, status_code, headers = api_instance.create_list_with_http_info(create_list) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->create_list_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **create_list** | [**CreateList**](CreateList.md)| Values to create a list | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **create_list** | [**CreateList**](CreateList.md) | Values to create a list | | ### Return type @@ -377,54 +477,70 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## delete_attribute -# **delete_attribute** > delete_attribute(attribute_category, attribute_name) Delete an attribute -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new +attribute_category = 'normal' # String | Category of the attribute +attribute_name = 'attribute_name_example' # String | Name of the existing attribute + +begin + # Delete an attribute + api_instance.delete_attribute(attribute_category, attribute_name) +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->delete_attribute: #{e}" +end +``` -attribute_category = 'attribute_category_example' # String | Category of the attribute +#### Using the delete_attribute_with_http_info variant -attribute_name = 'attribute_name_example' # String | Name of the existing attribute +This returns an Array which contains the response data (`nil` in this case), status code and headers. +> delete_attribute_with_http_info(attribute_category, attribute_name) +```ruby begin - #Delete an attribute - api_instance.delete_attribute(attribute_category, attribute_name) + # Delete an attribute + data, status_code, headers = api_instance.delete_attribute_with_http_info(attribute_category, attribute_name) + p status_code # => 2xx + p headers # => { ... } + p data # => nil rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->delete_attribute: #{e}" + puts "Error when calling ContactsApi->delete_attribute_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **attribute_category** | **String**| Category of the attribute | - **attribute_name** | **String**| Name of the existing attribute | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **attribute_category** | **String** | Category of the attribute | | +| **attribute_name** | **String** | Name of the existing attribute | | ### Return type @@ -436,51 +552,68 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## delete_contact -# **delete_contact** > delete_contact(identifier) Delete a contact -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - identifier = 'identifier_example' # String | Email (urlencoded) OR ID of the contact - begin - #Delete a contact + # Delete a contact api_instance.delete_contact(identifier) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->delete_contact: #{e}" + puts "Error when calling ContactsApi->delete_contact: #{e}" +end +``` + +#### Using the delete_contact_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_contact_with_http_info(identifier) + +```ruby +begin + # Delete a contact + data, status_code, headers = api_instance.delete_contact_with_http_info(identifier) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->delete_contact_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **identifier** | **String**| Email (urlencoded) OR ID of the contact | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **identifier** | **String** | Email (urlencoded) OR ID of the contact | | ### Return type @@ -492,51 +625,68 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## delete_folder -# **delete_folder** > delete_folder(folder_id) Delete a folder (and all its lists) -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - folder_id = 789 # Integer | Id of the folder - begin - #Delete a folder (and all its lists) + # Delete a folder (and all its lists) api_instance.delete_folder(folder_id) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->delete_folder: #{e}" + puts "Error when calling ContactsApi->delete_folder: #{e}" +end +``` + +#### Using the delete_folder_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_folder_with_http_info(folder_id) + +```ruby +begin + # Delete a folder (and all its lists) + data, status_code, headers = api_instance.delete_folder_with_http_info(folder_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->delete_folder_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **folder_id** | **Integer**| Id of the folder | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **folder_id** | **Integer** | Id of the folder | | ### Return type @@ -548,51 +698,68 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## delete_list -# **delete_list** > delete_list(list_id) Delete a list -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - list_id = 789 # Integer | Id of the list - begin - #Delete a list + # Delete a list api_instance.delete_list(list_id) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->delete_list: #{e}" + puts "Error when calling ContactsApi->delete_list: #{e}" +end +``` + +#### Using the delete_list_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_list_with_http_info(list_id) + +```ruby +begin + # Delete a list + data, status_code, headers = api_instance.delete_list_with_http_info(list_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->delete_list_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **Integer**| Id of the list | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **list_id** | **Integer** | Id of the list | | ### Return type @@ -604,45 +771,65 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_attributes -# **get_attributes** -> GetAttributes get_attributes +> get_attributes List all attributes -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new begin - #List all attributes + # List all attributes result = api_instance.get_attributes p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->get_attributes: #{e}" + puts "Error when calling ContactsApi->get_attributes: #{e}" +end +``` + +#### Using the get_attributes_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_attributes_with_http_info + +```ruby +begin + # List all attributes + data, status_code, headers = api_instance.get_attributes_with_http_info + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->get_attributes_with_http_info: #{e}" end ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -655,52 +842,69 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_contact_info -# **get_contact_info** -> GetExtendedContactDetails get_contact_info(identifier) +> get_contact_info(identifier) Get a contact's details -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - identifier = 'identifier_example' # String | Email (urlencoded) OR ID of the contact OR its SMS attribute value - begin - #Get a contact's details + # Get a contact's details result = api_instance.get_contact_info(identifier) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->get_contact_info: #{e}" + puts "Error when calling ContactsApi->get_contact_info: #{e}" +end +``` + +#### Using the get_contact_info_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_contact_info_with_http_info(identifier) + +```ruby +begin + # Get a contact's details + data, status_code, headers = api_instance.get_contact_info_with_http_info(identifier) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->get_contact_info_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **identifier** | **String**| Email (urlencoded) OR ID of the contact OR its SMS attribute value | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **identifier** | **String** | Email (urlencoded) OR ID of the contact OR its SMS attribute value | | ### Return type @@ -712,58 +916,75 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_contact_stats -# **get_contact_stats** -> GetContactCampaignStats get_contact_stats(identifier, opts) +> get_contact_stats(identifier, opts) Get email campaigns' statistics for a contact -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - identifier = 'identifier_example' # String | Email (urlencoded) OR ID of the contact - -opts = { - start_date: Date.parse('2013-10-20'), # Date | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate - end_date: Date.parse('2013-10-20') # Date | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate +opts = { + start_date: 'start_date_example', # String | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate + end_date: 'end_date_example' # String | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate } begin - #Get email campaigns' statistics for a contact + # Get email campaigns' statistics for a contact result = api_instance.get_contact_stats(identifier, opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->get_contact_stats: #{e}" + puts "Error when calling ContactsApi->get_contact_stats: #{e}" +end +``` + +#### Using the get_contact_stats_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_contact_stats_with_http_info(identifier, opts) + +```ruby +begin + # Get email campaigns' statistics for a contact + data, status_code, headers = api_instance.get_contact_stats_with_http_info(identifier, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->get_contact_stats_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **identifier** | **String**| Email (urlencoded) OR ID of the contact | - **start_date** | **Date**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate | [optional] - **end_date** | **Date**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **identifier** | **String** | Email (urlencoded) OR ID of the contact | | +| **start_date** | **String** | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate | [optional] | +| **end_date** | **String** | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate | [optional] | ### Return type @@ -775,59 +996,77 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_contacts -# **get_contacts** -> GetContacts get_contacts(opts) +> get_contacts(opts) Get all the contacts -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - -opts = { - limit: 50, # Integer | Number of documents per page - offset: 0, # Integer | Index of the first document of the page +opts = { + limit: 789, # Integer | Number of documents per page + offset: 789, # Integer | Index of the first document of the page modified_since: 'modified_since_example', # String | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Get all the contacts + # Get all the contacts result = api_instance.get_contacts(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->get_contacts: #{e}" + puts "Error when calling ContactsApi->get_contacts: #{e}" +end +``` + +#### Using the get_contacts_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_contacts_with_http_info(opts) + +```ruby +begin + # Get all the contacts + data, status_code, headers = api_instance.get_contacts_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->get_contacts_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **limit** | **Integer**| Number of documents per page | [optional] [default to 50] - **offset** | **Integer**| Index of the first document of the page | [optional] [default to 0] - **modified_since** | **String**| Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **limit** | **Integer** | Number of documents per page | [optional][default to 50] | +| **offset** | **Integer** | Index of the first document of the page | [optional][default to 0] | +| **modified_since** | **String** | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -839,62 +1078,79 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_contacts_from_list -# **get_contacts_from_list** -> GetContacts get_contacts_from_list(list_id, opts) +> get_contacts_from_list(list_id, opts) Get contacts in a list -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - list_id = 789 # Integer | Id of the list - -opts = { +opts = { modified_since: 'modified_since_example', # String | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. - limit: 50, # Integer | Number of documents per page - offset: 0, # Integer | Index of the first document of the page - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + limit: 789, # Integer | Number of documents per page + offset: 789, # Integer | Index of the first document of the page + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Get contacts in a list + # Get contacts in a list result = api_instance.get_contacts_from_list(list_id, opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->get_contacts_from_list: #{e}" + puts "Error when calling ContactsApi->get_contacts_from_list: #{e}" +end +``` + +#### Using the get_contacts_from_list_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_contacts_from_list_with_http_info(list_id, opts) + +```ruby +begin + # Get contacts in a list + data, status_code, headers = api_instance.get_contacts_from_list_with_http_info(list_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->get_contacts_from_list_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **Integer**| Id of the list | - **modified_since** | **String**| Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional] - **limit** | **Integer**| Number of documents per page | [optional] [default to 50] - **offset** | **Integer**| Index of the first document of the page | [optional] [default to 0] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **list_id** | **Integer** | Id of the list | | +| **modified_since** | **String** | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional] | +| **limit** | **Integer** | Number of documents per page | [optional][default to 50] | +| **offset** | **Integer** | Index of the first document of the page | [optional][default to 0] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -906,52 +1162,69 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_folder -# **get_folder** -> GetFolder get_folder(folder_id) +> get_folder(folder_id) Returns a folder's details -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - folder_id = 789 # Integer | id of the folder - begin - #Returns a folder's details + # Returns a folder's details result = api_instance.get_folder(folder_id) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->get_folder: #{e}" + puts "Error when calling ContactsApi->get_folder: #{e}" +end +``` + +#### Using the get_folder_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_folder_with_http_info(folder_id) + +```ruby +begin + # Returns a folder's details + data, status_code, headers = api_instance.get_folder_with_http_info(folder_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->get_folder_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **folder_id** | **Integer**| id of the folder | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **folder_id** | **Integer** | id of the folder | | ### Return type @@ -963,60 +1236,77 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_folder_lists -# **get_folder_lists** -> GetFolderLists get_folder_lists(folder_id, opts) +> get_folder_lists(folder_id, opts) Get lists in a folder -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - folder_id = 789 # Integer | Id of the folder - -opts = { - limit: 10, # Integer | Number of documents per page - offset: 0, # Integer | Index of the first document of the page - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed +opts = { + limit: 789, # Integer | Number of documents per page + offset: 789, # Integer | Index of the first document of the page + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Get lists in a folder + # Get lists in a folder result = api_instance.get_folder_lists(folder_id, opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->get_folder_lists: #{e}" + puts "Error when calling ContactsApi->get_folder_lists: #{e}" +end +``` + +#### Using the get_folder_lists_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_folder_lists_with_http_info(folder_id, opts) + +```ruby +begin + # Get lists in a folder + data, status_code, headers = api_instance.get_folder_lists_with_http_info(folder_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->get_folder_lists_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **folder_id** | **Integer**| Id of the folder | - **limit** | **Integer**| Number of documents per page | [optional] [default to 10] - **offset** | **Integer**| Index of the first document of the page | [optional] [default to 0] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **folder_id** | **Integer** | Id of the folder | | +| **limit** | **Integer** | Number of documents per page | [optional][default to 10] | +| **offset** | **Integer** | Index of the first document of the page | [optional][default to 0] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -1028,59 +1318,75 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_folders -# **get_folders** -> GetFolders get_folders(limit, offset, opts) +> get_folders(limit, offset, opts) Get all folders -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - -limit = 10 # Integer | Number of documents per page - -offset = 0 # Integer | Index of the first document of the page - -opts = { - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed +limit = 789 # Integer | Number of documents per page +offset = 789 # Integer | Index of the first document of the page +opts = { + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Get all folders + # Get all folders result = api_instance.get_folders(limit, offset, opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->get_folders: #{e}" + puts "Error when calling ContactsApi->get_folders: #{e}" +end +``` + +#### Using the get_folders_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_folders_with_http_info(limit, offset, opts) + +```ruby +begin + # Get all folders + data, status_code, headers = api_instance.get_folders_with_http_info(limit, offset, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->get_folders_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **limit** | **Integer**| Number of documents per page | [default to 10] - **offset** | **Integer**| Index of the first document of the page | [default to 0] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **limit** | **Integer** | Number of documents per page | [default to 10] | +| **offset** | **Integer** | Index of the first document of the page | [default to 0] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -1092,52 +1398,69 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_list -# **get_list** -> GetExtendedList get_list(list_id) +> get_list(list_id) Get a list's details -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - list_id = 789 # Integer | Id of the list - begin - #Get a list's details + # Get a list's details result = api_instance.get_list(list_id) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->get_list: #{e}" + puts "Error when calling ContactsApi->get_list: #{e}" +end +``` + +#### Using the get_list_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_list_with_http_info(list_id) + +```ruby +begin + # Get a list's details + data, status_code, headers = api_instance.get_list_with_http_info(list_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->get_list_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **Integer**| Id of the list | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **list_id** | **Integer** | Id of the list | | ### Return type @@ -1149,57 +1472,75 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_lists -# **get_lists** -> GetLists get_lists(opts) +> get_lists(opts) Get all the lists -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - -opts = { - limit: 10, # Integer | Number of documents per page - offset: 0, # Integer | Index of the first document of the page - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed +opts = { + limit: 789, # Integer | Number of documents per page + offset: 789, # Integer | Index of the first document of the page + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Get all the lists + # Get all the lists result = api_instance.get_lists(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->get_lists: #{e}" + puts "Error when calling ContactsApi->get_lists: #{e}" +end +``` + +#### Using the get_lists_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_lists_with_http_info(opts) + +```ruby +begin + # Get all the lists + data, status_code, headers = api_instance.get_lists_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->get_lists_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **limit** | **Integer**| Number of documents per page | [optional] [default to 10] - **offset** | **Integer**| Index of the first document of the page | [optional] [default to 0] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **limit** | **Integer** | Number of documents per page | [optional][default to 10] | +| **offset** | **Integer** | Index of the first document of the page | [optional][default to 0] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -1211,54 +1552,71 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## import_contacts -# **import_contacts** -> CreatedProcessId import_contacts(request_contact_import) +> import_contacts(request_contact_import) Import contacts It returns the background process ID which on completion calls the notify URL that you have set in the input. -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - request_contact_import = SibApiV3Sdk::RequestContactImport.new # RequestContactImport | Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` - begin - #Import contacts + # Import contacts result = api_instance.import_contacts(request_contact_import) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->import_contacts: #{e}" + puts "Error when calling ContactsApi->import_contacts: #{e}" +end +``` + +#### Using the import_contacts_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> import_contacts_with_http_info(request_contact_import) + +```ruby +begin + # Import contacts + data, status_code, headers = api_instance.import_contacts_with_http_info(request_contact_import) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->import_contacts_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **request_contact_import** | [**RequestContactImport**](RequestContactImport.md)| Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_contact_import** | [**RequestContactImport**](RequestContactImport.md) | Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` | | ### Return type @@ -1270,55 +1628,71 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## remove_contact_from_list -# **remove_contact_from_list** -> PostContactInfo remove_contact_from_list(list_id, contact_emails) +> remove_contact_from_list(list_id, contact_emails) Delete a contact from a list -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - list_id = 789 # Integer | Id of the list - contact_emails = SibApiV3Sdk::RemoveContactFromList.new # RemoveContactFromList | Emails addresses OR IDs of the contacts - begin - #Delete a contact from a list + # Delete a contact from a list result = api_instance.remove_contact_from_list(list_id, contact_emails) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->remove_contact_from_list: #{e}" + puts "Error when calling ContactsApi->remove_contact_from_list: #{e}" +end +``` + +#### Using the remove_contact_from_list_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> remove_contact_from_list_with_http_info(list_id, contact_emails) + +```ruby +begin + # Delete a contact from a list + data, status_code, headers = api_instance.remove_contact_from_list_with_http_info(list_id, contact_emails) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->remove_contact_from_list_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **Integer**| Id of the list | - **contact_emails** | [**RemoveContactFromList**](RemoveContactFromList.md)| Emails addresses OR IDs of the contacts | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **list_id** | **Integer** | Id of the list | | +| **contact_emails** | [**RemoveContactFromList**](RemoveContactFromList.md) | Emails addresses OR IDs of the contacts | | ### Return type @@ -1330,54 +1704,71 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## request_contact_export -# **request_contact_export** -> CreatedProcessId request_contact_export(request_contact_export) +> request_contact_export(request_contact_export) Export contacts It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - request_contact_export = SibApiV3Sdk::RequestContactExport.new # RequestContactExport | Values to request a contact export - begin - #Export contacts + # Export contacts result = api_instance.request_contact_export(request_contact_export) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->request_contact_export: #{e}" + puts "Error when calling ContactsApi->request_contact_export: #{e}" +end +``` + +#### Using the request_contact_export_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> request_contact_export_with_http_info(request_contact_export) + +```ruby +begin + # Export contacts + data, status_code, headers = api_instance.request_contact_export_with_http_info(request_contact_export) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->request_contact_export_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **request_contact_export** | [**RequestContactExport**](RequestContactExport.md)| Values to request a contact export | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **request_contact_export** | [**RequestContactExport**](RequestContactExport.md) | Values to request a contact export | | ### Return type @@ -1389,57 +1780,72 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## update_attribute -# **update_attribute** > update_attribute(attribute_category, attribute_name, update_attribute) Update contact attribute -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new +attribute_category = 'category' # String | Category of the attribute +attribute_name = 'attribute_name_example' # String | Name of the existing attribute +update_attribute = SibApiV3Sdk::UpdateAttribute.new # UpdateAttribute | Values to update an attribute -attribute_category = 'attribute_category_example' # String | Category of the attribute +begin + # Update contact attribute + api_instance.update_attribute(attribute_category, attribute_name, update_attribute) +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->update_attribute: #{e}" +end +``` -attribute_name = 'attribute_name_example' # String | Name of the existing attribute +#### Using the update_attribute_with_http_info variant -update_attribute = SibApiV3Sdk::UpdateAttribute.new # UpdateAttribute | Values to update an attribute +This returns an Array which contains the response data (`nil` in this case), status code and headers. +> update_attribute_with_http_info(attribute_category, attribute_name, update_attribute) +```ruby begin - #Update contact attribute - api_instance.update_attribute(attribute_category, attribute_name, update_attribute) + # Update contact attribute + data, status_code, headers = api_instance.update_attribute_with_http_info(attribute_category, attribute_name, update_attribute) + p status_code # => 2xx + p headers # => { ... } + p data # => nil rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->update_attribute: #{e}" + puts "Error when calling ContactsApi->update_attribute_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **attribute_category** | **String**| Category of the attribute | - **attribute_name** | **String**| Name of the existing attribute | - **update_attribute** | [**UpdateAttribute**](UpdateAttribute.md)| Values to update an attribute | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **attribute_category** | **String** | Category of the attribute | | +| **attribute_name** | **String** | Name of the existing attribute | | +| **update_attribute** | [**UpdateAttribute**](UpdateAttribute.md) | Values to update an attribute | | ### Return type @@ -1451,54 +1857,70 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## update_contact -# **update_contact** > update_contact(identifier, update_contact) Update a contact -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - identifier = 'identifier_example' # String | Email (urlencoded) OR ID of the contact - update_contact = SibApiV3Sdk::UpdateContact.new # UpdateContact | Values to update a contact - begin - #Update a contact + # Update a contact api_instance.update_contact(identifier, update_contact) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->update_contact: #{e}" + puts "Error when calling ContactsApi->update_contact: #{e}" +end +``` + +#### Using the update_contact_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_contact_with_http_info(identifier, update_contact) + +```ruby +begin + # Update a contact + data, status_code, headers = api_instance.update_contact_with_http_info(identifier, update_contact) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->update_contact_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **identifier** | **String**| Email (urlencoded) OR ID of the contact | - **update_contact** | [**UpdateContact**](UpdateContact.md)| Values to update a contact | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **identifier** | **String** | Email (urlencoded) OR ID of the contact | | +| **update_contact** | [**UpdateContact**](UpdateContact.md) | Values to update a contact | | ### Return type @@ -1510,54 +1932,70 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## update_folder -# **update_folder** > update_folder(folder_id, update_folder) Update a folder -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - folder_id = 789 # Integer | Id of the folder - update_folder = SibApiV3Sdk::CreateUpdateFolder.new # CreateUpdateFolder | Name of the folder - begin - #Update a folder + # Update a folder api_instance.update_folder(folder_id, update_folder) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->update_folder: #{e}" + puts "Error when calling ContactsApi->update_folder: #{e}" +end +``` + +#### Using the update_folder_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_folder_with_http_info(folder_id, update_folder) + +```ruby +begin + # Update a folder + data, status_code, headers = api_instance.update_folder_with_http_info(folder_id, update_folder) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->update_folder_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **folder_id** | **Integer**| Id of the folder | - **update_folder** | [**CreateUpdateFolder**](CreateUpdateFolder.md)| Name of the folder | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **folder_id** | **Integer** | Id of the folder | | +| **update_folder** | [**CreateUpdateFolder**](CreateUpdateFolder.md) | Name of the folder | | ### Return type @@ -1569,54 +2007,70 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## update_list -# **update_list** > update_list(list_id, update_list) Update a list -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ContactsApi.new - list_id = 789 # Integer | Id of the list - update_list = SibApiV3Sdk::UpdateList.new # UpdateList | Values to update a list - begin - #Update a list + # Update a list api_instance.update_list(list_id, update_list) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ContactsApi->update_list: #{e}" + puts "Error when calling ContactsApi->update_list: #{e}" +end +``` + +#### Using the update_list_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_list_with_http_info(list_id, update_list) + +```ruby +begin + # Update a list + data, status_code, headers = api_instance.update_list_with_http_info(list_id, update_list) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ContactsApi->update_list_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **Integer**| Id of the list | - **update_list** | [**UpdateList**](UpdateList.md)| Values to update a list | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **list_id** | **Integer** | Id of the list | | +| **update_list** | [**UpdateList**](UpdateList.md) | Values to update a list | | ### Return type @@ -1628,8 +2082,6 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - - +- **Content-Type**: application/json +- **Accept**: application/json diff --git a/docs/CreateAttribute.md b/docs/CreateAttribute.md index f3b462c..cc06535 100644 --- a/docs/CreateAttribute.md +++ b/docs/CreateAttribute.md @@ -1,10 +1,22 @@ # SibApiV3Sdk::CreateAttribute ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **String** | Value of the attribute. Use only if the attribute's category is 'calculated' or 'global' | [optional] -**enumeration** | [**Array<CreateAttributeEnumeration>**](CreateAttributeEnumeration.md) | 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\"}] | [optional] -**type** | **String** | 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 ) | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **value** | **String** | Value of the attribute. Use only if the attribute's category is 'calculated' or 'global' | [optional] | +| **enumeration** | [**Array<CreateAttributeEnumeration>**](CreateAttributeEnumeration.md) | 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\"}] | [optional] | +| **type** | **String** | 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 ) | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateAttribute.new( + value: COUNT[BLACKLISTED,BLACKLISTED,<,NOW()], + enumeration: null, + type: text +) +``` diff --git a/docs/CreateAttributeEnumeration.md b/docs/CreateAttributeEnumeration.md index c093cd8..6b78e2c 100644 --- a/docs/CreateAttributeEnumeration.md +++ b/docs/CreateAttributeEnumeration.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::CreateAttributeEnumeration ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **Integer** | Id of the value | -**label** | **String** | Label of the value | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **value** | **Integer** | Id of the value | | +| **label** | **String** | Label of the value | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateAttributeEnumeration.new( + value: 1, + label: Women +) +``` diff --git a/docs/CreateChild.md b/docs/CreateChild.md index f3430ef..0f157ba 100644 --- a/docs/CreateChild.md +++ b/docs/CreateChild.md @@ -1,13 +1,28 @@ # SibApiV3Sdk::CreateChild ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | Email address to create the child account | -**first_name** | **String** | First name to use to create the child account | -**last_name** | **String** | Last name to use to create the child account | -**company_name** | **String** | Company name to use to create the child account | -**password** | **String** | Password for the child account to login | -**language** | **String** | Language of the child account | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Email address to create the child account | | +| **first_name** | **String** | First name to use to create the child account | | +| **last_name** | **String** | Last name to use to create the child account | | +| **company_name** | **String** | Company name to use to create the child account | | +| **password** | **String** | Password for the child account to login | | +| **language** | **String** | Language of the child account | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateChild.new( + email: josh.cruise@example.com, + first_name: Josh, + last_name: Cruise, + company_name: Your Company, + password: Pa55w0rd65, + language: en +) +``` diff --git a/docs/CreateContact.md b/docs/CreateContact.md index c457d9d..1608012 100644 --- a/docs/CreateContact.md +++ b/docs/CreateContact.md @@ -1,14 +1,30 @@ # SibApiV3Sdk::CreateContact ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | 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\"} | [optional] -**attributes** | **Object** | Pass the set of attributes and their values. These attributes must be present in your SendinBlue account. For eg. {\"FNAME\":\"Elly\", \"LNAME\":\"Roger\"} | [optional] -**email_blacklisted** | **BOOLEAN** | Set this field to blacklist the contact for emails (emailBlacklisted = true) | [optional] -**sms_blacklisted** | **BOOLEAN** | Set this field to blacklist the contact for SMS (smsBlacklisted = true) | [optional] -**list_ids** | **Array<Integer>** | Ids of the lists to add the contact to | [optional] -**update_enabled** | **BOOLEAN** | Facilitate to update the existing contact in the same request (updateEnabled = true) | [optional] [default to false] -**smtp_blacklist_sender** | **Array<String>** | transactional email forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true ) | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | 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\"} | [optional] | +| **attributes** | **Object** | Pass the set of attributes and their values. These attributes must be present in your SendinBlue account. For eg. {\"FNAME\":\"Elly\", \"LNAME\":\"Roger\"} | [optional] | +| **email_blacklisted** | **Boolean** | Set this field to blacklist the contact for emails (emailBlacklisted = true) | [optional] | +| **sms_blacklisted** | **Boolean** | Set this field to blacklist the contact for SMS (smsBlacklisted = true) | [optional] | +| **list_ids** | **Array<Integer>** | Ids of the lists to add the contact to | [optional] | +| **update_enabled** | **Boolean** | Facilitate to update the existing contact in the same request (updateEnabled = true) | [optional][default to false] | +| **smtp_blacklist_sender** | **Array<String>** | transactional email forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true ) | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateContact.new( + email: elly@example.com, + attributes: {"FNAME":"Elly","LNAME":"Roger"}, + email_blacklisted: false, + sms_blacklisted: false, + list_ids: null, + update_enabled: false, + smtp_blacklist_sender: null +) +``` diff --git a/docs/CreateDoiContact.md b/docs/CreateDoiContact.md index 14cdc7d..a275a32 100644 --- a/docs/CreateDoiContact.md +++ b/docs/CreateDoiContact.md @@ -1,13 +1,28 @@ # SibApiV3Sdk::CreateDoiContact ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | Email address where the confirmation email will be sent. This email address will be the identifier for all other contact attributes. | -**attributes** | **Object** | Pass the set of attributes and their values. These attributes must be present in your SendinBlue account. For eg. {'FNAME':'Elly', 'LNAME':'Roger'} | [optional] -**include_list_ids** | **Array<Integer>** | Lists under user account where contact should be added | -**exclude_list_ids** | **Array<Integer>** | Lists under user account where contact should not be added | [optional] -**template_id** | **Integer** | Id of the Double opt-in (DOI) template | -**redirection_url** | **String** | URL of the web page that user will be redirected to after clicking on the double opt in URL. When editing your DOI template you can reference this URL by using the tag {{ params.DOIurl }}. | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Email address where the confirmation email will be sent. This email address will be the identifier for all other contact attributes. | | +| **attributes** | **Object** | Pass the set of attributes and their values. These attributes must be present in your SendinBlue account. For eg. {'FNAME':'Elly', 'LNAME':'Roger'} | [optional] | +| **include_list_ids** | **Array<Integer>** | Lists under user account where contact should be added | | +| **exclude_list_ids** | **Array<Integer>** | Lists under user account where contact should not be added | [optional] | +| **template_id** | **Integer** | Id of the Double opt-in (DOI) template | | +| **redirection_url** | **String** | URL of the web page that user will be redirected to after clicking on the double opt in URL. When editing your DOI template you can reference this URL by using the tag {{ params.DOIurl }}. | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateDoiContact.new( + email: elly@example.com, + attributes: {"FNAME":"Elly","LNAME":"Roger"}, + include_list_ids: null, + exclude_list_ids: null, + template_id: 2, + redirection_url: http://requestb.in/173lyyx1 +) +``` diff --git a/docs/CreateEmailCampaign.md b/docs/CreateEmailCampaign.md index 3b28306..3269ba1 100644 --- a/docs/CreateEmailCampaign.md +++ b/docs/CreateEmailCampaign.md @@ -1,35 +1,72 @@ # SibApiV3Sdk::CreateEmailCampaign ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tag** | **String** | Tag of the campaign | [optional] -**sender** | [**CreateEmailCampaignSender**](CreateEmailCampaignSender.md) | | -**name** | **String** | Name of the campaign | -**html_content** | **String** | Mandatory if htmlUrl and templateId are empty. Body of the message (HTML) | [optional] -**html_url** | **String** | Mandatory if htmlContent and templateId are empty. Url to the message (HTML) | [optional] -**template_id** | **Integer** | Mandatory if htmlContent and htmlUrl are empty. Id of the transactional email template with status 'active'. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature. | [optional] -**scheduled_at** | **String** | Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). | [optional] -**subject** | **String** | Subject of the campaign. Mandatory if abTesting is false. Ignored if abTesting is true. | [optional] -**reply_to** | **String** | Email on which the campaign recipients will be able to reply to | [optional] -**to_field** | **String** | To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization | [optional] -**recipients** | [**CreateEmailCampaignRecipients**](CreateEmailCampaignRecipients.md) | | [optional] -**attachment_url** | **String** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional] -**inline_image_activation** | **BOOLEAN** | Use true to embedded the images in your email. Final size of the email should be less than 4MB. Campaigns with embedded images can not be sent to more than 5000 contacts | [optional] [default to false] -**mirror_active** | **BOOLEAN** | Use true to enable the mirror link | [optional] -**footer** | **String** | Footer of the email campaign | [optional] -**header** | **String** | Header of the email campaign | [optional] -**utm_campaign** | **String** | Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed | [optional] -**params** | **Object** | Pass the set of attributes to customize the type classic campaign. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. Only available if 'type' is 'classic'. It's considered only if campaign is in New Template Language format. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField' | [optional] -**send_at_best_time** | **BOOLEAN** | Set this to true if you want to send your campaign at best time. | [optional] [default to false] -**ab_testing** | **BOOLEAN** | Status of A/B Test. abTesting = false means it is disabled, & abTesting = true means it is enabled. 'subjectA', 'subjectB', 'splitRule', 'winnerCriteria' & 'winnerDelay' will be considered when abTesting is set to true. 'subjectA' & 'subjectB' are mandatory together & 'subject' if passed is ignored. Can be set to true only if 'sendAtBestTime' is 'false'. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B | [optional] [default to false] -**subject_a** | **String** | Subject A of the campaign. Mandatory if abTesting = true. subjectA & subjectB should have unique value | [optional] -**subject_b** | **String** | Subject B of the campaign. Mandatory if abTesting = true. subjectA & subjectB should have unique value | [optional] -**split_rule** | **Integer** | Add the size of your test groups. Mandatory if abTesting = true & 'recipients' is passed. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else | [optional] -**winner_criteria** | **String** | Choose the metrics that will determinate the winning version. Mandatory if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerCriteria' is ignored if passed | [optional] -**winner_delay** | **Integer** | Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Mandatory if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerDelay' is ignored if passed | [optional] -**ip_warmup_enable** | **BOOLEAN** | Available for dedicated ip clients. Set this to true if you wish to warm up your ip. | [optional] [default to false] -**initial_quota** | **Integer** | Mandatory if ipWarmupEnable is set to true. Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. | [optional] -**increase_rate** | **Integer** | Mandatory if ipWarmupEnable is set to true. Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **tag** | **String** | Tag of the campaign | [optional] | +| **sender** | [**CreateEmailCampaignSender**](CreateEmailCampaignSender.md) | | | +| **name** | **String** | Name of the campaign | | +| **html_content** | **String** | Mandatory if htmlUrl and templateId are empty. Body of the message (HTML) | [optional] | +| **html_url** | **String** | Mandatory if htmlContent and templateId are empty. Url to the message (HTML) | [optional] | +| **template_id** | **Integer** | Mandatory if htmlContent and htmlUrl are empty. Id of the transactional email template with status 'active'. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature. | [optional] | +| **scheduled_at** | **String** | Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). | [optional] | +| **subject** | **String** | Subject of the campaign. Mandatory if abTesting is false. Ignored if abTesting is true. | [optional] | +| **reply_to** | **String** | Email on which the campaign recipients will be able to reply to | [optional] | +| **to_field** | **String** | To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization | [optional] | +| **recipients** | [**CreateEmailCampaignRecipients**](CreateEmailCampaignRecipients.md) | | [optional] | +| **attachment_url** | **String** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional] | +| **inline_image_activation** | **Boolean** | Use true to embedded the images in your email. Final size of the email should be less than 4MB. Campaigns with embedded images can not be sent to more than 5000 contacts | [optional][default to false] | +| **mirror_active** | **Boolean** | Use true to enable the mirror link | [optional] | +| **footer** | **String** | Footer of the email campaign | [optional] | +| **header** | **String** | Header of the email campaign | [optional] | +| **utm_campaign** | **String** | Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed | [optional] | +| **params** | **Object** | Pass the set of attributes to customize the type classic campaign. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. Only available if 'type' is 'classic'. It's considered only if campaign is in New Template Language format. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField' | [optional] | +| **send_at_best_time** | **Boolean** | Set this to true if you want to send your campaign at best time. | [optional][default to false] | +| **ab_testing** | **Boolean** | Status of A/B Test. abTesting = false means it is disabled, & abTesting = true means it is enabled. 'subjectA', 'subjectB', 'splitRule', 'winnerCriteria' & 'winnerDelay' will be considered when abTesting is set to true. 'subjectA' & 'subjectB' are mandatory together & 'subject' if passed is ignored. Can be set to true only if 'sendAtBestTime' is 'false'. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B | [optional][default to false] | +| **subject_a** | **String** | Subject A of the campaign. Mandatory if abTesting = true. subjectA & subjectB should have unique value | [optional] | +| **subject_b** | **String** | Subject B of the campaign. Mandatory if abTesting = true. subjectA & subjectB should have unique value | [optional] | +| **split_rule** | **Integer** | Add the size of your test groups. Mandatory if abTesting = true & 'recipients' is passed. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else | [optional] | +| **winner_criteria** | **String** | Choose the metrics that will determinate the winning version. Mandatory if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerCriteria' is ignored if passed | [optional] | +| **winner_delay** | **Integer** | Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Mandatory if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerDelay' is ignored if passed | [optional] | +| **ip_warmup_enable** | **Boolean** | Available for dedicated ip clients. Set this to true if you wish to warm up your ip. | [optional][default to false] | +| **initial_quota** | **Integer** | Mandatory if ipWarmupEnable is set to true. Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. | [optional] | +| **increase_rate** | **Integer** | Mandatory if ipWarmupEnable is set to true. Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateEmailCampaign.new( + tag: Newsletter, + sender: null, + name: Newsletter - May 2017, + html_content: Spring is here, discover my new collection, + html_url: https://html.domain.com, + template_id: null, + scheduled_at: 2017-06-01T12:30:00+02:00, + subject: Discover the New Collection !, + reply_to: support@myshop.com, + to_field: {FNAME} {LNAME}, + recipients: null, + attachment_url: https://attachment.domain.com, + inline_image_activation: true, + mirror_active: true, + footer: [DEFAULT_FOOTER], + header: [DEFAULT_HEADER], + utm_campaign: NL_05_2017, + params: {"FNAME":"Joe","LNAME":"Doe"}, + send_at_best_time: true, + ab_testing: true, + subject_a: Discover the New Collection!, + subject_b: Want to discover the New Collection?, + split_rule: 50, + winner_criteria: open, + winner_delay: 50, + ip_warmup_enable: true, + initial_quota: 3000, + increase_rate: 70 +) +``` diff --git a/docs/CreateEmailCampaignRecipients.md b/docs/CreateEmailCampaignRecipients.md index 191d952..3ec72ee 100644 --- a/docs/CreateEmailCampaignRecipients.md +++ b/docs/CreateEmailCampaignRecipients.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::CreateEmailCampaignRecipients ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**exclusion_list_ids** | **Array<Integer>** | List ids to exclude from the campaign | [optional] -**list_ids** | **Array<Integer>** | Mandatory if scheduledAt is not empty. List Ids to send the campaign to | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **exclusion_list_ids** | **Array<Integer>** | List ids to exclude from the campaign | [optional] | +| **list_ids** | **Array<Integer>** | Mandatory if scheduledAt is not empty. List Ids to send the campaign to | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateEmailCampaignRecipients.new( + exclusion_list_ids: null, + list_ids: null +) +``` diff --git a/docs/CreateEmailCampaignSender.md b/docs/CreateEmailCampaignSender.md index d8793ce..5c9bf17 100644 --- a/docs/CreateEmailCampaignSender.md +++ b/docs/CreateEmailCampaignSender.md @@ -1,10 +1,22 @@ # SibApiV3Sdk::CreateEmailCampaignSender ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Sender Name | [optional] -**email** | **String** | Sender email | -**id** | **Integer** | Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Sender Name | [optional] | +| **email** | **String** | Sender email | | +| **id** | **Integer** | Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateEmailCampaignSender.new( + name: Mary from MyShop, + email: newsletter@myshop.com, + id: 3 +) +``` diff --git a/docs/CreateList.md b/docs/CreateList.md index 00abe3f..38bbfe9 100644 --- a/docs/CreateList.md +++ b/docs/CreateList.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::CreateList ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Name of the list | -**folder_id** | **Integer** | Id of the parent folder in which this list is to be created | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of the list | | +| **folder_id** | **Integer** | Id of the parent folder in which this list is to be created | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateList.new( + name: Magento Customer - ES, + folder_id: 2 +) +``` diff --git a/docs/CreateModel.md b/docs/CreateModel.md index b8c6606..508540d 100644 --- a/docs/CreateModel.md +++ b/docs/CreateModel.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::CreateModel ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | ID of the object created | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **Integer** | ID of the object created | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateModel.new( + id: 122 +) +``` diff --git a/docs/CreateReseller.md b/docs/CreateReseller.md index becd308..9ff8fdd 100644 --- a/docs/CreateReseller.md +++ b/docs/CreateReseller.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::CreateReseller ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**auth_key** | **String** | AuthKey of Reseller child created | -**id** | **Integer** | Id of Reseller child created | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **auth_key** | **String** | AuthKey of Reseller child created | | +| **id** | **Integer** | Id of Reseller child created | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateReseller.new( + auth_key: xkeysib-21881axxxxxcc92e04-mIrexxxx7z, + id: 1234567 +) +``` diff --git a/docs/CreateSender.md b/docs/CreateSender.md index 9f8d9e1..2e596e1 100644 --- a/docs/CreateSender.md +++ b/docs/CreateSender.md @@ -1,10 +1,22 @@ # SibApiV3Sdk::CreateSender ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | From Name to use for the sender | -**email** | **String** | From email to use for the sender. A verification email will be sent to this address. | -**ips** | [**Array<CreateSenderIps>**](CreateSenderIps.md) | Mandatory in case of dedicated IP, IPs to associate to the sender | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | From Name to use for the sender | | +| **email** | **String** | From email to use for the sender. A verification email will be sent to this address. | | +| **ips** | [**Array<CreateSenderIps>**](CreateSenderIps.md) | Mandatory in case of dedicated IP, IPs to associate to the sender | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateSender.new( + name: Newsletter, + email: newsletter@mycompany.com, + ips: null +) +``` diff --git a/docs/CreateSenderIps.md b/docs/CreateSenderIps.md index 7547d70..61dcbbf 100644 --- a/docs/CreateSenderIps.md +++ b/docs/CreateSenderIps.md @@ -1,10 +1,22 @@ # SibApiV3Sdk::CreateSenderIps ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ip** | **String** | Dedicated IP available in your account | -**domain** | **String** | Domain of the IP | -**weight** | **Integer** | Weight to apply to the IP. Sum of all IP weights must be 100. Should be passed for either ALL or NONE of the IPs. If it's not passed, the sending will be equally balanced on all IPs. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **ip** | **String** | Dedicated IP available in your account | | +| **domain** | **String** | Domain of the IP | | +| **weight** | **Integer** | Weight to apply to the IP. Sum of all IP weights must be 100. Should be passed for either ALL or NONE of the IPs. If it's not passed, the sending will be equally balanced on all IPs. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateSenderIps.new( + ip: 123.98.689.7, + domain: mycompany.com, + weight: 50 +) +``` diff --git a/docs/CreateSenderModel.md b/docs/CreateSenderModel.md index 379ab2a..47ec963 100644 --- a/docs/CreateSenderModel.md +++ b/docs/CreateSenderModel.md @@ -1,10 +1,22 @@ # SibApiV3Sdk::CreateSenderModel ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | ID of the Sender created | -**spf_error** | **BOOLEAN** | Status of SPF configuration for the sender (true = SPF not well configured, false = SPF well configured) | [optional] -**dkim_error** | **BOOLEAN** | Status of DKIM configuration for the sender (true = DKIM not well configured, false = DKIM well configured) | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **Integer** | ID of the Sender created | | +| **spf_error** | **Boolean** | Status of SPF configuration for the sender (true = SPF not well configured, false = SPF well configured) | [optional] | +| **dkim_error** | **Boolean** | Status of DKIM configuration for the sender (true = DKIM not well configured, false = DKIM well configured) | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateSenderModel.new( + id: 5, + spf_error: true, + dkim_error: false +) +``` diff --git a/docs/CreateSmsCampaign.md b/docs/CreateSmsCampaign.md index de4ae47..98bab8d 100644 --- a/docs/CreateSmsCampaign.md +++ b/docs/CreateSmsCampaign.md @@ -1,12 +1,26 @@ # SibApiV3Sdk::CreateSmsCampaign ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Name of the campaign | -**sender** | **String** | Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** | -**content** | **String** | Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS | -**recipients** | [**CreateSmsCampaignRecipients**](CreateSmsCampaignRecipients.md) | | [optional] -**scheduled_at** | **String** | UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of the campaign | | +| **sender** | **String** | Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** | | +| **content** | **String** | Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS | | +| **recipients** | [**CreateSmsCampaignRecipients**](CreateSmsCampaignRecipients.md) | | [optional] | +| **scheduled_at** | **String** | UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateSmsCampaign.new( + name: Spring Promo Code, + sender: MyShop, + content: Get a discount by visiting our NY store and saying : Happy Spring !, + recipients: null, + scheduled_at: 2017-05-05T12:30:00+02:00 +) +``` diff --git a/docs/CreateSmsCampaignRecipients.md b/docs/CreateSmsCampaignRecipients.md index 30d7b26..a6ecba4 100644 --- a/docs/CreateSmsCampaignRecipients.md +++ b/docs/CreateSmsCampaignRecipients.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::CreateSmsCampaignRecipients ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**list_ids** | **Array<Integer>** | Lists Ids to send the campaign to. REQUIRED if scheduledAt is not empty | -**exclusion_list_ids** | **Array<Integer>** | List ids which have to be excluded from a campaign | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **list_ids** | **Array<Integer>** | Lists Ids to send the campaign to. REQUIRED if scheduledAt is not empty | | +| **exclusion_list_ids** | **Array<Integer>** | List ids which have to be excluded from a campaign | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateSmsCampaignRecipients.new( + list_ids: null, + exclusion_list_ids: null +) +``` diff --git a/docs/CreateSmtpEmail.md b/docs/CreateSmtpEmail.md index 62518d1..50a0551 100644 --- a/docs/CreateSmtpEmail.md +++ b/docs/CreateSmtpEmail.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::CreateSmtpEmail ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**message_id** | **String** | Message ID of the transactional email sent | [optional] -**message_ids** | **Array<String>** | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **message_id** | **String** | Message ID of the transactional email sent | [optional] | +| **message_ids** | **Array<String>** | | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateSmtpEmail.new( + message_id: <201798300811.5787683@relay.domain.com>, + message_ids: null +) +``` diff --git a/docs/CreateSmtpTemplate.md b/docs/CreateSmtpTemplate.md index 203de50..408c783 100644 --- a/docs/CreateSmtpTemplate.md +++ b/docs/CreateSmtpTemplate.md @@ -1,17 +1,36 @@ # SibApiV3Sdk::CreateSmtpTemplate ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tag** | **String** | Tag of the template | [optional] -**sender** | [**CreateSmtpTemplateSender**](CreateSmtpTemplateSender.md) | | -**template_name** | **String** | Name of the template | -**html_content** | **String** | Body of the message (HTML version). The field must have more than 10 characters. REQUIRED if htmlUrl is empty | [optional] -**html_url** | **String** | Url which contents the body of the email message. REQUIRED if htmlContent is empty | [optional] -**subject** | **String** | Subject of the template | -**reply_to** | **String** | Email on which campaign recipients will be able to reply to | [optional] -**to_field** | **String** | To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization | [optional] -**attachment_url** | **String** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional] -**is_active** | **BOOLEAN** | Status of template. isActive = true means template is active and isActive = false means template is inactive | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **tag** | **String** | Tag of the template | [optional] | +| **sender** | [**CreateSmtpTemplateSender**](CreateSmtpTemplateSender.md) | | | +| **template_name** | **String** | Name of the template | | +| **html_content** | **String** | Body of the message (HTML version). The field must have more than 10 characters. REQUIRED if htmlUrl is empty | [optional] | +| **html_url** | **String** | Url which contents the body of the email message. REQUIRED if htmlContent is empty | [optional] | +| **subject** | **String** | Subject of the template | | +| **reply_to** | **String** | Email on which campaign recipients will be able to reply to | [optional] | +| **to_field** | **String** | To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization | [optional] | +| **attachment_url** | **String** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional] | +| **is_active** | **Boolean** | Status of template. isActive = true means template is active and isActive = false means template is inactive | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateSmtpTemplate.new( + tag: OrderConfirmation, + sender: null, + template_name: Order Confirmation - EN, + html_content: The order n°xxxxx has been confirmed. Thanks for your purchase, + html_url: https://html.domain.com, + subject: Thanks for your purchase !, + reply_to: support@myshop.com, + to_field: {FNAME} {LNAME}, + attachment_url: https://attachment.domain.com, + is_active: true +) +``` diff --git a/docs/CreateSmtpTemplateSender.md b/docs/CreateSmtpTemplateSender.md index 8a81111..d77ddcc 100644 --- a/docs/CreateSmtpTemplateSender.md +++ b/docs/CreateSmtpTemplateSender.md @@ -1,10 +1,22 @@ # SibApiV3Sdk::CreateSmtpTemplateSender ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Name of the sender. If not passed, will be set to default | [optional] -**email** | **String** | Email of the sender | [optional] -**id** | **Integer** | Select the sender for the template on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of the sender. If not passed, will be set to default | [optional] | +| **email** | **String** | Email of the sender | [optional] | +| **id** | **Integer** | Select the sender for the template on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateSmtpTemplateSender.new( + name: Mary from MyShop, + email: contact@myshop.com, + id: 3 +) +``` diff --git a/docs/CreateUpdateContactModel.md b/docs/CreateUpdateContactModel.md index 09b3cf5..b3af044 100644 --- a/docs/CreateUpdateContactModel.md +++ b/docs/CreateUpdateContactModel.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::CreateUpdateContactModel ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | ID of the contact when a new contact is created | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **Integer** | ID of the contact when a new contact is created | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateUpdateContactModel.new( + id: 122 +) +``` diff --git a/docs/CreateUpdateFolder.md b/docs/CreateUpdateFolder.md index ec4d0d1..6d1f169 100644 --- a/docs/CreateUpdateFolder.md +++ b/docs/CreateUpdateFolder.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::CreateUpdateFolder ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Name of the folder | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of the folder | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateUpdateFolder.new( + name: Wordpress Contacts +) +``` diff --git a/docs/CreateWebhook.md b/docs/CreateWebhook.md index 3398f1c..642e240 100644 --- a/docs/CreateWebhook.md +++ b/docs/CreateWebhook.md @@ -1,11 +1,24 @@ # SibApiV3Sdk::CreateWebhook ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**url** | **String** | URL of the webhook | -**description** | **String** | Description of the webhook | [optional] -**events** | **Array<String>** | Events triggering the webhook. Possible values for Transactional type webhook – `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` and possible values for Marketing type webhook – `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` | -**type** | **String** | Type of the webhook | [optional] [default to 'transactional'] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **url** | **String** | URL of the webhook | | +| **description** | **String** | Description of the webhook | [optional] | +| **events** | **Array<String>** | Events triggering the webhook. Possible values for Transactional type webhook – `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` and possible values for Marketing type webhook – `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` & `delivered` | | +| **type** | **String** | Type of the webhook | [optional][default to 'transactional'] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreateWebhook.new( + url: http://requestb.in/173lyyx1, + description: Webhook triggered on unsubscription, + events: null, + type: marketing +) +``` diff --git a/docs/CreatedProcessId.md b/docs/CreatedProcessId.md index fefd645..7cf8e21 100644 --- a/docs/CreatedProcessId.md +++ b/docs/CreatedProcessId.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::CreatedProcessId ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**process_id** | **Integer** | Id of the process created | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **process_id** | **Integer** | Id of the process created | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::CreatedProcessId.new( + process_id: 78 +) +``` diff --git a/docs/DeleteHardbounces.md b/docs/DeleteHardbounces.md index bb1d5ee..b9bf947 100644 --- a/docs/DeleteHardbounces.md +++ b/docs/DeleteHardbounces.md @@ -1,10 +1,22 @@ # SibApiV3Sdk::DeleteHardbounces ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**start_date** | **String** | Starting date (YYYY-MM-DD) of the time period for deletion. The hardbounces occurred after this date will be deleted. Must be less than or equal to the endDate | [optional] -**end_date** | **String** | Ending date (YYYY-MM-DD) of the time period for deletion. The hardbounces until this date will be deleted. Must be greater than or equal to the startDate | [optional] -**contact_email** | **String** | Target a specific email address | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **start_date** | **String** | Starting date (YYYY-MM-DD) of the time period for deletion. The hardbounces occurred after this date will be deleted. Must be less than or equal to the endDate | [optional] | +| **end_date** | **String** | Ending date (YYYY-MM-DD) of the time period for deletion. The hardbounces until this date will be deleted. Must be greater than or equal to the startDate | [optional] | +| **contact_email** | **String** | Target a specific email address | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::DeleteHardbounces.new( + start_date: 2016-12-31, + end_date: 2017-01-31, + contact_email: alex76@example.com +) +``` diff --git a/docs/EmailCampaignsApi.md b/docs/EmailCampaignsApi.md index 6e520b5..9d87050 100644 --- a/docs/EmailCampaignsApi.md +++ b/docs/EmailCampaignsApi.md @@ -2,64 +2,82 @@ All URIs are relative to *https://api.sendinblue.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_email_campaign**](EmailCampaignsApi.md#create_email_campaign) | **POST** /emailCampaigns | Create an email campaign -[**delete_email_campaign**](EmailCampaignsApi.md#delete_email_campaign) | **DELETE** /emailCampaigns/{campaignId} | Delete an email campaign -[**email_export_recipients**](EmailCampaignsApi.md#email_export_recipients) | **POST** /emailCampaigns/{campaignId}/exportRecipients | Export the recipients of an email campaign -[**get_ab_test_campaign_result**](EmailCampaignsApi.md#get_ab_test_campaign_result) | **GET** /emailCampaigns/{campaignId}/abTestCampaignResult | Get an A/B test email campaign results -[**get_email_campaign**](EmailCampaignsApi.md#get_email_campaign) | **GET** /emailCampaigns/{campaignId} | Get an email campaign report -[**get_email_campaigns**](EmailCampaignsApi.md#get_email_campaigns) | **GET** /emailCampaigns | Return all your created email campaigns -[**get_shared_template_url**](EmailCampaignsApi.md#get_shared_template_url) | **GET** /emailCampaigns/{campaignId}/sharedUrl | Get a shared template url -[**send_email_campaign_now**](EmailCampaignsApi.md#send_email_campaign_now) | **POST** /emailCampaigns/{campaignId}/sendNow | Send an email campaign immediately, based on campaignId -[**send_report**](EmailCampaignsApi.md#send_report) | **POST** /emailCampaigns/{campaignId}/sendReport | Send the report of a campaign -[**send_test_email**](EmailCampaignsApi.md#send_test_email) | **POST** /emailCampaigns/{campaignId}/sendTest | Send an email campaign to your test list -[**update_campaign_status**](EmailCampaignsApi.md#update_campaign_status) | **PUT** /emailCampaigns/{campaignId}/status | Update an email campaign status -[**update_email_campaign**](EmailCampaignsApi.md#update_email_campaign) | **PUT** /emailCampaigns/{campaignId} | Update an email campaign -[**upload_image_to_gallery**](EmailCampaignsApi.md#upload_image_to_gallery) | **POST** /emailCampaigns/images | Upload an image to your account's image gallery - - -# **create_email_campaign** -> CreateModel create_email_campaign(email_campaigns) +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**create_email_campaign**](EmailCampaignsApi.md#create_email_campaign) | **POST** /emailCampaigns | Create an email campaign | +| [**delete_email_campaign**](EmailCampaignsApi.md#delete_email_campaign) | **DELETE** /emailCampaigns/{campaignId} | Delete an email campaign | +| [**email_export_recipients**](EmailCampaignsApi.md#email_export_recipients) | **POST** /emailCampaigns/{campaignId}/exportRecipients | Export the recipients of an email campaign | +| [**get_ab_test_campaign_result**](EmailCampaignsApi.md#get_ab_test_campaign_result) | **GET** /emailCampaigns/{campaignId}/abTestCampaignResult | Get an A/B test email campaign results | +| [**get_email_campaign**](EmailCampaignsApi.md#get_email_campaign) | **GET** /emailCampaigns/{campaignId} | Get an email campaign report | +| [**get_email_campaigns**](EmailCampaignsApi.md#get_email_campaigns) | **GET** /emailCampaigns | Return all your created email campaigns | +| [**get_shared_template_url**](EmailCampaignsApi.md#get_shared_template_url) | **GET** /emailCampaigns/{campaignId}/sharedUrl | Get a shared template url | +| [**send_email_campaign_now**](EmailCampaignsApi.md#send_email_campaign_now) | **POST** /emailCampaigns/{campaignId}/sendNow | Send an email campaign immediately, based on campaignId | +| [**send_report**](EmailCampaignsApi.md#send_report) | **POST** /emailCampaigns/{campaignId}/sendReport | Send the report of a campaign | +| [**send_test_email**](EmailCampaignsApi.md#send_test_email) | **POST** /emailCampaigns/{campaignId}/sendTest | Send an email campaign to your test list | +| [**update_campaign_status**](EmailCampaignsApi.md#update_campaign_status) | **PUT** /emailCampaigns/{campaignId}/status | Update an email campaign status | +| [**update_email_campaign**](EmailCampaignsApi.md#update_email_campaign) | **PUT** /emailCampaigns/{campaignId} | Update an email campaign | +| [**upload_image_to_gallery**](EmailCampaignsApi.md#upload_image_to_gallery) | **POST** /emailCampaigns/images | Upload an image to your account's image gallery | + + +## create_email_campaign + +> create_email_campaign(email_campaigns) Create an email campaign -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::EmailCampaignsApi.new - -email_campaigns = SibApiV3Sdk::CreateEmailCampaign.new # CreateEmailCampaign | Values to create a campaign - +email_campaigns = SibApiV3Sdk::CreateEmailCampaign.new({sender: SibApiV3Sdk::CreateEmailCampaignSender.new({email: 'newsletter@myshop.com'}), name: 'Newsletter - May 2017'}) # CreateEmailCampaign | Values to create a campaign begin - #Create an email campaign + # Create an email campaign result = api_instance.create_email_campaign(email_campaigns) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling EmailCampaignsApi->create_email_campaign: #{e}" + puts "Error when calling EmailCampaignsApi->create_email_campaign: #{e}" +end +``` + +#### Using the create_email_campaign_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_email_campaign_with_http_info(email_campaigns) + +```ruby +begin + # Create an email campaign + data, status_code, headers = api_instance.create_email_campaign_with_http_info(email_campaigns) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling EmailCampaignsApi->create_email_campaign_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **email_campaigns** | [**CreateEmailCampaign**](CreateEmailCampaign.md)| Values to create a campaign | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email_campaigns** | [**CreateEmailCampaign**](CreateEmailCampaign.md) | Values to create a campaign | | ### Return type @@ -71,51 +89,68 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## delete_email_campaign -# **delete_email_campaign** > delete_email_campaign(campaign_id) Delete an email campaign -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::EmailCampaignsApi.new - campaign_id = 789 # Integer | id of the campaign - begin - #Delete an email campaign + # Delete an email campaign api_instance.delete_email_campaign(campaign_id) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling EmailCampaignsApi->delete_email_campaign: #{e}" + puts "Error when calling EmailCampaignsApi->delete_email_campaign: #{e}" +end +``` + +#### Using the delete_email_campaign_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_email_campaign_with_http_info(campaign_id) + +```ruby +begin + # Delete an email campaign + data, status_code, headers = api_instance.delete_email_campaign_with_http_info(campaign_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling EmailCampaignsApi->delete_email_campaign_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | **Integer**| id of the campaign | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | id of the campaign | | ### Return type @@ -127,56 +162,73 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## email_export_recipients -# **email_export_recipients** -> CreatedProcessId email_export_recipients(campaign_id, opts) +> email_export_recipients(campaign_id, opts) Export the recipients of an email campaign -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::EmailCampaignsApi.new - campaign_id = 789 # Integer | Id of the campaign - -opts = { - recipient_export: SibApiV3Sdk::EmailExportRecipients.new # EmailExportRecipients | Values to send for a recipient export request +opts = { + recipient_export: SibApiV3Sdk::EmailExportRecipients.new({recipients_type: 'all'}) # EmailExportRecipients | Values to send for a recipient export request } begin - #Export the recipients of an email campaign + # Export the recipients of an email campaign result = api_instance.email_export_recipients(campaign_id, opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling EmailCampaignsApi->email_export_recipients: #{e}" + puts "Error when calling EmailCampaignsApi->email_export_recipients: #{e}" +end +``` + +#### Using the email_export_recipients_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> email_export_recipients_with_http_info(campaign_id, opts) + +```ruby +begin + # Export the recipients of an email campaign + data, status_code, headers = api_instance.email_export_recipients_with_http_info(campaign_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling EmailCampaignsApi->email_export_recipients_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | **Integer**| Id of the campaign | - **recipient_export** | [**EmailExportRecipients**](EmailExportRecipients.md)| Values to send for a recipient export request | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | Id of the campaign | | +| **recipient_export** | [**EmailExportRecipients**](EmailExportRecipients.md) | Values to send for a recipient export request | [optional] | ### Return type @@ -188,54 +240,71 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## get_ab_test_campaign_result -# **get_ab_test_campaign_result** -> AbTestCampaignResult get_ab_test_campaign_result(campaign_id) +> get_ab_test_campaign_result(campaign_id) Get an A/B test email campaign results Obtain winning version of an A/B test email campaign -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::EmailCampaignsApi.new - campaign_id = 789 # Integer | Id of the A/B test campaign - begin - #Get an A/B test email campaign results + # Get an A/B test email campaign results result = api_instance.get_ab_test_campaign_result(campaign_id) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling EmailCampaignsApi->get_ab_test_campaign_result: #{e}" + puts "Error when calling EmailCampaignsApi->get_ab_test_campaign_result: #{e}" +end +``` + +#### Using the get_ab_test_campaign_result_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_ab_test_campaign_result_with_http_info(campaign_id) + +```ruby +begin + # Get an A/B test email campaign results + data, status_code, headers = api_instance.get_ab_test_campaign_result_with_http_info(campaign_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling EmailCampaignsApi->get_ab_test_campaign_result_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | **Integer**| Id of the A/B test campaign | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | Id of the A/B test campaign | | ### Return type @@ -247,52 +316,69 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_email_campaign -# **get_email_campaign** -> GetEmailCampaign get_email_campaign(campaign_id) +> get_email_campaign(campaign_id) Get an email campaign report -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::EmailCampaignsApi.new - campaign_id = 789 # Integer | Id of the campaign - begin - #Get an email campaign report + # Get an email campaign report result = api_instance.get_email_campaign(campaign_id) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling EmailCampaignsApi->get_email_campaign: #{e}" + puts "Error when calling EmailCampaignsApi->get_email_campaign: #{e}" +end +``` + +#### Using the get_email_campaign_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_email_campaign_with_http_info(campaign_id) + +```ruby +begin + # Get an email campaign report + data, status_code, headers = api_instance.get_email_campaign_with_http_info(campaign_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling EmailCampaignsApi->get_email_campaign_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | **Integer**| Id of the campaign | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | Id of the campaign | | ### Return type @@ -304,65 +390,83 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_email_campaigns -# **get_email_campaigns** -> GetEmailCampaigns get_email_campaigns(opts) +> get_email_campaigns(opts) Return all your created email campaigns -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::EmailCampaignsApi.new - -opts = { - type: 'type_example', # String | Filter on the type of the campaigns - status: 'status_example', # String | Filter on the status of the campaign +opts = { + type: 'classic', # String | Filter on the type of the campaigns + status: 'suspended', # String | Filter on the status of the campaign start_date: 'start_date_example', # String | Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) end_date: 'end_date_example', # String | Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) - limit: 500, # Integer | Number of documents per page - offset: 0, # Integer | Index of the first document in the page - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + limit: 789, # Integer | Number of documents per page + offset: 789, # Integer | Index of the first document in the page + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Return all your created email campaigns + # Return all your created email campaigns result = api_instance.get_email_campaigns(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling EmailCampaignsApi->get_email_campaigns: #{e}" + puts "Error when calling EmailCampaignsApi->get_email_campaigns: #{e}" +end +``` + +#### Using the get_email_campaigns_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_email_campaigns_with_http_info(opts) + +```ruby +begin + # Return all your created email campaigns + data, status_code, headers = api_instance.get_email_campaigns_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling EmailCampaignsApi->get_email_campaigns_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **type** | **String**| Filter on the type of the campaigns | [optional] - **status** | **String**| Filter on the status of the campaign | [optional] - **start_date** | **String**| Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) | [optional] - **end_date** | **String**| Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) | [optional] - **limit** | **Integer**| Number of documents per page | [optional] [default to 500] - **offset** | **Integer**| Index of the first document in the page | [optional] [default to 0] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | Filter on the type of the campaigns | [optional] | +| **status** | **String** | Filter on the status of the campaign | [optional] | +| **start_date** | **String** | Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) | [optional] | +| **end_date** | **String** | Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) | [optional] | +| **limit** | **Integer** | Number of documents per page | [optional][default to 500] | +| **offset** | **Integer** | Index of the first document in the page | [optional][default to 0] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -374,54 +478,71 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json, applications/json +## get_shared_template_url -# **get_shared_template_url** -> GetSharedTemplateUrl get_shared_template_url(campaign_id) +> get_shared_template_url(campaign_id) Get a shared template url Get a unique URL to share & import an email template from one Sendinblue account to another. -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::EmailCampaignsApi.new - campaign_id = 789 # Integer | Id of the campaign or template - begin - #Get a shared template url + # Get a shared template url result = api_instance.get_shared_template_url(campaign_id) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling EmailCampaignsApi->get_shared_template_url: #{e}" + puts "Error when calling EmailCampaignsApi->get_shared_template_url: #{e}" +end +``` + +#### Using the get_shared_template_url_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_shared_template_url_with_http_info(campaign_id) + +```ruby +begin + # Get a shared template url + data, status_code, headers = api_instance.get_shared_template_url_with_http_info(campaign_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling EmailCampaignsApi->get_shared_template_url_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | **Integer**| Id of the campaign or template | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | Id of the campaign or template | | ### Return type @@ -433,51 +554,68 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## send_email_campaign_now -# **send_email_campaign_now** > send_email_campaign_now(campaign_id) Send an email campaign immediately, based on campaignId -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::EmailCampaignsApi.new - campaign_id = 789 # Integer | Id of the campaign - begin - #Send an email campaign immediately, based on campaignId + # Send an email campaign immediately, based on campaignId api_instance.send_email_campaign_now(campaign_id) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling EmailCampaignsApi->send_email_campaign_now: #{e}" + puts "Error when calling EmailCampaignsApi->send_email_campaign_now: #{e}" +end +``` + +#### Using the send_email_campaign_now_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> send_email_campaign_now_with_http_info(campaign_id) + +```ruby +begin + # Send an email campaign immediately, based on campaignId + data, status_code, headers = api_instance.send_email_campaign_now_with_http_info(campaign_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling EmailCampaignsApi->send_email_campaign_now_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | **Integer**| Id of the campaign | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | Id of the campaign | | ### Return type @@ -489,56 +627,72 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## send_report -# **send_report** > send_report(campaign_id, send_report) Send the report of a campaign A PDF will be sent to the specified email addresses -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::EmailCampaignsApi.new - campaign_id = 789 # Integer | Id of the campaign +send_report = SibApiV3Sdk::SendReport.new({email: SibApiV3Sdk::SendReportEmail.new({to: ['jim.suehan@example.com'], body: 'Please find attached the report of our last email campaign.'})}) # SendReport | Values for send a report -send_report = SibApiV3Sdk::SendReport.new # SendReport | Values for send a report +begin + # Send the report of a campaign + api_instance.send_report(campaign_id, send_report) +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling EmailCampaignsApi->send_report: #{e}" +end +``` + +#### Using the send_report_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. +> send_report_with_http_info(campaign_id, send_report) +```ruby begin - #Send the report of a campaign - api_instance.send_report(campaign_id, send_report) + # Send the report of a campaign + data, status_code, headers = api_instance.send_report_with_http_info(campaign_id, send_report) + p status_code # => 2xx + p headers # => { ... } + p data # => nil rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling EmailCampaignsApi->send_report: #{e}" + puts "Error when calling EmailCampaignsApi->send_report_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | **Integer**| Id of the campaign | - **send_report** | [**SendReport**](SendReport.md)| Values for send a report | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | Id of the campaign | | +| **send_report** | [**SendReport**](SendReport.md) | Values for send a report | | ### Return type @@ -550,54 +704,70 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## send_test_email -# **send_test_email** > send_test_email(campaign_id, email_to) Send an email campaign to your test list -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::EmailCampaignsApi.new - campaign_id = 789 # Integer | Id of the campaign - email_to = SibApiV3Sdk::SendTestEmail.new # SendTestEmail | - begin - #Send an email campaign to your test list + # Send an email campaign to your test list api_instance.send_test_email(campaign_id, email_to) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling EmailCampaignsApi->send_test_email: #{e}" + puts "Error when calling EmailCampaignsApi->send_test_email: #{e}" +end +``` + +#### Using the send_test_email_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> send_test_email_with_http_info(campaign_id, email_to) + +```ruby +begin + # Send an email campaign to your test list + data, status_code, headers = api_instance.send_test_email_with_http_info(campaign_id, email_to) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling EmailCampaignsApi->send_test_email_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | **Integer**| Id of the campaign | - **email_to** | [**SendTestEmail**](SendTestEmail.md)| | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | Id of the campaign | | +| **email_to** | [**SendTestEmail**](SendTestEmail.md) | | | ### Return type @@ -609,54 +779,70 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## update_campaign_status -# **update_campaign_status** > update_campaign_status(campaign_id, status) Update an email campaign status -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::EmailCampaignsApi.new - campaign_id = 789 # Integer | Id of the campaign - status = SibApiV3Sdk::UpdateCampaignStatus.new # UpdateCampaignStatus | Status of the campaign - begin - #Update an email campaign status + # Update an email campaign status api_instance.update_campaign_status(campaign_id, status) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling EmailCampaignsApi->update_campaign_status: #{e}" + puts "Error when calling EmailCampaignsApi->update_campaign_status: #{e}" +end +``` + +#### Using the update_campaign_status_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_campaign_status_with_http_info(campaign_id, status) + +```ruby +begin + # Update an email campaign status + data, status_code, headers = api_instance.update_campaign_status_with_http_info(campaign_id, status) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling EmailCampaignsApi->update_campaign_status_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | **Integer**| Id of the campaign | - **status** | [**UpdateCampaignStatus**](UpdateCampaignStatus.md)| Status of the campaign | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | Id of the campaign | | +| **status** | [**UpdateCampaignStatus**](UpdateCampaignStatus.md) | Status of the campaign | | ### Return type @@ -668,54 +854,70 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## update_email_campaign -# **update_email_campaign** > update_email_campaign(campaign_id, email_campaign) Update an email campaign -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::EmailCampaignsApi.new - campaign_id = 789 # Integer | Id of the campaign - email_campaign = SibApiV3Sdk::UpdateEmailCampaign.new # UpdateEmailCampaign | Values to update a campaign - begin - #Update an email campaign + # Update an email campaign api_instance.update_email_campaign(campaign_id, email_campaign) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling EmailCampaignsApi->update_email_campaign: #{e}" + puts "Error when calling EmailCampaignsApi->update_email_campaign: #{e}" +end +``` + +#### Using the update_email_campaign_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_email_campaign_with_http_info(campaign_id, email_campaign) + +```ruby +begin + # Update an email campaign + data, status_code, headers = api_instance.update_email_campaign_with_http_info(campaign_id, email_campaign) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling EmailCampaignsApi->update_email_campaign_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | **Integer**| Id of the campaign | - **email_campaign** | [**UpdateEmailCampaign**](UpdateEmailCampaign.md)| Values to update a campaign | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | Id of the campaign | | +| **email_campaign** | [**UpdateEmailCampaign**](UpdateEmailCampaign.md) | Values to update a campaign | | ### Return type @@ -727,51 +929,68 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## upload_image_to_gallery -# **upload_image_to_gallery** > upload_image_to_gallery(upload_image) Upload an image to your account's image gallery -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::EmailCampaignsApi.new +upload_image = SibApiV3Sdk::UploadImageToGallery.new({image_url: 'https://somedomain.com/image1.jpg'}) # UploadImageToGallery | Parameters to upload an image -upload_image = SibApiV3Sdk::UploadImageToGallery.new # UploadImageToGallery | Parameters to upload an image +begin + # Upload an image to your account's image gallery + api_instance.upload_image_to_gallery(upload_image) +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling EmailCampaignsApi->upload_image_to_gallery: #{e}" +end +``` + +#### Using the upload_image_to_gallery_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. +> upload_image_to_gallery_with_http_info(upload_image) +```ruby begin - #Upload an image to your account's image gallery - api_instance.upload_image_to_gallery(upload_image) + # Upload an image to your account's image gallery + data, status_code, headers = api_instance.upload_image_to_gallery_with_http_info(upload_image) + p status_code # => 2xx + p headers # => { ... } + p data # => nil rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling EmailCampaignsApi->upload_image_to_gallery: #{e}" + puts "Error when calling EmailCampaignsApi->upload_image_to_gallery_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **upload_image** | [**UploadImageToGallery**](UploadImageToGallery.md)| Parameters to upload an image | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **upload_image** | [**UploadImageToGallery**](UploadImageToGallery.md) | Parameters to upload an image | | ### Return type @@ -783,8 +1002,6 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - - +- **Content-Type**: application/json +- **Accept**: application/json diff --git a/docs/EmailExportRecipients.md b/docs/EmailExportRecipients.md index fdbb8e3..88cc25c 100644 --- a/docs/EmailExportRecipients.md +++ b/docs/EmailExportRecipients.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::EmailExportRecipients ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**notify_url** | **String** | Webhook called once the export process is finished. For reference, https://help.sendinblue.com/hc/en-us/articles/360007666479 | [optional] -**recipients_type** | **String** | Type of recipients to export for a campaign | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **notify_url** | **String** | Webhook called once the export process is finished. For reference, https://help.sendinblue.com/hc/en-us/articles/360007666479 | [optional] | +| **recipients_type** | **String** | Type of recipients to export for a campaign | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::EmailExportRecipients.new( + notify_url: http://requestb.in/173lyyx1, + recipients_type: openers +) +``` diff --git a/docs/ErrorModel.md b/docs/ErrorModel.md index ca0ba5a..3924db5 100644 --- a/docs/ErrorModel.md +++ b/docs/ErrorModel.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::ErrorModel ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **String** | Error code displayed in case of a failure | -**message** | **String** | Readable message associated to the failure | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **code** | **String** | Error code displayed in case of a failure | | +| **message** | **String** | Readable message associated to the failure | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::ErrorModel.new( + code: method_not_allowed, + message: POST Method is not allowed on this path +) +``` diff --git a/docs/FoldersApi.md b/docs/FoldersApi.md index 37eccd9..bcff91d 100644 --- a/docs/FoldersApi.md +++ b/docs/FoldersApi.md @@ -2,57 +2,75 @@ All URIs are relative to *https://api.sendinblue.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_folder**](FoldersApi.md#create_folder) | **POST** /contacts/folders | Create a folder -[**delete_folder**](FoldersApi.md#delete_folder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists) -[**get_folder**](FoldersApi.md#get_folder) | **GET** /contacts/folders/{folderId} | Returns a folder's details -[**get_folder_lists**](FoldersApi.md#get_folder_lists) | **GET** /contacts/folders/{folderId}/lists | Get lists in a folder -[**get_folders**](FoldersApi.md#get_folders) | **GET** /contacts/folders | Get all folders -[**update_folder**](FoldersApi.md#update_folder) | **PUT** /contacts/folders/{folderId} | Update a folder +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**create_folder**](FoldersApi.md#create_folder) | **POST** /contacts/folders | Create a folder | +| [**delete_folder**](FoldersApi.md#delete_folder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists) | +| [**get_folder**](FoldersApi.md#get_folder) | **GET** /contacts/folders/{folderId} | Returns a folder's details | +| [**get_folder_lists**](FoldersApi.md#get_folder_lists) | **GET** /contacts/folders/{folderId}/lists | Get lists in a folder | +| [**get_folders**](FoldersApi.md#get_folders) | **GET** /contacts/folders | Get all folders | +| [**update_folder**](FoldersApi.md#update_folder) | **PUT** /contacts/folders/{folderId} | Update a folder | -# **create_folder** -> CreateModel create_folder(create_folder) +## create_folder + +> create_folder(create_folder) Create a folder -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::FoldersApi.new - create_folder = SibApiV3Sdk::CreateUpdateFolder.new # CreateUpdateFolder | Name of the folder - begin - #Create a folder + # Create a folder result = api_instance.create_folder(create_folder) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling FoldersApi->create_folder: #{e}" + puts "Error when calling FoldersApi->create_folder: #{e}" +end +``` + +#### Using the create_folder_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_folder_with_http_info(create_folder) + +```ruby +begin + # Create a folder + data, status_code, headers = api_instance.create_folder_with_http_info(create_folder) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling FoldersApi->create_folder_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **create_folder** | [**CreateUpdateFolder**](CreateUpdateFolder.md)| Name of the folder | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **create_folder** | [**CreateUpdateFolder**](CreateUpdateFolder.md) | Name of the folder | | ### Return type @@ -64,51 +82,68 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## delete_folder -# **delete_folder** > delete_folder(folder_id) Delete a folder (and all its lists) -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::FoldersApi.new - folder_id = 789 # Integer | Id of the folder - begin - #Delete a folder (and all its lists) + # Delete a folder (and all its lists) api_instance.delete_folder(folder_id) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling FoldersApi->delete_folder: #{e}" + puts "Error when calling FoldersApi->delete_folder: #{e}" +end +``` + +#### Using the delete_folder_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_folder_with_http_info(folder_id) + +```ruby +begin + # Delete a folder (and all its lists) + data, status_code, headers = api_instance.delete_folder_with_http_info(folder_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling FoldersApi->delete_folder_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **folder_id** | **Integer**| Id of the folder | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **folder_id** | **Integer** | Id of the folder | | ### Return type @@ -120,52 +155,69 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_folder -# **get_folder** -> GetFolder get_folder(folder_id) +> get_folder(folder_id) Returns a folder's details -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::FoldersApi.new - folder_id = 789 # Integer | id of the folder - begin - #Returns a folder's details + # Returns a folder's details result = api_instance.get_folder(folder_id) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling FoldersApi->get_folder: #{e}" + puts "Error when calling FoldersApi->get_folder: #{e}" +end +``` + +#### Using the get_folder_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_folder_with_http_info(folder_id) + +```ruby +begin + # Returns a folder's details + data, status_code, headers = api_instance.get_folder_with_http_info(folder_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling FoldersApi->get_folder_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **folder_id** | **Integer**| id of the folder | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **folder_id** | **Integer** | id of the folder | | ### Return type @@ -177,60 +229,77 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_folder_lists -# **get_folder_lists** -> GetFolderLists get_folder_lists(folder_id, opts) +> get_folder_lists(folder_id, opts) Get lists in a folder -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::FoldersApi.new - folder_id = 789 # Integer | Id of the folder - -opts = { - limit: 10, # Integer | Number of documents per page - offset: 0, # Integer | Index of the first document of the page - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed +opts = { + limit: 789, # Integer | Number of documents per page + offset: 789, # Integer | Index of the first document of the page + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Get lists in a folder + # Get lists in a folder result = api_instance.get_folder_lists(folder_id, opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling FoldersApi->get_folder_lists: #{e}" + puts "Error when calling FoldersApi->get_folder_lists: #{e}" +end +``` + +#### Using the get_folder_lists_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_folder_lists_with_http_info(folder_id, opts) + +```ruby +begin + # Get lists in a folder + data, status_code, headers = api_instance.get_folder_lists_with_http_info(folder_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling FoldersApi->get_folder_lists_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **folder_id** | **Integer**| Id of the folder | - **limit** | **Integer**| Number of documents per page | [optional] [default to 10] - **offset** | **Integer**| Index of the first document of the page | [optional] [default to 0] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **folder_id** | **Integer** | Id of the folder | | +| **limit** | **Integer** | Number of documents per page | [optional][default to 10] | +| **offset** | **Integer** | Index of the first document of the page | [optional][default to 0] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -242,59 +311,75 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_folders -# **get_folders** -> GetFolders get_folders(limit, offset, opts) +> get_folders(limit, offset, opts) Get all folders -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::FoldersApi.new - -limit = 10 # Integer | Number of documents per page - -offset = 0 # Integer | Index of the first document of the page - -opts = { - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed +limit = 789 # Integer | Number of documents per page +offset = 789 # Integer | Index of the first document of the page +opts = { + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Get all folders + # Get all folders result = api_instance.get_folders(limit, offset, opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling FoldersApi->get_folders: #{e}" + puts "Error when calling FoldersApi->get_folders: #{e}" +end +``` + +#### Using the get_folders_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_folders_with_http_info(limit, offset, opts) + +```ruby +begin + # Get all folders + data, status_code, headers = api_instance.get_folders_with_http_info(limit, offset, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling FoldersApi->get_folders_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **limit** | **Integer**| Number of documents per page | [default to 10] - **offset** | **Integer**| Index of the first document of the page | [default to 0] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **limit** | **Integer** | Number of documents per page | [default to 10] | +| **offset** | **Integer** | Index of the first document of the page | [default to 0] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -306,54 +391,70 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## update_folder -# **update_folder** > update_folder(folder_id, update_folder) Update a folder -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::FoldersApi.new - folder_id = 789 # Integer | Id of the folder - update_folder = SibApiV3Sdk::CreateUpdateFolder.new # CreateUpdateFolder | Name of the folder - begin - #Update a folder + # Update a folder api_instance.update_folder(folder_id, update_folder) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling FoldersApi->update_folder: #{e}" + puts "Error when calling FoldersApi->update_folder: #{e}" +end +``` + +#### Using the update_folder_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_folder_with_http_info(folder_id, update_folder) + +```ruby +begin + # Update a folder + data, status_code, headers = api_instance.update_folder_with_http_info(folder_id, update_folder) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling FoldersApi->update_folder_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **folder_id** | **Integer**| Id of the folder | - **update_folder** | [**CreateUpdateFolder**](CreateUpdateFolder.md)| Name of the folder | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **folder_id** | **Integer** | Id of the folder | | +| **update_folder** | [**CreateUpdateFolder**](CreateUpdateFolder.md) | Name of the folder | | ### Return type @@ -365,8 +466,6 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - - +- **Content-Type**: application/json +- **Accept**: application/json diff --git a/docs/GetAccount.md b/docs/GetAccount.md index 99ff97d..72fe7ab 100644 --- a/docs/GetAccount.md +++ b/docs/GetAccount.md @@ -1,15 +1,32 @@ # SibApiV3Sdk::GetAccount ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | Login Email | -**first_name** | **String** | First Name | -**last_name** | **String** | Last Name | -**company_name** | **String** | Name of the company | -**address** | [**GetExtendedClientAddress**](GetExtendedClientAddress.md) | | -**plan** | [**Array<GetAccountPlan>**](GetAccountPlan.md) | Information about your plans and credits | -**relay** | [**GetAccountRelay**](GetAccountRelay.md) | | -**marketing_automation** | [**GetAccountMarketingAutomation**](GetAccountMarketingAutomation.md) | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Login Email | | +| **first_name** | **String** | First Name | | +| **last_name** | **String** | Last Name | | +| **company_name** | **String** | Name of the company | | +| **address** | [**GetExtendedClientAllOfAddress**](GetExtendedClientAllOfAddress.md) | | | +| **plan** | [**Array<GetAccountAllOfPlan>**](GetAccountAllOfPlan.md) | Information about your plans and credits | | +| **relay** | [**GetAccountAllOfRelay**](GetAccountAllOfRelay.md) | | | +| **marketing_automation** | [**GetAccountAllOfMarketingAutomation**](GetAccountAllOfMarketingAutomation.md) | | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetAccount.new( + email: john.smith@example.com, + first_name: John, + last_name: Smith, + company_name: MyCompany, + address: null, + plan: null, + relay: null, + marketing_automation: null +) +``` diff --git a/docs/GetAccountAllOf.md b/docs/GetAccountAllOf.md new file mode 100644 index 0000000..91685ff --- /dev/null +++ b/docs/GetAccountAllOf.md @@ -0,0 +1,22 @@ +# SibApiV3Sdk::GetAccountAllOf + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **plan** | [**Array<GetAccountAllOfPlan>**](GetAccountAllOfPlan.md) | Information about your plans and credits | | +| **relay** | [**GetAccountAllOfRelay**](GetAccountAllOfRelay.md) | | | +| **marketing_automation** | [**GetAccountAllOfMarketingAutomation**](GetAccountAllOfMarketingAutomation.md) | | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetAccountAllOf.new( + plan: null, + relay: null, + marketing_automation: null +) +``` + diff --git a/docs/GetAccountAllOfMarketingAutomation.md b/docs/GetAccountAllOfMarketingAutomation.md new file mode 100644 index 0000000..a5622a0 --- /dev/null +++ b/docs/GetAccountAllOfMarketingAutomation.md @@ -0,0 +1,20 @@ +# SibApiV3Sdk::GetAccountAllOfMarketingAutomation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **key** | **String** | Marketing Automation Tracker ID | [optional] | +| **enabled** | **Boolean** | Status of Marketing Automation Plateform activation for your account (true=enabled, false=disabled) | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetAccountAllOfMarketingAutomation.new( + key: iso05aopqych87ysy0jymf, + enabled: false +) +``` + diff --git a/docs/GetAccountAllOfPlan.md b/docs/GetAccountAllOfPlan.md new file mode 100644 index 0000000..cd01642 --- /dev/null +++ b/docs/GetAccountAllOfPlan.md @@ -0,0 +1,28 @@ +# SibApiV3Sdk::GetAccountAllOfPlan + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | Displays the plan type of the user | | +| **credits_type** | **String** | This is the type of the credit, \"Send Limit\" is one of the possible types of credit of a user. \"Send Limit\" implies the total number of emails you can send to the subscribers in your account. | | +| **credits** | **Float** | Remaining credits of the user | | +| **start_date** | **Date** | Date of the period from which the plan will start (only available for \"subscription\" and \"reseller\" plan type) | [optional] | +| **end_date** | **Date** | Date of the period from which the plan will end (only available for \"subscription\" and \"reseller\" plan type) | [optional] | +| **user_limit** | **Integer** | Only in case of reseller account. It implies the total number of child accounts you can add to your account. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetAccountAllOfPlan.new( + type: subscription, + credits_type: sendLimit, + credits: 8755.0, + start_date: Sat Dec 31 05:30:00 IST 2016, + end_date: Tue Jan 31 05:30:00 IST 2017, + user_limit: 10 +) +``` + diff --git a/docs/GetAccountAllOfRelay.md b/docs/GetAccountAllOfRelay.md new file mode 100644 index 0000000..efe0406 --- /dev/null +++ b/docs/GetAccountAllOfRelay.md @@ -0,0 +1,20 @@ +# SibApiV3Sdk::GetAccountAllOfRelay + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **enabled** | **Boolean** | Status of your transactional email Account (true=Enabled, false=Disabled) | | +| **data** | [**GetAccountAllOfRelayData**](GetAccountAllOfRelayData.md) | | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetAccountAllOfRelay.new( + enabled: true, + data: null +) +``` + diff --git a/docs/GetAccountAllOfRelayData.md b/docs/GetAccountAllOfRelayData.md new file mode 100644 index 0000000..949befd --- /dev/null +++ b/docs/GetAccountAllOfRelayData.md @@ -0,0 +1,22 @@ +# SibApiV3Sdk::GetAccountAllOfRelayData + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user_name** | **String** | Email to use as login on transactional platform | | +| **relay** | **String** | URL of the SMTP Relay | | +| **port** | **Integer** | Port used for SMTP Relay | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetAccountAllOfRelayData.new( + user_name: john.smith@example.com, + relay: relay.domain.com, + port: 125 +) +``` + diff --git a/docs/GetAccountMarketingAutomation.md b/docs/GetAccountMarketingAutomation.md deleted file mode 100644 index f97a643..0000000 --- a/docs/GetAccountMarketingAutomation.md +++ /dev/null @@ -1,9 +0,0 @@ -# SibApiV3Sdk::GetAccountMarketingAutomation - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**key** | **String** | Marketing Automation Tracker ID | [optional] -**enabled** | **BOOLEAN** | Status of Marketing Automation Plateform activation for your account (true=enabled, false=disabled) | - - diff --git a/docs/GetAccountPlan.md b/docs/GetAccountPlan.md deleted file mode 100644 index a2cb418..0000000 --- a/docs/GetAccountPlan.md +++ /dev/null @@ -1,13 +0,0 @@ -# SibApiV3Sdk::GetAccountPlan - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **String** | Displays the plan type of the user | -**credits_type** | **String** | This is the type of the credit, \"Send Limit\" is one of the possible types of credit of a user. \"Send Limit\" implies the total number of emails you can send to the subscribers in your account. | -**credits** | **Float** | Remaining credits of the user | -**start_date** | **Date** | Date of the period from which the plan will start (only available for \"subscription\" and \"reseller\" plan type) | [optional] -**end_date** | **Date** | Date of the period from which the plan will end (only available for \"subscription\" and \"reseller\" plan type) | [optional] -**user_limit** | **Integer** | Only in case of reseller account. It implies the total number of child accounts you can add to your account. | [optional] - - diff --git a/docs/GetAccountRelay.md b/docs/GetAccountRelay.md deleted file mode 100644 index 94f1826..0000000 --- a/docs/GetAccountRelay.md +++ /dev/null @@ -1,9 +0,0 @@ -# SibApiV3Sdk::GetAccountRelay - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enabled** | **BOOLEAN** | Status of your transactional email Account (true=Enabled, false=Disabled) | -**data** | [**GetAccountRelayData**](GetAccountRelayData.md) | | - - diff --git a/docs/GetAccountRelayData.md b/docs/GetAccountRelayData.md deleted file mode 100644 index 7bf887a..0000000 --- a/docs/GetAccountRelayData.md +++ /dev/null @@ -1,10 +0,0 @@ -# SibApiV3Sdk::GetAccountRelayData - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**user_name** | **String** | Email to use as login on transactional platform | -**relay** | **String** | URL of the SMTP Relay | -**port** | **Integer** | Port used for SMTP Relay | - - diff --git a/docs/GetAggregatedReport.md b/docs/GetAggregatedReport.md index c05ee4d..46e8ae1 100644 --- a/docs/GetAggregatedReport.md +++ b/docs/GetAggregatedReport.md @@ -1,20 +1,42 @@ # SibApiV3Sdk::GetAggregatedReport ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**range** | **String** | Time frame of the report | [optional] -**requests** | **Integer** | Number of requests for the timeframe | [optional] -**delivered** | **Integer** | Number of delivered emails for the timeframe | [optional] -**hard_bounces** | **Integer** | Number of hardbounces for the timeframe | [optional] -**soft_bounces** | **Integer** | Number of softbounces for the timeframe | [optional] -**clicks** | **Integer** | Number of clicks for the timeframe | [optional] -**unique_clicks** | **Integer** | Number of unique clicks for the timeframe | [optional] -**opens** | **Integer** | Number of openings for the timeframe | [optional] -**unique_opens** | **Integer** | Number of unique openings for the timeframe | [optional] -**spam_reports** | **Integer** | Number of complaint (spam report) for the timeframe | [optional] -**blocked** | **Integer** | Number of blocked contact emails for the timeframe | [optional] -**invalid** | **Integer** | Number of invalid emails for the timeframe | [optional] -**unsubscribed** | **Integer** | Number of unsubscribed emails for the timeframe | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **range** | **String** | Time frame of the report | [optional] | +| **requests** | **Integer** | Number of requests for the timeframe | [optional] | +| **delivered** | **Integer** | Number of delivered emails for the timeframe | [optional] | +| **hard_bounces** | **Integer** | Number of hardbounces for the timeframe | [optional] | +| **soft_bounces** | **Integer** | Number of softbounces for the timeframe | [optional] | +| **clicks** | **Integer** | Number of clicks for the timeframe | [optional] | +| **unique_clicks** | **Integer** | Number of unique clicks for the timeframe | [optional] | +| **opens** | **Integer** | Number of openings for the timeframe | [optional] | +| **unique_opens** | **Integer** | Number of unique openings for the timeframe | [optional] | +| **spam_reports** | **Integer** | Number of complaint (spam report) for the timeframe | [optional] | +| **blocked** | **Integer** | Number of blocked contact emails for the timeframe | [optional] | +| **invalid** | **Integer** | Number of invalid emails for the timeframe | [optional] | +| **unsubscribed** | **Integer** | Number of unsubscribed emails for the timeframe | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetAggregatedReport.new( + range: 2016-09-08|2017-04-06, + requests: 263, + delivered: 249, + hard_bounces: 1, + soft_bounces: 4, + clicks: 12, + unique_clicks: 8, + opens: 47, + unique_opens: 37, + spam_reports: 0, + blocked: 2, + invalid: 0, + unsubscribed: 0 +) +``` diff --git a/docs/GetAttributes.md b/docs/GetAttributes.md index 4adbef5..8a77c94 100644 --- a/docs/GetAttributes.md +++ b/docs/GetAttributes.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::GetAttributes ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attributes** | [**Array<GetAttributesAttributes>**](GetAttributesAttributes.md) | Listing of available contact attributes in your account | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **attributes** | [**Array<GetAttributesAttributes>**](GetAttributesAttributes.md) | Listing of available contact attributes in your account | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetAttributes.new( + attributes: null +) +``` diff --git a/docs/GetAttributesAttributes.md b/docs/GetAttributesAttributes.md index 8c1d47e..d871ffc 100644 --- a/docs/GetAttributesAttributes.md +++ b/docs/GetAttributesAttributes.md @@ -1,12 +1,26 @@ # SibApiV3Sdk::GetAttributesAttributes ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Name of the attribute | -**category** | **String** | Category of the attribute | -**type** | **String** | Type of the attribute | [optional] -**enumeration** | [**Array<GetAttributesEnumeration>**](GetAttributesEnumeration.md) | Parameter only available for \"category\" type attributes. | [optional] -**calculated_value** | **String** | Calculated value formula | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of the attribute | | +| **category** | **String** | Category of the attribute | | +| **type** | **String** | Type of the attribute | [optional] | +| **enumeration** | [**Array<GetAttributesEnumeration>**](GetAttributesEnumeration.md) | Parameter only available for \"category\" type attributes. | [optional] | +| **calculated_value** | **String** | Calculated value formula | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetAttributesAttributes.new( + name: LASTNAME, + category: category, + type: text, + enumeration: null, + calculated_value: COUNT[ORDER_ID,ORDER_DATE,==,NOW(-1)] +) +``` diff --git a/docs/GetAttributesEnumeration.md b/docs/GetAttributesEnumeration.md index 8295ec5..5506ca3 100644 --- a/docs/GetAttributesEnumeration.md +++ b/docs/GetAttributesEnumeration.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::GetAttributesEnumeration ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **Integer** | ID of Value of the \"category\" type attribute | -**label** | **String** | Label of the \"category\" type attribute | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **value** | **Integer** | ID of Value of the \"category\" type attribute | | +| **label** | **String** | Label of the \"category\" type attribute | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetAttributesEnumeration.new( + value: 1, + label: Women +) +``` diff --git a/docs/GetBlockedDomains.md b/docs/GetBlockedDomains.md index 58b0736..65ebe30 100644 --- a/docs/GetBlockedDomains.md +++ b/docs/GetBlockedDomains.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::GetBlockedDomains ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**domains** | **Array<String>** | List of all blocked domains | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **domains** | **Array<String>** | List of all blocked domains | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetBlockedDomains.new( + domains: null +) +``` diff --git a/docs/GetCampaignOverview.md b/docs/GetCampaignOverview.md index 18e8d0d..bfc0d16 100644 --- a/docs/GetCampaignOverview.md +++ b/docs/GetCampaignOverview.md @@ -1,20 +1,42 @@ # SibApiV3Sdk::GetCampaignOverview ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | ID of the campaign | -**name** | **String** | Name of the campaign | -**subject** | **String** | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` | [optional] -**type** | **String** | Type of campaign | -**status** | **String** | Status of the campaign | -**scheduled_at** | **String** | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional] -**ab_testing** | **BOOLEAN** | Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. | [optional] -**subject_a** | **String** | Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional] -**subject_b** | **String** | Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional] -**split_rule** | **Integer** | The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` | [optional] -**winner_criteria** | **String** | Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` | [optional] -**winner_delay** | **Integer** | The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` | [optional] -**send_at_best_time** | **BOOLEAN** | It is true if you have chosen to send your campaign at best time, otherwise it is false | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **Integer** | ID of the campaign | | +| **name** | **String** | Name of the campaign | | +| **subject** | **String** | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` | [optional] | +| **type** | **String** | Type of campaign | | +| **status** | **String** | Status of the campaign | | +| **scheduled_at** | **String** | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional] | +| **ab_testing** | **Boolean** | Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. | [optional] | +| **subject_a** | **String** | Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional] | +| **subject_b** | **String** | Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional] | +| **split_rule** | **Integer** | The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` | [optional] | +| **winner_criteria** | **String** | Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` | [optional] | +| **winner_delay** | **Integer** | The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` | [optional] | +| **send_at_best_time** | **Boolean** | It is true if you have chosen to send your campaign at best time, otherwise it is false | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetCampaignOverview.new( + id: 12, + name: EN - Sales Summer 2017, + subject: 20% OFF for 2017 Summer Sales, + type: classic, + status: sent, + scheduled_at: 2017-06-01T12:30:00Z, + ab_testing: true, + subject_a: Discover the New Collection!, + subject_b: Want to discover the New Collection?, + split_rule: 25, + winner_criteria: open, + winner_delay: 50, + send_at_best_time: true +) +``` diff --git a/docs/GetCampaignRecipients.md b/docs/GetCampaignRecipients.md index 5dd1def..ce955aa 100644 --- a/docs/GetCampaignRecipients.md +++ b/docs/GetCampaignRecipients.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::GetCampaignRecipients ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**lists** | **Array<Integer>** | | -**exclusion_lists** | **Array<Integer>** | | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **lists** | **Array<Integer>** | | | +| **exclusion_lists** | **Array<Integer>** | | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetCampaignRecipients.new( + lists: null, + exclusion_lists: null +) +``` diff --git a/docs/GetCampaignStats.md b/docs/GetCampaignStats.md index 9a504f3..3d1e61b 100644 --- a/docs/GetCampaignStats.md +++ b/docs/GetCampaignStats.md @@ -1,20 +1,42 @@ # SibApiV3Sdk::GetCampaignStats ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**list_id** | **Integer** | List Id of email campaign (only in case of get email campaign(s)(not for global stats)) | [optional] -**unique_clicks** | **Integer** | Number of unique clicks for the campaign | -**clickers** | **Integer** | Number of total clicks for the campaign | -**complaints** | **Integer** | Number of complaints (Spam reports) for the campaign | -**delivered** | **Integer** | Number of delivered emails for the campaign | -**sent** | **Integer** | Number of sent emails for the campaign | -**soft_bounces** | **Integer** | Number of softbounce for the campaign | -**hard_bounces** | **Integer** | Number of harbounce for the campaign | -**unique_views** | **Integer** | Number of unique openings for the campaign | -**unsubscriptions** | **Integer** | Number of unsubscription for the campaign | -**viewed** | **Integer** | Number of openings for the campaign | -**deferred** | **Integer** | Number of deferred emails for the campaign | [optional] -**return_bounce** | **Integer** | Total number of non-delivered campaigns for a particular campaign id. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **list_id** | **Integer** | List Id of email campaign (only in case of get email campaign(s)(not for global stats)) | [optional] | +| **unique_clicks** | **Integer** | Number of unique clicks for the campaign | | +| **clickers** | **Integer** | Number of total clicks for the campaign | | +| **complaints** | **Integer** | Number of complaints (Spam reports) for the campaign | | +| **delivered** | **Integer** | Number of delivered emails for the campaign | | +| **sent** | **Integer** | Number of sent emails for the campaign | | +| **soft_bounces** | **Integer** | Number of softbounce for the campaign | | +| **hard_bounces** | **Integer** | Number of harbounce for the campaign | | +| **unique_views** | **Integer** | Number of unique openings for the campaign | | +| **unsubscriptions** | **Integer** | Number of unsubscription for the campaign | | +| **viewed** | **Integer** | Number of openings for the campaign | | +| **deferred** | **Integer** | Number of deferred emails for the campaign | [optional] | +| **return_bounce** | **Integer** | Total number of non-delivered campaigns for a particular campaign id. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetCampaignStats.new( + list_id: 2, + unique_clicks: 2300, + clickers: 2665, + complaints: 1, + delivered: 19765, + sent: 19887, + soft_bounces: 100, + hard_bounces: 87, + unique_views: 7779, + unsubscriptions: 2, + viewed: 8999, + deferred: 30, + return_bounce: 5 +) +``` diff --git a/docs/GetChildAccountCreationStatus.md b/docs/GetChildAccountCreationStatus.md index c4b7abe..66a08c5 100644 --- a/docs/GetChildAccountCreationStatus.md +++ b/docs/GetChildAccountCreationStatus.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::GetChildAccountCreationStatus ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**child_account_created** | **BOOLEAN** | Status of child account creation whether it is successfully created (exists) or not. | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **child_account_created** | **Boolean** | Status of child account creation whether it is successfully created (exists) or not. | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetChildAccountCreationStatus.new( + child_account_created: true +) +``` diff --git a/docs/GetChildDomain.md b/docs/GetChildDomain.md index c7550b4..1734706 100644 --- a/docs/GetChildDomain.md +++ b/docs/GetChildDomain.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::GetChildDomain ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**domain** | **String** | Sender domain | [optional] -**active** | **BOOLEAN** | indicates whether a domain is verified or not | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **domain** | **String** | Sender domain | [optional] | +| **active** | **Boolean** | indicates whether a domain is verified or not | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetChildDomain.new( + domain: mycustomdomain.com, + active: true +) +``` diff --git a/docs/GetChildDomains.md b/docs/GetChildDomains.md deleted file mode 100644 index b015292..0000000 --- a/docs/GetChildDomains.md +++ /dev/null @@ -1,7 +0,0 @@ -# SibApiV3Sdk::GetChildDomains - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - diff --git a/docs/GetChildInfo.md b/docs/GetChildInfo.md index bea0dbf..232828a 100644 --- a/docs/GetChildInfo.md +++ b/docs/GetChildInfo.md @@ -1,16 +1,34 @@ # SibApiV3Sdk::GetChildInfo ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | Login Email | -**first_name** | **String** | First Name | -**last_name** | **String** | Last Name | -**company_name** | **String** | Name of the company | -**credits** | [**GetChildInfoCredits**](GetChildInfoCredits.md) | | [optional] -**statistics** | [**GetChildInfoStatistics**](GetChildInfoStatistics.md) | | [optional] -**password** | **String** | The encrypted password of child account | -**ips** | **Array<String>** | IP(s) associated to a child account user | [optional] -**api_keys** | [**GetChildInfoApiKeys**](GetChildInfoApiKeys.md) | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Login Email | | +| **first_name** | **String** | First Name | | +| **last_name** | **String** | Last Name | | +| **company_name** | **String** | Name of the company | | +| **credits** | [**GetChildInfoAllOfCredits**](GetChildInfoAllOfCredits.md) | | [optional] | +| **statistics** | [**GetChildInfoAllOfStatistics**](GetChildInfoAllOfStatistics.md) | | [optional] | +| **password** | **String** | The encrypted password of child account | | +| **ips** | **Array<String>** | IP(s) associated to a child account user | [optional] | +| **api_keys** | [**GetChildInfoAllOfApiKeys**](GetChildInfoAllOfApiKeys.md) | | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetChildInfo.new( + email: john.smith@example.com, + first_name: John, + last_name: Smith, + company_name: MyCompany, + credits: null, + statistics: null, + password: abC01De2fGHI3jkL, + ips: null, + api_keys: null +) +``` diff --git a/docs/GetChildInfoAllOf.md b/docs/GetChildInfoAllOf.md new file mode 100644 index 0000000..a5d54d4 --- /dev/null +++ b/docs/GetChildInfoAllOf.md @@ -0,0 +1,26 @@ +# SibApiV3Sdk::GetChildInfoAllOf + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **credits** | [**GetChildInfoAllOfCredits**](GetChildInfoAllOfCredits.md) | | [optional] | +| **statistics** | [**GetChildInfoAllOfStatistics**](GetChildInfoAllOfStatistics.md) | | [optional] | +| **password** | **String** | The encrypted password of child account | | +| **ips** | **Array<String>** | IP(s) associated to a child account user | [optional] | +| **api_keys** | [**GetChildInfoAllOfApiKeys**](GetChildInfoAllOfApiKeys.md) | | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetChildInfoAllOf.new( + credits: null, + statistics: null, + password: abC01De2fGHI3jkL, + ips: null, + api_keys: null +) +``` + diff --git a/docs/GetChildInfoAllOfApiKeys.md b/docs/GetChildInfoAllOfApiKeys.md new file mode 100644 index 0000000..38aa3f2 --- /dev/null +++ b/docs/GetChildInfoAllOfApiKeys.md @@ -0,0 +1,20 @@ +# SibApiV3Sdk::GetChildInfoAllOfApiKeys + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **v2** | [**Array<GetChildInfoAllOfApiKeysV2>**](GetChildInfoAllOfApiKeysV2.md) | | | +| **v3** | [**Array<GetChildInfoAllOfApiKeysV3>**](GetChildInfoAllOfApiKeysV3.md) | | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetChildInfoAllOfApiKeys.new( + v2: null, + v3: null +) +``` + diff --git a/docs/GetChildInfoAllOfApiKeysV2.md b/docs/GetChildInfoAllOfApiKeysV2.md new file mode 100644 index 0000000..18fc515 --- /dev/null +++ b/docs/GetChildInfoAllOfApiKeysV2.md @@ -0,0 +1,20 @@ +# SibApiV3Sdk::GetChildInfoAllOfApiKeysV2 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of the key for version 2 | | +| **key** | **String** | API Key for version 2 | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetChildInfoAllOfApiKeysV2.new( + name: N˚2, + key: nOpxxxxxy7z +) +``` + diff --git a/docs/GetChildInfoAllOfApiKeysV3.md b/docs/GetChildInfoAllOfApiKeysV3.md new file mode 100644 index 0000000..7007f19 --- /dev/null +++ b/docs/GetChildInfoAllOfApiKeysV3.md @@ -0,0 +1,20 @@ +# SibApiV3Sdk::GetChildInfoAllOfApiKeysV3 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of the key for version 3 | | +| **key** | **String** | API Key for version 3 | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetChildInfoAllOfApiKeysV3.new( + name: N˚3, + key: xkeysib-21881axxxxxcc92e04-mIrexxxx7z +) +``` + diff --git a/docs/GetChildInfoAllOfCredits.md b/docs/GetChildInfoAllOfCredits.md new file mode 100644 index 0000000..e1a5962 --- /dev/null +++ b/docs/GetChildInfoAllOfCredits.md @@ -0,0 +1,20 @@ +# SibApiV3Sdk::GetChildInfoAllOfCredits + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email_credits** | **Integer** | Email credits available for your child | [optional] | +| **sms_credits** | **Integer** | SMS credits available for your child | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetChildInfoAllOfCredits.new( + email_credits: 98555, + sms_credits: 87556 +) +``` + diff --git a/docs/GetChildInfoAllOfStatistics.md b/docs/GetChildInfoAllOfStatistics.md new file mode 100644 index 0000000..0b6a4f3 --- /dev/null +++ b/docs/GetChildInfoAllOfStatistics.md @@ -0,0 +1,22 @@ +# SibApiV3Sdk::GetChildInfoAllOfStatistics + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **previous_month_total_sent** | **Integer** | Overall emails sent for the previous month | [optional] | +| **current_month_total_sent** | **Integer** | Overall emails sent for current month | [optional] | +| **total_sent** | **Integer** | Overall emails sent for since the account exists | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetChildInfoAllOfStatistics.new( + previous_month_total_sent: 7654, + current_month_total_sent: 4566, + total_sent: 987554 +) +``` + diff --git a/docs/GetChildInfoApiKeys.md b/docs/GetChildInfoApiKeys.md deleted file mode 100644 index 82f2de6..0000000 --- a/docs/GetChildInfoApiKeys.md +++ /dev/null @@ -1,9 +0,0 @@ -# SibApiV3Sdk::GetChildInfoApiKeys - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**v2** | [**Array<GetChildInfoApiKeysV2>**](GetChildInfoApiKeysV2.md) | | -**v3** | [**Array<GetChildInfoApiKeysV3>**](GetChildInfoApiKeysV3.md) | | [optional] - - diff --git a/docs/GetChildInfoApiKeysV2.md b/docs/GetChildInfoApiKeysV2.md deleted file mode 100644 index fa996a3..0000000 --- a/docs/GetChildInfoApiKeysV2.md +++ /dev/null @@ -1,9 +0,0 @@ -# SibApiV3Sdk::GetChildInfoApiKeysV2 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Name of the key for version 2 | -**key** | **String** | API Key for version 2 | - - diff --git a/docs/GetChildInfoApiKeysV3.md b/docs/GetChildInfoApiKeysV3.md deleted file mode 100644 index 982041b..0000000 --- a/docs/GetChildInfoApiKeysV3.md +++ /dev/null @@ -1,9 +0,0 @@ -# SibApiV3Sdk::GetChildInfoApiKeysV3 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Name of the key for version 3 | -**key** | **String** | API Key for version 3 | - - diff --git a/docs/GetChildInfoCredits.md b/docs/GetChildInfoCredits.md deleted file mode 100644 index afbc732..0000000 --- a/docs/GetChildInfoCredits.md +++ /dev/null @@ -1,9 +0,0 @@ -# SibApiV3Sdk::GetChildInfoCredits - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email_credits** | **Integer** | Email credits available for your child | [optional] -**sms_credits** | **Integer** | SMS credits available for your child | [optional] - - diff --git a/docs/GetChildInfoStatistics.md b/docs/GetChildInfoStatistics.md deleted file mode 100644 index f452bfb..0000000 --- a/docs/GetChildInfoStatistics.md +++ /dev/null @@ -1,10 +0,0 @@ -# SibApiV3Sdk::GetChildInfoStatistics - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**previous_month_total_sent** | **Integer** | Overall emails sent for the previous month | [optional] -**current_month_total_sent** | **Integer** | Overall emails sent for current month | [optional] -**total_sent** | **Integer** | Overall emails sent for since the account exists | [optional] - - diff --git a/docs/GetChildrenList.md b/docs/GetChildrenList.md index da27a5b..95a959b 100644 --- a/docs/GetChildrenList.md +++ b/docs/GetChildrenList.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::GetChildrenList ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**children** | **Array<Object>** | Your children's account information | [optional] -**count** | **Integer** | Number of child accounts | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **children** | [**Array<GetChildInfo>**](GetChildInfo.md) | Your children's account information | [optional] | +| **count** | **Integer** | Number of child accounts | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetChildrenList.new( + children: null, + count: 24 +) +``` diff --git a/docs/GetClient.md b/docs/GetClient.md index 67fb53a..0745873 100644 --- a/docs/GetClient.md +++ b/docs/GetClient.md @@ -1,11 +1,24 @@ # SibApiV3Sdk::GetClient ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | Login Email | -**first_name** | **String** | First Name | -**last_name** | **String** | Last Name | -**company_name** | **String** | Name of the company | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Login Email | | +| **first_name** | **String** | First Name | | +| **last_name** | **String** | Last Name | | +| **company_name** | **String** | Name of the company | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetClient.new( + email: john.smith@example.com, + first_name: John, + last_name: Smith, + company_name: MyCompany +) +``` diff --git a/docs/GetContactCampaignStats.md b/docs/GetContactCampaignStats.md index da6f069..6c7cc29 100644 --- a/docs/GetContactCampaignStats.md +++ b/docs/GetContactCampaignStats.md @@ -1,15 +1,32 @@ # SibApiV3Sdk::GetContactCampaignStats ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**messages_sent** | [**Array<GetExtendedContactDetailsStatisticsMessagesSent>**](GetExtendedContactDetailsStatisticsMessagesSent.md) | | [optional] -**hard_bounces** | [**Array<GetExtendedContactDetailsStatisticsMessagesSent>**](GetExtendedContactDetailsStatisticsMessagesSent.md) | | [optional] -**soft_bounces** | [**Array<GetExtendedContactDetailsStatisticsMessagesSent>**](GetExtendedContactDetailsStatisticsMessagesSent.md) | | [optional] -**complaints** | [**Array<GetExtendedContactDetailsStatisticsMessagesSent>**](GetExtendedContactDetailsStatisticsMessagesSent.md) | | [optional] -**unsubscriptions** | [**GetContactCampaignStatsUnsubscriptions**](GetContactCampaignStatsUnsubscriptions.md) | | [optional] -**opened** | [**Array<GetContactCampaignStatsOpened>**](GetContactCampaignStatsOpened.md) | | [optional] -**clicked** | [**Array<GetContactCampaignStatsClicked>**](GetContactCampaignStatsClicked.md) | | [optional] -**transac_attributes** | [**Array<GetContactCampaignStatsTransacAttributes>**](GetContactCampaignStatsTransacAttributes.md) | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **messages_sent** | [**Array<GetExtendedContactDetailsAllOfStatisticsMessagesSent>**](GetExtendedContactDetailsAllOfStatisticsMessagesSent.md) | | [optional] | +| **hard_bounces** | [**Array<GetExtendedContactDetailsAllOfStatisticsMessagesSent>**](GetExtendedContactDetailsAllOfStatisticsMessagesSent.md) | | [optional] | +| **soft_bounces** | [**Array<GetExtendedContactDetailsAllOfStatisticsMessagesSent>**](GetExtendedContactDetailsAllOfStatisticsMessagesSent.md) | | [optional] | +| **complaints** | [**Array<GetExtendedContactDetailsAllOfStatisticsMessagesSent>**](GetExtendedContactDetailsAllOfStatisticsMessagesSent.md) | | [optional] | +| **unsubscriptions** | [**GetContactCampaignStatsUnsubscriptions**](GetContactCampaignStatsUnsubscriptions.md) | | [optional] | +| **opened** | [**Array<GetContactCampaignStatsOpened>**](GetContactCampaignStatsOpened.md) | | [optional] | +| **clicked** | [**Array<GetContactCampaignStatsClicked>**](GetContactCampaignStatsClicked.md) | | [optional] | +| **transac_attributes** | [**Array<GetContactCampaignStatsTransacAttributes>**](GetContactCampaignStatsTransacAttributes.md) | | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetContactCampaignStats.new( + messages_sent: null, + hard_bounces: null, + soft_bounces: null, + complaints: null, + unsubscriptions: null, + opened: null, + clicked: null, + transac_attributes: null +) +``` diff --git a/docs/GetContactCampaignStatsClicked.md b/docs/GetContactCampaignStatsClicked.md index 36bff93..01badac 100644 --- a/docs/GetContactCampaignStatsClicked.md +++ b/docs/GetContactCampaignStatsClicked.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::GetContactCampaignStatsClicked ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**campaign_id** | **Integer** | ID of the campaign which generated the event | -**links** | [**Array<GetExtendedContactDetailsStatisticsLinks>**](GetExtendedContactDetailsStatisticsLinks.md) | | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | ID of the campaign which generated the event | | +| **links** | [**Array<GetExtendedContactDetailsAllOfStatisticsLinks>**](GetExtendedContactDetailsAllOfStatisticsLinks.md) | | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetContactCampaignStatsClicked.new( + campaign_id: 3, + links: null +) +``` diff --git a/docs/GetContactCampaignStatsOpened.md b/docs/GetContactCampaignStatsOpened.md index e65878a..927952a 100644 --- a/docs/GetContactCampaignStatsOpened.md +++ b/docs/GetContactCampaignStatsOpened.md @@ -1,11 +1,24 @@ # SibApiV3Sdk::GetContactCampaignStatsOpened ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**campaign_id** | **Integer** | ID of the campaign which generated the event | -**count** | **Integer** | Number of openings of the campaign | -**event_time** | **String** | UTC date-time of the event | -**ip** | **String** | IP from which the user has opened the campaign | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | ID of the campaign which generated the event | | +| **count** | **Integer** | Number of openings of the campaign | | +| **event_time** | **String** | UTC date-time of the event | | +| **ip** | **String** | IP from which the user has opened the campaign | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetContactCampaignStatsOpened.new( + campaign_id: 3, + count: 3, + event_time: 2017-03-12T20:15:13Z, + ip: 165.87.3.15 +) +``` diff --git a/docs/GetContactCampaignStatsTransacAttributes.md b/docs/GetContactCampaignStatsTransacAttributes.md index 19baee6..da72af3 100644 --- a/docs/GetContactCampaignStatsTransacAttributes.md +++ b/docs/GetContactCampaignStatsTransacAttributes.md @@ -1,10 +1,22 @@ # SibApiV3Sdk::GetContactCampaignStatsTransacAttributes ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**order_date** | **Date** | Date of the order | -**order_price** | **Float** | Price of the order | -**order_id** | **Integer** | ID of the order | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **order_date** | **Date** | Date of the order | | +| **order_price** | **Float** | Price of the order | | +| **order_id** | **Integer** | ID of the order | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetContactCampaignStatsTransacAttributes.new( + order_date: Sun Mar 12 05:30:00 IST 2017, + order_price: 24.99, + order_id: 248 +) +``` diff --git a/docs/GetContactCampaignStatsUnsubscriptions.md b/docs/GetContactCampaignStatsUnsubscriptions.md index 3159630..98a9454 100644 --- a/docs/GetContactCampaignStatsUnsubscriptions.md +++ b/docs/GetContactCampaignStatsUnsubscriptions.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::GetContactCampaignStatsUnsubscriptions ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**user_unsubscription** | [**Array<GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription>**](GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.md) | Contact has unsubscribed via the unsubscription link in the email | -**admin_unsubscription** | [**Array<GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription>**](GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.md) | Contact has been unsubscribed from the administrator | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user_unsubscription** | [**Array<GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription>**](GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.md) | Contact has unsubscribed via the unsubscription link in the email | | +| **admin_unsubscription** | [**Array<GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription>**](GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.md) | Contact has been unsubscribed from the administrator | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetContactCampaignStatsUnsubscriptions.new( + user_unsubscription: null, + admin_unsubscription: null +) +``` diff --git a/docs/GetContactDetails.md b/docs/GetContactDetails.md index cba6f7f..260b04c 100644 --- a/docs/GetContactDetails.md +++ b/docs/GetContactDetails.md @@ -1,16 +1,34 @@ # SibApiV3Sdk::GetContactDetails ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | Email address of the contact for which you requested the details | -**id** | **Integer** | ID of the contact for which you requested the details | -**email_blacklisted** | **BOOLEAN** | Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) | -**sms_blacklisted** | **BOOLEAN** | Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) | -**created_at** | **String** | Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) | -**modified_at** | **String** | Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) | -**list_ids** | **Array<Integer>** | | -**list_unsubscribed** | **Array<Integer>** | | [optional] -**attributes** | **Object** | Set of attributes of the contact | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Email address of the contact for which you requested the details | | +| **id** | **Integer** | ID of the contact for which you requested the details | | +| **email_blacklisted** | **Boolean** | Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) | | +| **sms_blacklisted** | **Boolean** | Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) | | +| **created_at** | **String** | Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) | | +| **modified_at** | **String** | Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) | | +| **list_ids** | **Array<Integer>** | | | +| **list_unsubscribed** | **Array<Integer>** | | [optional] | +| **attributes** | **Object** | Set of attributes of the contact | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetContactDetails.new( + email: john.smith@example.com, + id: 32, + email_blacklisted: false, + sms_blacklisted: true, + created_at: 2017-05-12T12:30:00Z, + modified_at: 2017-05-12T12:30:00Z, + list_ids: null, + list_unsubscribed: null, + attributes: {"name":"Joe","email":"joe@example.com"} +) +``` diff --git a/docs/GetContacts.md b/docs/GetContacts.md index 6f801ad..31e8e34 100644 --- a/docs/GetContacts.md +++ b/docs/GetContacts.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::GetContacts ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**contacts** | **Array<Object>** | | -**count** | **Integer** | Number of contacts | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **contacts** | [**Array<GetContactDetails>**](GetContactDetails.md) | | | +| **count** | **Integer** | Number of contacts | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetContacts.new( + contacts: null, + count: 17655 +) +``` diff --git a/docs/GetDeviceBrowserStats.md b/docs/GetDeviceBrowserStats.md index 1e28ed3..d14c13d 100644 --- a/docs/GetDeviceBrowserStats.md +++ b/docs/GetDeviceBrowserStats.md @@ -1,11 +1,24 @@ # SibApiV3Sdk::GetDeviceBrowserStats ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**clickers** | **Integer** | Number of total clicks for the campaign using the particular browser | -**unique_clicks** | **Integer** | Number of unique clicks for the campaign using the particular browser | -**viewed** | **Integer** | Number of openings for the campaign using the particular browser | -**unique_views** | **Integer** | Number of unique openings for the campaign using the particular browser | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **clickers** | **Integer** | Number of total clicks for the campaign using the particular browser | | +| **unique_clicks** | **Integer** | Number of unique clicks for the campaign using the particular browser | | +| **viewed** | **Integer** | Number of openings for the campaign using the particular browser | | +| **unique_views** | **Integer** | Number of unique openings for the campaign using the particular browser | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetDeviceBrowserStats.new( + clickers: 2665, + unique_clicks: 2300, + viewed: 8999, + unique_views: 7779 +) +``` diff --git a/docs/GetEmailCampaign.md b/docs/GetEmailCampaign.md index 8dc9f82..23269cd 100644 --- a/docs/GetEmailCampaign.md +++ b/docs/GetEmailCampaign.md @@ -1,38 +1,78 @@ # SibApiV3Sdk::GetEmailCampaign ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | ID of the campaign | -**name** | **String** | Name of the campaign | -**subject** | **String** | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` | [optional] -**type** | **String** | Type of campaign | -**status** | **String** | Status of the campaign | -**scheduled_at** | **String** | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional] -**ab_testing** | **BOOLEAN** | Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. | [optional] -**subject_a** | **String** | Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional] -**subject_b** | **String** | Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional] -**split_rule** | **Integer** | The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` | [optional] -**winner_criteria** | **String** | Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` | [optional] -**winner_delay** | **Integer** | The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` | [optional] -**send_at_best_time** | **BOOLEAN** | It is true if you have chosen to send your campaign at best time, otherwise it is false | [optional] -**test_sent** | **BOOLEAN** | Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) | -**header** | **String** | Header of the campaign | -**footer** | **String** | Footer of the campaign | -**sender** | [**GetExtendedCampaignOverviewSender**](GetExtendedCampaignOverviewSender.md) | | -**reply_to** | **String** | Email defined as the \"Reply to\" of the campaign | -**to_field** | **String** | Customisation of the \"to\" field of the campaign | [optional] -**html_content** | **String** | HTML content of the campaign | -**share_link** | **String** | Link to share the campaign on social medias | [optional] -**tag** | **String** | Tag of the campaign | [optional] -**created_at** | **String** | Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | -**modified_at** | **String** | UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | -**inline_image_activation** | **BOOLEAN** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. | [optional] -**mirror_active** | **BOOLEAN** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional] -**recurring** | **BOOLEAN** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional] -**sent_date** | **String** | Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' | [optional] -**return_bounce** | **Integer** | Total number of non-delivered campaigns for a particular campaign id. | [optional] -**recipients** | [**GetSmsCampaignRecipients**](GetSmsCampaignRecipients.md) | | -**statistics** | [**GetSmsCampaignRecipients**](GetSmsCampaignRecipients.md) | | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **Integer** | ID of the campaign | | +| **name** | **String** | Name of the campaign | | +| **subject** | **String** | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` | [optional] | +| **type** | **String** | Type of campaign | | +| **status** | **String** | Status of the campaign | | +| **scheduled_at** | **String** | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional] | +| **ab_testing** | **Boolean** | Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. | [optional] | +| **subject_a** | **String** | Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional] | +| **subject_b** | **String** | Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional] | +| **split_rule** | **Integer** | The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` | [optional] | +| **winner_criteria** | **String** | Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` | [optional] | +| **winner_delay** | **Integer** | The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` | [optional] | +| **send_at_best_time** | **Boolean** | It is true if you have chosen to send your campaign at best time, otherwise it is false | [optional] | +| **test_sent** | **Boolean** | Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) | | +| **header** | **String** | Header of the campaign | | +| **footer** | **String** | Footer of the campaign | | +| **sender** | [**GetExtendedCampaignOverviewAllOfSender**](GetExtendedCampaignOverviewAllOfSender.md) | | | +| **reply_to** | **String** | Email defined as the \"Reply to\" of the campaign | | +| **to_field** | **String** | Customisation of the \"to\" field of the campaign | [optional] | +| **html_content** | **String** | HTML content of the campaign | | +| **share_link** | **String** | Link to share the campaign on social medias | [optional] | +| **tag** | **String** | Tag of the campaign | [optional] | +| **created_at** | **String** | Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | | +| **modified_at** | **String** | UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | | +| **inline_image_activation** | **Boolean** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. | [optional] | +| **mirror_active** | **Boolean** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional] | +| **recurring** | **Boolean** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional] | +| **sent_date** | **String** | Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' | [optional] | +| **return_bounce** | **Integer** | Total number of non-delivered campaigns for a particular campaign id. | [optional] | +| **recipients** | [**GetCampaignRecipients**](GetCampaignRecipients.md) | | | +| **statistics** | [**GetExtendedCampaignStats**](GetExtendedCampaignStats.md) | | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetEmailCampaign.new( + id: 12, + name: EN - Sales Summer 2017, + subject: 20% OFF for 2017 Summer Sales, + type: classic, + status: sent, + scheduled_at: 2017-06-01T12:30:00Z, + ab_testing: true, + subject_a: Discover the New Collection!, + subject_b: Want to discover the New Collection?, + split_rule: 25, + winner_criteria: open, + winner_delay: 50, + send_at_best_time: true, + test_sent: true, + header: [DEFAULT_HEADER], + footer: [DEFAULT_FOOTER], + sender: null, + reply_to: replyto@domain.com, + to_field: {FNAME} {LNAME}, + html_content: This is my HTML Content, + share_link: http://dhh.sendinblue.com/fhsgccc.html?t=9865448900, + tag: Newsletter, + created_at: 2017-05-01T12:30:00Z, + modified_at: 2017-05-01T12:30:00Z, + inline_image_activation: true, + mirror_active: true, + recurring: true, + sent_date: 2018-12-01T16:30:00Z, + return_bounce: 5, + recipients: null, + statistics: null +) +``` diff --git a/docs/GetEmailCampaignAllOf.md b/docs/GetEmailCampaignAllOf.md new file mode 100644 index 0000000..bb094be --- /dev/null +++ b/docs/GetEmailCampaignAllOf.md @@ -0,0 +1,20 @@ +# SibApiV3Sdk::GetEmailCampaignAllOf + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **recipients** | [**GetCampaignRecipients**](GetCampaignRecipients.md) | | | +| **statistics** | [**GetExtendedCampaignStats**](GetExtendedCampaignStats.md) | | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetEmailCampaignAllOf.new( + recipients: null, + statistics: null +) +``` + diff --git a/docs/GetEmailCampaigns.md b/docs/GetEmailCampaigns.md index 3e67bfb..3b2e2b4 100644 --- a/docs/GetEmailCampaigns.md +++ b/docs/GetEmailCampaigns.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::GetEmailCampaigns ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**campaigns** | **Array<Object>** | | [optional] -**count** | **Integer** | Number of Email campaigns retrieved | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaigns** | [**Array<GetExtendedCampaignOverview>**](GetExtendedCampaignOverview.md) | | [optional] | +| **count** | **Integer** | Number of Email campaigns retrieved | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetEmailCampaigns.new( + campaigns: null, + count: 24 +) +``` diff --git a/docs/GetEmailEventReport.md b/docs/GetEmailEventReport.md index 62f07cf..826e1eb 100644 --- a/docs/GetEmailEventReport.md +++ b/docs/GetEmailEventReport.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::GetEmailEventReport ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**events** | [**Array<GetEmailEventReportEvents>**](GetEmailEventReportEvents.md) | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **events** | [**Array<GetEmailEventReportEvents>**](GetEmailEventReportEvents.md) | | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetEmailEventReport.new( + events: null +) +``` diff --git a/docs/GetEmailEventReportEvents.md b/docs/GetEmailEventReportEvents.md index 8b7c14e..cdb3208 100644 --- a/docs/GetEmailEventReportEvents.md +++ b/docs/GetEmailEventReportEvents.md @@ -1,18 +1,38 @@ # SibApiV3Sdk::GetEmailEventReportEvents ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | Email address which generates the event | -**date** | **String** | UTC date-time on which the event has been generated | -**subject** | **String** | Subject of the event | [optional] -**message_id** | **String** | Message ID which generated the event | -**event** | **String** | Event which occurred | -**reason** | **String** | Reason of bounce (only available if the event is hardbounce or softbounce) | [optional] -**tag** | **String** | Tag of the email which generated the event | [optional] -**ip** | **String** | IP from which the user has opened the email or clicked on the link (only available if the event is opened or clicks) | [optional] -**link** | **String** | The link which is sent to the user (only available if the event is requests or opened or clicks) | [optional] -**from** | **String** | Sender email from which the emails are sent | [optional] -**template_id** | **Integer** | ID of the template (only available if the email is template based) | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Email address which generates the event | | +| **date** | **String** | UTC date-time on which the event has been generated | | +| **subject** | **String** | Subject of the event | [optional] | +| **message_id** | **String** | Message ID which generated the event | | +| **event** | **String** | Event which occurred | | +| **reason** | **String** | Reason of bounce (only available if the event is hardbounce or softbounce) | [optional] | +| **tag** | **String** | Tag of the email which generated the event | [optional] | +| **ip** | **String** | IP from which the user has opened the email or clicked on the link (only available if the event is opened or clicks) | [optional] | +| **link** | **String** | The link which is sent to the user (only available if the event is requests or opened or clicks) | [optional] | +| **from** | **String** | Sender email from which the emails are sent | [optional] | +| **template_id** | **Integer** | ID of the template (only available if the email is template based) | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetEmailEventReportEvents.new( + email: john.smith@example.com, + date: 2017-03-12T12:30:00Z, + subject: Sib client test, + message_id: <201798300811.5787683@relay.domain.com>, + event: delivered, + reason: Error connection timeout, + tag: OrderConfirmation, + ip: 165.87.3.15, + link: https://www.someexamplelink.com, + from: john@example.com, + template_id: 4 +) +``` diff --git a/docs/GetExtendedCampaignOverview.md b/docs/GetExtendedCampaignOverview.md index f04bf95..2c1c96e 100644 --- a/docs/GetExtendedCampaignOverview.md +++ b/docs/GetExtendedCampaignOverview.md @@ -1,36 +1,74 @@ # SibApiV3Sdk::GetExtendedCampaignOverview ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | ID of the campaign | -**name** | **String** | Name of the campaign | -**subject** | **String** | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` | [optional] -**type** | **String** | Type of campaign | -**status** | **String** | Status of the campaign | -**scheduled_at** | **String** | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional] -**ab_testing** | **BOOLEAN** | Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. | [optional] -**subject_a** | **String** | Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional] -**subject_b** | **String** | Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional] -**split_rule** | **Integer** | The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` | [optional] -**winner_criteria** | **String** | Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` | [optional] -**winner_delay** | **Integer** | The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` | [optional] -**send_at_best_time** | **BOOLEAN** | It is true if you have chosen to send your campaign at best time, otherwise it is false | [optional] -**test_sent** | **BOOLEAN** | Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) | -**header** | **String** | Header of the campaign | -**footer** | **String** | Footer of the campaign | -**sender** | [**GetExtendedCampaignOverviewSender**](GetExtendedCampaignOverviewSender.md) | | -**reply_to** | **String** | Email defined as the \"Reply to\" of the campaign | -**to_field** | **String** | Customisation of the \"to\" field of the campaign | [optional] -**html_content** | **String** | HTML content of the campaign | -**share_link** | **String** | Link to share the campaign on social medias | [optional] -**tag** | **String** | Tag of the campaign | [optional] -**created_at** | **String** | Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | -**modified_at** | **String** | UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | -**inline_image_activation** | **BOOLEAN** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. | [optional] -**mirror_active** | **BOOLEAN** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional] -**recurring** | **BOOLEAN** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional] -**sent_date** | **String** | Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' | [optional] -**return_bounce** | **Integer** | Total number of non-delivered campaigns for a particular campaign id. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **Integer** | ID of the campaign | | +| **name** | **String** | Name of the campaign | | +| **subject** | **String** | Subject of the campaign. Only available if `abTesting` flag of the campaign is `false` | [optional] | +| **type** | **String** | Type of campaign | | +| **status** | **String** | Status of the campaign | | +| **scheduled_at** | **String** | UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ) | [optional] | +| **ab_testing** | **Boolean** | Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled. | [optional] | +| **subject_a** | **String** | Subject A of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional] | +| **subject_b** | **String** | Subject B of the ab-test campaign. Only available if `abTesting` flag of the campaign is `true` | [optional] | +| **split_rule** | **Integer** | The size of your ab-test groups. Only available if `abTesting` flag of the campaign is `true` | [optional] | +| **winner_criteria** | **String** | Criteria for the winning version. Only available if `abTesting` flag of the campaign is `true` | [optional] | +| **winner_delay** | **Integer** | The duration of the test in hours at the end of which the winning version will be sent. Only available if `abTesting` flag of the campaign is `true` | [optional] | +| **send_at_best_time** | **Boolean** | It is true if you have chosen to send your campaign at best time, otherwise it is false | [optional] | +| **test_sent** | **Boolean** | Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) | | +| **header** | **String** | Header of the campaign | | +| **footer** | **String** | Footer of the campaign | | +| **sender** | [**GetExtendedCampaignOverviewAllOfSender**](GetExtendedCampaignOverviewAllOfSender.md) | | | +| **reply_to** | **String** | Email defined as the \"Reply to\" of the campaign | | +| **to_field** | **String** | Customisation of the \"to\" field of the campaign | [optional] | +| **html_content** | **String** | HTML content of the campaign | | +| **share_link** | **String** | Link to share the campaign on social medias | [optional] | +| **tag** | **String** | Tag of the campaign | [optional] | +| **created_at** | **String** | Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | | +| **modified_at** | **String** | UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | | +| **inline_image_activation** | **Boolean** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. | [optional] | +| **mirror_active** | **Boolean** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional] | +| **recurring** | **Boolean** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional] | +| **sent_date** | **String** | Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' | [optional] | +| **return_bounce** | **Integer** | Total number of non-delivered campaigns for a particular campaign id. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedCampaignOverview.new( + id: 12, + name: EN - Sales Summer 2017, + subject: 20% OFF for 2017 Summer Sales, + type: classic, + status: sent, + scheduled_at: 2017-06-01T12:30:00Z, + ab_testing: true, + subject_a: Discover the New Collection!, + subject_b: Want to discover the New Collection?, + split_rule: 25, + winner_criteria: open, + winner_delay: 50, + send_at_best_time: true, + test_sent: true, + header: [DEFAULT_HEADER], + footer: [DEFAULT_FOOTER], + sender: null, + reply_to: replyto@domain.com, + to_field: {FNAME} {LNAME}, + html_content: This is my HTML Content, + share_link: http://dhh.sendinblue.com/fhsgccc.html?t=9865448900, + tag: Newsletter, + created_at: 2017-05-01T12:30:00Z, + modified_at: 2017-05-01T12:30:00Z, + inline_image_activation: true, + mirror_active: true, + recurring: true, + sent_date: 2018-12-01T16:30:00Z, + return_bounce: 5 +) +``` diff --git a/docs/GetExtendedCampaignOverviewAllOf.md b/docs/GetExtendedCampaignOverviewAllOf.md new file mode 100644 index 0000000..2494c0a --- /dev/null +++ b/docs/GetExtendedCampaignOverviewAllOf.md @@ -0,0 +1,48 @@ +# SibApiV3Sdk::GetExtendedCampaignOverviewAllOf + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **test_sent** | **Boolean** | Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) | | +| **header** | **String** | Header of the campaign | | +| **footer** | **String** | Footer of the campaign | | +| **sender** | [**GetExtendedCampaignOverviewAllOfSender**](GetExtendedCampaignOverviewAllOfSender.md) | | | +| **reply_to** | **String** | Email defined as the \"Reply to\" of the campaign | | +| **to_field** | **String** | Customisation of the \"to\" field of the campaign | [optional] | +| **html_content** | **String** | HTML content of the campaign | | +| **share_link** | **String** | Link to share the campaign on social medias | [optional] | +| **tag** | **String** | Tag of the campaign | [optional] | +| **created_at** | **String** | Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | | +| **modified_at** | **String** | UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | | +| **inline_image_activation** | **Boolean** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. | [optional] | +| **mirror_active** | **Boolean** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional] | +| **recurring** | **Boolean** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional] | +| **sent_date** | **String** | Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' | [optional] | +| **return_bounce** | **Integer** | Total number of non-delivered campaigns for a particular campaign id. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedCampaignOverviewAllOf.new( + test_sent: true, + header: [DEFAULT_HEADER], + footer: [DEFAULT_FOOTER], + sender: null, + reply_to: replyto@domain.com, + to_field: {FNAME} {LNAME}, + html_content: This is my HTML Content, + share_link: http://dhh.sendinblue.com/fhsgccc.html?t=9865448900, + tag: Newsletter, + created_at: 2017-05-01T12:30:00Z, + modified_at: 2017-05-01T12:30:00Z, + inline_image_activation: true, + mirror_active: true, + recurring: true, + sent_date: 2018-12-01T16:30:00Z, + return_bounce: 5 +) +``` + diff --git a/docs/GetExtendedCampaignOverviewAllOfSender.md b/docs/GetExtendedCampaignOverviewAllOfSender.md new file mode 100644 index 0000000..7b74fc1 --- /dev/null +++ b/docs/GetExtendedCampaignOverviewAllOfSender.md @@ -0,0 +1,22 @@ +# SibApiV3Sdk::GetExtendedCampaignOverviewAllOfSender + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Sender name of the campaign | [optional] | +| **email** | **String** | Sender email of the campaign | [optional] | +| **id** | **String** | Sender id of the campaign | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedCampaignOverviewAllOfSender.new( + name: Marketing, + email: marketing@mycompany.com, + id: 43 +) +``` + diff --git a/docs/GetExtendedCampaignOverviewSender.md b/docs/GetExtendedCampaignOverviewSender.md deleted file mode 100644 index 3945a12..0000000 --- a/docs/GetExtendedCampaignOverviewSender.md +++ /dev/null @@ -1,10 +0,0 @@ -# SibApiV3Sdk::GetExtendedCampaignOverviewSender - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Sender name of the campaign | [optional] -**email** | **String** | Sender email of the campaign | [optional] -**id** | **String** | Sender id of the campaign | [optional] - - diff --git a/docs/GetExtendedCampaignStats.md b/docs/GetExtendedCampaignStats.md index d14b7df..9ab3229 100644 --- a/docs/GetExtendedCampaignStats.md +++ b/docs/GetExtendedCampaignStats.md @@ -1,15 +1,32 @@ # SibApiV3Sdk::GetExtendedCampaignStats ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**global_stats** | [**GetExtendedCampaignStatsGlobalStats**](GetExtendedCampaignStatsGlobalStats.md) | | -**campaign_stats** | **Array<Object>** | List-wise statistics of the campaign. | -**mirror_click** | **Integer** | Number of clicks on mirror link | -**remaining** | **Integer** | Number of remaning emails to send | -**links_stats** | **Object** | Statistics about the number of clicks for the links | -**stats_by_domain** | [**GetStatsByDomain**](GetStatsByDomain.md) | | -**stats_by_device** | [**GetStatsByDevice**](GetStatsByDevice.md) | Statistics about the campaign on the basis of various devices | -**stats_by_browser** | [**GetStatsByBrowser**](GetStatsByBrowser.md) | Statistics about the campaign on the basis of various browsers | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **global_stats** | [**GetCampaignStats**](GetCampaignStats.md) | Overall statistics of the campaign | | +| **campaign_stats** | [**Array<GetCampaignStats>**](GetCampaignStats.md) | List-wise statistics of the campaign. | | +| **mirror_click** | **Integer** | Number of clicks on mirror link | | +| **remaining** | **Integer** | Number of remaning emails to send | | +| **links_stats** | **Object** | Statistics about the number of clicks for the links | | +| **stats_by_domain** | [**Hash<String, GetCampaignStats>**](GetCampaignStats.md) | | | +| **stats_by_device** | [**GetStatsByDevice**](GetStatsByDevice.md) | | | +| **stats_by_browser** | [**Hash<String, GetDeviceBrowserStats>**](GetDeviceBrowserStats.md) | | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedCampaignStats.new( + global_stats: null, + campaign_stats: null, + mirror_click: 120, + remaining: 1000, + links_stats: {"example.abc.com":7,"example.domain.com":10}, + stats_by_domain: null, + stats_by_device: null, + stats_by_browser: null +) +``` diff --git a/docs/GetExtendedCampaignStatsGlobalStats.md b/docs/GetExtendedCampaignStatsGlobalStats.md deleted file mode 100644 index 53c1e57..0000000 --- a/docs/GetExtendedCampaignStatsGlobalStats.md +++ /dev/null @@ -1,7 +0,0 @@ -# SibApiV3Sdk::GetExtendedCampaignStatsGlobalStats - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - diff --git a/docs/GetExtendedClient.md b/docs/GetExtendedClient.md index 5b535de..badf062 100644 --- a/docs/GetExtendedClient.md +++ b/docs/GetExtendedClient.md @@ -1,12 +1,26 @@ # SibApiV3Sdk::GetExtendedClient ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | Login Email | -**first_name** | **String** | First Name | -**last_name** | **String** | Last Name | -**company_name** | **String** | Name of the company | -**address** | [**GetExtendedClientAddress**](GetExtendedClientAddress.md) | | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Login Email | | +| **first_name** | **String** | First Name | | +| **last_name** | **String** | Last Name | | +| **company_name** | **String** | Name of the company | | +| **address** | [**GetExtendedClientAllOfAddress**](GetExtendedClientAllOfAddress.md) | | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedClient.new( + email: john.smith@example.com, + first_name: John, + last_name: Smith, + company_name: MyCompany, + address: null +) +``` diff --git a/docs/GetExtendedClientAddress.md b/docs/GetExtendedClientAddress.md deleted file mode 100644 index 96bcc6a..0000000 --- a/docs/GetExtendedClientAddress.md +++ /dev/null @@ -1,11 +0,0 @@ -# SibApiV3Sdk::GetExtendedClientAddress - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**street** | **String** | Street information | -**city** | **String** | City information | -**zip_code** | **String** | Zip Code information | -**country** | **String** | Country information | - - diff --git a/docs/GetExtendedClientAllOf.md b/docs/GetExtendedClientAllOf.md new file mode 100644 index 0000000..4e7b993 --- /dev/null +++ b/docs/GetExtendedClientAllOf.md @@ -0,0 +1,18 @@ +# SibApiV3Sdk::GetExtendedClientAllOf + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **address** | [**GetExtendedClientAllOfAddress**](GetExtendedClientAllOfAddress.md) | | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedClientAllOf.new( + address: null +) +``` + diff --git a/docs/GetExtendedClientAllOfAddress.md b/docs/GetExtendedClientAllOfAddress.md new file mode 100644 index 0000000..975858a --- /dev/null +++ b/docs/GetExtendedClientAllOfAddress.md @@ -0,0 +1,24 @@ +# SibApiV3Sdk::GetExtendedClientAllOfAddress + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **street** | **String** | Street information | | +| **city** | **String** | City information | | +| **zip_code** | **String** | Zip Code information | | +| **country** | **String** | Country information | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedClientAllOfAddress.new( + street: 47 Harbour Street, + city: New-York, + zip_code: 9867, + country: United States of America +) +``` + diff --git a/docs/GetExtendedContactDetails.md b/docs/GetExtendedContactDetails.md index d094c8f..657ee14 100644 --- a/docs/GetExtendedContactDetails.md +++ b/docs/GetExtendedContactDetails.md @@ -1,17 +1,36 @@ # SibApiV3Sdk::GetExtendedContactDetails ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | Email address of the contact for which you requested the details | -**id** | **Integer** | ID of the contact for which you requested the details | -**email_blacklisted** | **BOOLEAN** | Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) | -**sms_blacklisted** | **BOOLEAN** | Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) | -**created_at** | **String** | Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) | -**modified_at** | **String** | Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) | -**list_ids** | **Array<Integer>** | | -**list_unsubscribed** | **Array<Integer>** | | [optional] -**attributes** | **Object** | Set of attributes of the contact | -**statistics** | [**GetExtendedContactDetailsStatistics**](GetExtendedContactDetailsStatistics.md) | | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Email address of the contact for which you requested the details | | +| **id** | **Integer** | ID of the contact for which you requested the details | | +| **email_blacklisted** | **Boolean** | Blacklist status for email campaigns (true=blacklisted, false=not blacklisted) | | +| **sms_blacklisted** | **Boolean** | Blacklist status for SMS campaigns (true=blacklisted, false=not blacklisted) | | +| **created_at** | **String** | Creation UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) | | +| **modified_at** | **String** | Last modification UTC date-time of the contact (YYYY-MM-DDTHH:mm:ss.SSSZ) | | +| **list_ids** | **Array<Integer>** | | | +| **list_unsubscribed** | **Array<Integer>** | | [optional] | +| **attributes** | **Object** | Set of attributes of the contact | | +| **statistics** | [**GetExtendedContactDetailsAllOfStatistics**](GetExtendedContactDetailsAllOfStatistics.md) | | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedContactDetails.new( + email: john.smith@example.com, + id: 32, + email_blacklisted: false, + sms_blacklisted: true, + created_at: 2017-05-12T12:30:00Z, + modified_at: 2017-05-12T12:30:00Z, + list_ids: null, + list_unsubscribed: null, + attributes: {"name":"Joe","email":"joe@example.com"}, + statistics: null +) +``` diff --git a/docs/GetExtendedContactDetailsAllOf.md b/docs/GetExtendedContactDetailsAllOf.md new file mode 100644 index 0000000..6da806f --- /dev/null +++ b/docs/GetExtendedContactDetailsAllOf.md @@ -0,0 +1,18 @@ +# SibApiV3Sdk::GetExtendedContactDetailsAllOf + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **statistics** | [**GetExtendedContactDetailsAllOfStatistics**](GetExtendedContactDetailsAllOfStatistics.md) | | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedContactDetailsAllOf.new( + statistics: null +) +``` + diff --git a/docs/GetExtendedContactDetailsAllOfStatistics.md b/docs/GetExtendedContactDetailsAllOfStatistics.md new file mode 100644 index 0000000..63027a8 --- /dev/null +++ b/docs/GetExtendedContactDetailsAllOfStatistics.md @@ -0,0 +1,32 @@ +# SibApiV3Sdk::GetExtendedContactDetailsAllOfStatistics + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **messages_sent** | [**Array<GetExtendedContactDetailsAllOfStatisticsMessagesSent>**](GetExtendedContactDetailsAllOfStatisticsMessagesSent.md) | Listing of the sent campaign for the contact | [optional] | +| **hard_bounces** | [**Array<GetExtendedContactDetailsAllOfStatisticsMessagesSent>**](GetExtendedContactDetailsAllOfStatisticsMessagesSent.md) | Listing of the hardbounes generated by the contact | [optional] | +| **soft_bounces** | [**Array<GetExtendedContactDetailsAllOfStatisticsMessagesSent>**](GetExtendedContactDetailsAllOfStatisticsMessagesSent.md) | Listing of the softbounes generated by the contact | [optional] | +| **complaints** | [**Array<GetExtendedContactDetailsAllOfStatisticsMessagesSent>**](GetExtendedContactDetailsAllOfStatisticsMessagesSent.md) | Listing of the complaints generated by the contact | [optional] | +| **unsubscriptions** | [**GetExtendedContactDetailsAllOfStatisticsUnsubscriptions**](GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.md) | | [optional] | +| **opened** | [**Array<GetExtendedContactDetailsAllOfStatisticsOpened>**](GetExtendedContactDetailsAllOfStatisticsOpened.md) | Listing of the openings generated by the contact | [optional] | +| **clicked** | [**Array<GetExtendedContactDetailsAllOfStatisticsClicked>**](GetExtendedContactDetailsAllOfStatisticsClicked.md) | Listing of the clicks generated by the contact | [optional] | +| **transac_attributes** | **Array<Object>** | Listing of the transactional attributes for the contact | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedContactDetailsAllOfStatistics.new( + messages_sent: null, + hard_bounces: null, + soft_bounces: null, + complaints: null, + unsubscriptions: null, + opened: null, + clicked: null, + transac_attributes: null +) +``` + diff --git a/docs/GetExtendedContactDetailsAllOfStatisticsClicked.md b/docs/GetExtendedContactDetailsAllOfStatisticsClicked.md new file mode 100644 index 0000000..b40cbd9 --- /dev/null +++ b/docs/GetExtendedContactDetailsAllOfStatisticsClicked.md @@ -0,0 +1,20 @@ +# SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsClicked + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | ID of the campaign which generated the event | | +| **links** | [**Array<GetExtendedContactDetailsAllOfStatisticsLinks>**](GetExtendedContactDetailsAllOfStatisticsLinks.md) | Listing of the clicked links for the campaign | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsClicked.new( + campaign_id: 3, + links: null +) +``` + diff --git a/docs/GetExtendedContactDetailsAllOfStatisticsLinks.md b/docs/GetExtendedContactDetailsAllOfStatisticsLinks.md new file mode 100644 index 0000000..b29ff24 --- /dev/null +++ b/docs/GetExtendedContactDetailsAllOfStatisticsLinks.md @@ -0,0 +1,24 @@ +# SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsLinks + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **count** | **Integer** | Number of clicks on this link for the campaign | | +| **event_time** | **String** | UTC date-time of the event | | +| **ip** | **String** | IP from which the user has clicked on the link | | +| **url** | **String** | URL of the clicked link | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsLinks.new( + count: 1, + event_time: 2017-03-12T20:15:13Z, + ip: 165.87.3.15, + url: www.myshop.com +) +``` + diff --git a/docs/GetExtendedContactDetailsAllOfStatisticsMessagesSent.md b/docs/GetExtendedContactDetailsAllOfStatisticsMessagesSent.md new file mode 100644 index 0000000..3b4875c --- /dev/null +++ b/docs/GetExtendedContactDetailsAllOfStatisticsMessagesSent.md @@ -0,0 +1,20 @@ +# SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsMessagesSent + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | ID of the campaign which generated the event | | +| **event_time** | **String** | UTC date-time of the event | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsMessagesSent.new( + campaign_id: 3, + event_time: 2017-03-12T20:15:13Z +) +``` + diff --git a/docs/GetExtendedContactDetailsAllOfStatisticsOpened.md b/docs/GetExtendedContactDetailsAllOfStatisticsOpened.md new file mode 100644 index 0000000..179de33 --- /dev/null +++ b/docs/GetExtendedContactDetailsAllOfStatisticsOpened.md @@ -0,0 +1,24 @@ +# SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsOpened + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | ID of the campaign which generated the event | | +| **count** | **Integer** | Number of openings for the campaign | | +| **event_time** | **String** | UTC date-time of the event | | +| **ip** | **String** | IP from which the user has opened the email | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsOpened.new( + campaign_id: 3, + count: 1, + event_time: 2017-03-12T20:15:13Z, + ip: 165.87.3.15 +) +``` + diff --git a/docs/GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.md b/docs/GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.md new file mode 100644 index 0000000..f0256f0 --- /dev/null +++ b/docs/GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.md @@ -0,0 +1,20 @@ +# SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptions + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **user_unsubscription** | [**Array<GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription>**](GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.md) | Contact unsubscribe via unsubscription link in a campaign | | +| **admin_unsubscription** | [**Array<GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription>**](GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.md) | Contact has been unsubscribed from the administrator | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.new( + user_unsubscription: null, + admin_unsubscription: null +) +``` + diff --git a/docs/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.md b/docs/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.md new file mode 100644 index 0000000..04e0e34 --- /dev/null +++ b/docs/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.md @@ -0,0 +1,20 @@ +# SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **event_time** | **String** | UTC date-time of the event | | +| **ip** | **String** | IP from which the user has been unsubscribed | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.new( + event_time: 2017-03-12T20:15:13Z, + ip: 165.87.3.15 +) +``` + diff --git a/docs/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.md b/docs/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.md new file mode 100644 index 0000000..3999cbc --- /dev/null +++ b/docs/GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.md @@ -0,0 +1,22 @@ +# SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | ID of the campaign which generated the event | | +| **event_time** | **String** | UTC date-time of the event | | +| **ip** | **String** | IP from which the user has unsubscribed | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.new( + campaign_id: 3, + event_time: 2017-03-12T20:15:13Z, + ip: 165.87.3.15 +) +``` + diff --git a/docs/GetExtendedContactDetailsStatistics.md b/docs/GetExtendedContactDetailsStatistics.md deleted file mode 100644 index 31ff60a..0000000 --- a/docs/GetExtendedContactDetailsStatistics.md +++ /dev/null @@ -1,15 +0,0 @@ -# SibApiV3Sdk::GetExtendedContactDetailsStatistics - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**messages_sent** | [**Array<GetExtendedContactDetailsStatisticsMessagesSent>**](GetExtendedContactDetailsStatisticsMessagesSent.md) | Listing of the sent campaign for the contact | [optional] -**hard_bounces** | [**Array<GetExtendedContactDetailsStatisticsMessagesSent>**](GetExtendedContactDetailsStatisticsMessagesSent.md) | Listing of the hardbounes generated by the contact | [optional] -**soft_bounces** | [**Array<GetExtendedContactDetailsStatisticsMessagesSent>**](GetExtendedContactDetailsStatisticsMessagesSent.md) | Listing of the softbounes generated by the contact | [optional] -**complaints** | [**Array<GetExtendedContactDetailsStatisticsMessagesSent>**](GetExtendedContactDetailsStatisticsMessagesSent.md) | Listing of the complaints generated by the contact | [optional] -**unsubscriptions** | [**GetExtendedContactDetailsStatisticsUnsubscriptions**](GetExtendedContactDetailsStatisticsUnsubscriptions.md) | | [optional] -**opened** | [**Array<GetExtendedContactDetailsStatisticsOpened>**](GetExtendedContactDetailsStatisticsOpened.md) | Listing of the openings generated by the contact | [optional] -**clicked** | [**Array<GetExtendedContactDetailsStatisticsClicked>**](GetExtendedContactDetailsStatisticsClicked.md) | Listing of the clicks generated by the contact | [optional] -**transac_attributes** | **Array<Object>** | Listing of the transactional attributes for the contact | [optional] - - diff --git a/docs/GetExtendedContactDetailsStatisticsClicked.md b/docs/GetExtendedContactDetailsStatisticsClicked.md deleted file mode 100644 index 20fde0a..0000000 --- a/docs/GetExtendedContactDetailsStatisticsClicked.md +++ /dev/null @@ -1,9 +0,0 @@ -# SibApiV3Sdk::GetExtendedContactDetailsStatisticsClicked - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**campaign_id** | **Integer** | ID of the campaign which generated the event | -**links** | [**Array<GetExtendedContactDetailsStatisticsLinks>**](GetExtendedContactDetailsStatisticsLinks.md) | Listing of the clicked links for the campaign | - - diff --git a/docs/GetExtendedContactDetailsStatisticsLinks.md b/docs/GetExtendedContactDetailsStatisticsLinks.md deleted file mode 100644 index 6533e3c..0000000 --- a/docs/GetExtendedContactDetailsStatisticsLinks.md +++ /dev/null @@ -1,11 +0,0 @@ -# SibApiV3Sdk::GetExtendedContactDetailsStatisticsLinks - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **Integer** | Number of clicks on this link for the campaign | -**event_time** | **String** | UTC date-time of the event | -**ip** | **String** | IP from which the user has clicked on the link | -**url** | **String** | URL of the clicked link | - - diff --git a/docs/GetExtendedContactDetailsStatisticsMessagesSent.md b/docs/GetExtendedContactDetailsStatisticsMessagesSent.md deleted file mode 100644 index 32c3e33..0000000 --- a/docs/GetExtendedContactDetailsStatisticsMessagesSent.md +++ /dev/null @@ -1,9 +0,0 @@ -# SibApiV3Sdk::GetExtendedContactDetailsStatisticsMessagesSent - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**campaign_id** | **Integer** | ID of the campaign which generated the event | -**event_time** | **String** | UTC date-time of the event | - - diff --git a/docs/GetExtendedContactDetailsStatisticsOpened.md b/docs/GetExtendedContactDetailsStatisticsOpened.md deleted file mode 100644 index a2bf762..0000000 --- a/docs/GetExtendedContactDetailsStatisticsOpened.md +++ /dev/null @@ -1,11 +0,0 @@ -# SibApiV3Sdk::GetExtendedContactDetailsStatisticsOpened - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**campaign_id** | **Integer** | ID of the campaign which generated the event | -**count** | **Integer** | Number of openings for the campaign | -**event_time** | **String** | UTC date-time of the event | -**ip** | **String** | IP from which the user has opened the email | - - diff --git a/docs/GetExtendedContactDetailsStatisticsUnsubscriptions.md b/docs/GetExtendedContactDetailsStatisticsUnsubscriptions.md deleted file mode 100644 index 39e4244..0000000 --- a/docs/GetExtendedContactDetailsStatisticsUnsubscriptions.md +++ /dev/null @@ -1,9 +0,0 @@ -# SibApiV3Sdk::GetExtendedContactDetailsStatisticsUnsubscriptions - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**user_unsubscription** | [**Array<GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription>**](GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.md) | Contact unsubscribe via unsubscription link in a campaign | -**admin_unsubscription** | [**Array<GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription>**](GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.md) | Contact has been unsubscribed from the administrator | - - diff --git a/docs/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.md b/docs/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.md deleted file mode 100644 index 7444a07..0000000 --- a/docs/GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.md +++ /dev/null @@ -1,9 +0,0 @@ -# SibApiV3Sdk::GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**event_time** | **String** | UTC date-time of the event | -**ip** | **String** | IP from which the user has been unsubscribed | [optional] - - diff --git a/docs/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.md b/docs/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.md deleted file mode 100644 index 5b59739..0000000 --- a/docs/GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.md +++ /dev/null @@ -1,10 +0,0 @@ -# SibApiV3Sdk::GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**campaign_id** | **Integer** | ID of the campaign which generated the event | -**event_time** | **String** | UTC date-time of the event | -**ip** | **String** | IP from which the user has unsubscribed | [optional] - - diff --git a/docs/GetExtendedList.md b/docs/GetExtendedList.md index ae19ceb..975a81b 100644 --- a/docs/GetExtendedList.md +++ b/docs/GetExtendedList.md @@ -1,15 +1,34 @@ # SibApiV3Sdk::GetExtendedList ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | ID of the list | -**name** | **String** | Name of the list | -**total_blacklisted** | **Integer** | Number of blacklisted contacts in the list | -**total_subscribers** | **Integer** | Number of contacts in the list | -**folder_id** | **Integer** | ID of the folder | -**created_at** | **String** | Creation UTC date-time of the list (YYYY-MM-DDTHH:mm:ss.SSSZ) | -**campaign_stats** | [**Array<GetExtendedListCampaignStats>**](GetExtendedListCampaignStats.md) | | [optional] -**dynamic_list** | **BOOLEAN** | Status telling if the list is dynamic or not (true=dynamic, false=not dynamic) | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **Integer** | ID of the list | | +| **name** | **String** | Name of the list | | +| **total_blacklisted** | **Integer** | Number of blacklisted contacts in the list | | +| **total_subscribers** | **Integer** | Number of contacts in the list | | +| **unique_subscribers** | **Integer** | Number of unique contacts in the list | | +| **folder_id** | **Integer** | ID of the folder | | +| **created_at** | **String** | Creation UTC date-time of the list (YYYY-MM-DDTHH:mm:ss.SSSZ) | | +| **campaign_stats** | [**Array<GetExtendedListAllOfCampaignStats>**](GetExtendedListAllOfCampaignStats.md) | | [optional] | +| **dynamic_list** | **Boolean** | Status telling if the list is dynamic or not (true=dynamic, false=not dynamic) | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedList.new( + id: 23, + name: Magento Customers - EN, + total_blacklisted: 13, + total_subscribers: 1776, + unique_subscribers: 1789, + folder_id: 2, + created_at: 2017-03-13T17:05:09Z, + campaign_stats: null, + dynamic_list: false +) +``` diff --git a/docs/GetExtendedListAllOf.md b/docs/GetExtendedListAllOf.md new file mode 100644 index 0000000..50b0237 --- /dev/null +++ b/docs/GetExtendedListAllOf.md @@ -0,0 +1,24 @@ +# SibApiV3Sdk::GetExtendedListAllOf + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **folder_id** | **Integer** | ID of the folder | | +| **created_at** | **String** | Creation UTC date-time of the list (YYYY-MM-DDTHH:mm:ss.SSSZ) | | +| **campaign_stats** | [**Array<GetExtendedListAllOfCampaignStats>**](GetExtendedListAllOfCampaignStats.md) | | [optional] | +| **dynamic_list** | **Boolean** | Status telling if the list is dynamic or not (true=dynamic, false=not dynamic) | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedListAllOf.new( + folder_id: 2, + created_at: 2017-03-13T17:05:09Z, + campaign_stats: null, + dynamic_list: false +) +``` + diff --git a/docs/GetExtendedListAllOfCampaignStats.md b/docs/GetExtendedListAllOfCampaignStats.md new file mode 100644 index 0000000..039d8c8 --- /dev/null +++ b/docs/GetExtendedListAllOfCampaignStats.md @@ -0,0 +1,20 @@ +# SibApiV3Sdk::GetExtendedListAllOfCampaignStats + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | ID of the campaign | | +| **stats** | [**GetCampaignStats**](GetCampaignStats.md) | | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetExtendedListAllOfCampaignStats.new( + campaign_id: 143, + stats: null +) +``` + diff --git a/docs/GetExtendedListCampaignStats.md b/docs/GetExtendedListCampaignStats.md deleted file mode 100644 index 58a153e..0000000 --- a/docs/GetExtendedListCampaignStats.md +++ /dev/null @@ -1,9 +0,0 @@ -# SibApiV3Sdk::GetExtendedListCampaignStats - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**campaign_id** | **Integer** | ID of the campaign | -**stats** | [**GetCampaignStats**](GetCampaignStats.md) | | - - diff --git a/docs/GetFolder.md b/docs/GetFolder.md index 093c0c4..2f4c7cf 100644 --- a/docs/GetFolder.md +++ b/docs/GetFolder.md @@ -1,12 +1,26 @@ # SibApiV3Sdk::GetFolder ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | ID of the folder | -**name** | **String** | Name of the folder | -**total_blacklisted** | **Integer** | Number of blacklisted contacts in the folder | -**total_subscribers** | **Integer** | Number of contacts in the folder | -**unique_subscribers** | **Integer** | Number of unique contacts in the folder | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **Integer** | ID of the folder | | +| **name** | **String** | Name of the folder | | +| **total_blacklisted** | **Integer** | Number of blacklisted contacts in the folder | | +| **total_subscribers** | **Integer** | Number of contacts in the folder | | +| **unique_subscribers** | **Integer** | Number of unique contacts in the folder | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetFolder.new( + id: 2, + name: Magento Customers, + total_blacklisted: 32, + total_subscribers: 19777, + unique_subscribers: 16222 +) +``` diff --git a/docs/GetFolderLists.md b/docs/GetFolderLists.md index 7f80556..4711e72 100644 --- a/docs/GetFolderLists.md +++ b/docs/GetFolderLists.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::GetFolderLists ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**lists** | **Array<Object>** | | [optional] -**count** | **Integer** | Number of lists in the folder | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **lists** | [**Array<GetList>**](GetList.md) | | [optional] | +| **count** | **Integer** | Number of lists in the folder | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetFolderLists.new( + lists: null, + count: 6 +) +``` diff --git a/docs/GetFolders.md b/docs/GetFolders.md index f00909b..c36c68b 100644 --- a/docs/GetFolders.md +++ b/docs/GetFolders.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::GetFolders ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**folders** | **Array<Object>** | | [optional] -**count** | **Integer** | Number of folders available in your account | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **folders** | [**Array<GetFolder>**](GetFolder.md) | | [optional] | +| **count** | **Integer** | Number of folders available in your account | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetFolders.new( + folders: null, + count: 10 +) +``` diff --git a/docs/GetIp.md b/docs/GetIp.md index e8766c4..a9ba1f1 100644 --- a/docs/GetIp.md +++ b/docs/GetIp.md @@ -1,11 +1,24 @@ # SibApiV3Sdk::GetIp ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | ID of the dedicated IP | -**ip** | **String** | Dedicated IP | -**active** | **BOOLEAN** | Status of the IP (true=active, false=inactive) | -**domain** | **String** | Domain associated to the IP | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **Integer** | ID of the dedicated IP | | +| **ip** | **String** | Dedicated IP | | +| **active** | **Boolean** | Status of the IP (true=active, false=inactive) | | +| **domain** | **String** | Domain associated to the IP | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetIp.new( + id: 3, + ip: 123.65.8.22, + active: true, + domain: mailing.myshop.com +) +``` diff --git a/docs/GetIpFromSender.md b/docs/GetIpFromSender.md index 03cc078..89003e1 100644 --- a/docs/GetIpFromSender.md +++ b/docs/GetIpFromSender.md @@ -1,11 +1,24 @@ # SibApiV3Sdk::GetIpFromSender ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | ID of the dedicated IP | -**ip** | **String** | Dedicated IP | -**domain** | **String** | Domain associated to the IP | -**weight** | **Integer** | Weight of the IP | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **Integer** | ID of the dedicated IP | | +| **ip** | **String** | Dedicated IP | | +| **domain** | **String** | Domain associated to the IP | | +| **weight** | **Integer** | Weight of the IP | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetIpFromSender.new( + id: 3, + ip: 123.65.8.22, + domain: mailing.myshop.dom, + weight: 75 +) +``` diff --git a/docs/GetIps.md b/docs/GetIps.md index 67ed60e..6fbf206 100644 --- a/docs/GetIps.md +++ b/docs/GetIps.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::GetIps ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ips** | [**Array<GetIp>**](GetIp.md) | Dedicated IP(s) available on your account | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **ips** | [**Array<GetIp>**](GetIp.md) | Dedicated IP(s) available on your account | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetIps.new( + ips: null +) +``` diff --git a/docs/GetIpsFromSender.md b/docs/GetIpsFromSender.md index 6261c48..d91d4ee 100644 --- a/docs/GetIpsFromSender.md +++ b/docs/GetIpsFromSender.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::GetIpsFromSender ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ips** | [**Array<GetIpFromSender>**](GetIpFromSender.md) | Dedicated IP(s) linked to a sender | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **ips** | [**Array<GetIpFromSender>**](GetIpFromSender.md) | Dedicated IP(s) linked to a sender | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetIpsFromSender.new( + ips: null +) +``` diff --git a/docs/GetList.md b/docs/GetList.md index 2288574..54297a9 100644 --- a/docs/GetList.md +++ b/docs/GetList.md @@ -1,11 +1,26 @@ # SibApiV3Sdk::GetList ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | ID of the list | -**name** | **String** | Name of the list | -**total_blacklisted** | **Integer** | Number of blacklisted contacts in the list | -**total_subscribers** | **Integer** | Number of contacts in the list | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **Integer** | ID of the list | | +| **name** | **String** | Name of the list | | +| **total_blacklisted** | **Integer** | Number of blacklisted contacts in the list | | +| **total_subscribers** | **Integer** | Number of contacts in the list | | +| **unique_subscribers** | **Integer** | Number of unique contacts in the list | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetList.new( + id: 23, + name: Magento Customers - EN, + total_blacklisted: 13, + total_subscribers: 1776, + unique_subscribers: 1789 +) +``` diff --git a/docs/GetLists.md b/docs/GetLists.md index 3360f12..c4b358b 100644 --- a/docs/GetLists.md +++ b/docs/GetLists.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::GetLists ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**lists** | **Array<Object>** | Listing of all the lists available in your account | [optional] -**count** | **Integer** | Number of lists in your account | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **lists** | [**Array<GetList>**](GetList.md) | Listing of all the lists available in your account | [optional] | +| **count** | **Integer** | Number of lists in your account | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetLists.new( + lists: null, + count: 150 +) +``` diff --git a/docs/GetProcess.md b/docs/GetProcess.md index 905dc57..90b0376 100644 --- a/docs/GetProcess.md +++ b/docs/GetProcess.md @@ -1,11 +1,24 @@ # SibApiV3Sdk::GetProcess ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | Id of the process | -**status** | **String** | Status of the process | -**name** | **String** | Process name | -**export_url** | **String** | URL on which send export the of contacts once the process is completed | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **Integer** | Id of the process | | +| **status** | **String** | Status of the process | | +| **name** | **String** | Process name | | +| **export_url** | **String** | URL on which send export the of contacts once the process is completed | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetProcess.new( + id: 145, + status: queued, + name: IMPORTUSER, + export_url: http://requestb.in/16ua3aj1 +) +``` diff --git a/docs/GetProcesses.md b/docs/GetProcesses.md index 8a9e388..47cbaf8 100644 --- a/docs/GetProcesses.md +++ b/docs/GetProcesses.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::GetProcesses ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**processes** | [**Array<GetProcess>**](GetProcess.md) | List of processes available on your account | [optional] -**count** | **Integer** | Number of processes available on your account | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **processes** | [**Array<GetProcess>**](GetProcess.md) | List of processes available on your account | [optional] | +| **count** | **Integer** | Number of processes available on your account | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetProcesses.new( + processes: null, + count: 5 +) +``` diff --git a/docs/GetReports.md b/docs/GetReports.md index 4e786fd..eec1763 100644 --- a/docs/GetReports.md +++ b/docs/GetReports.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::GetReports ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**reports** | [**Array<GetReportsReports>**](GetReportsReports.md) | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **reports** | [**Array<GetReportsReports>**](GetReportsReports.md) | | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetReports.new( + reports: null +) +``` diff --git a/docs/GetReportsReports.md b/docs/GetReportsReports.md index 3dc680d..f7c563c 100644 --- a/docs/GetReportsReports.md +++ b/docs/GetReportsReports.md @@ -1,20 +1,42 @@ # SibApiV3Sdk::GetReportsReports ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**date** | **Date** | Date of the statistics | -**requests** | **Integer** | Number of requests for the date | -**delivered** | **Integer** | Number of delivered emails for the date | -**hard_bounces** | **Integer** | Number of hardbounces for the date | -**soft_bounces** | **Integer** | Number of softbounces for the date | -**clicks** | **Integer** | Number of clicks for the date | -**unique_clicks** | **Integer** | Number of unique clicks for the date | -**opens** | **Integer** | Number of openings for the date | -**unique_opens** | **Integer** | Number of unique openings for the date | -**spam_reports** | **Integer** | Number of complaints (spam reports) for the date | -**blocked** | **Integer** | Number of blocked emails for the date | -**invalid** | **Integer** | Number of invalid emails for the date | -**unsubscribed** | **Integer** | Number of unsubscribed emails for the date | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **date** | **Date** | Date of the statistics | | +| **requests** | **Integer** | Number of requests for the date | | +| **delivered** | **Integer** | Number of delivered emails for the date | | +| **hard_bounces** | **Integer** | Number of hardbounces for the date | | +| **soft_bounces** | **Integer** | Number of softbounces for the date | | +| **clicks** | **Integer** | Number of clicks for the date | | +| **unique_clicks** | **Integer** | Number of unique clicks for the date | | +| **opens** | **Integer** | Number of openings for the date | | +| **unique_opens** | **Integer** | Number of unique openings for the date | | +| **spam_reports** | **Integer** | Number of complaints (spam reports) for the date | | +| **blocked** | **Integer** | Number of blocked emails for the date | | +| **invalid** | **Integer** | Number of invalid emails for the date | | +| **unsubscribed** | **Integer** | Number of unsubscribed emails for the date | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetReportsReports.new( + date: Thu Apr 06 05:30:00 IST 2017, + requests: 65, + delivered: 63, + hard_bounces: 1, + soft_bounces: 1, + clicks: 6, + unique_clicks: 5, + opens: 58, + unique_opens: 52, + spam_reports: 0, + blocked: 0, + invalid: 0, + unsubscribed: 0 +) +``` diff --git a/docs/GetSendersList.md b/docs/GetSendersList.md index 8d74b03..9d512e2 100644 --- a/docs/GetSendersList.md +++ b/docs/GetSendersList.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::GetSendersList ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**senders** | [**Array<GetSendersListSenders>**](GetSendersListSenders.md) | List of the senders available in your account | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **senders** | [**Array<GetSendersListSenders>**](GetSendersListSenders.md) | List of the senders available in your account | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetSendersList.new( + senders: null +) +``` diff --git a/docs/GetSendersListIps.md b/docs/GetSendersListIps.md index 278f139..9546fa8 100644 --- a/docs/GetSendersListIps.md +++ b/docs/GetSendersListIps.md @@ -1,10 +1,22 @@ # SibApiV3Sdk::GetSendersListIps ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ip** | **String** | Dedicated IP available in your account | -**domain** | **String** | Domain of the IP | -**weight** | **Integer** | Weight of the IP for this sender | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **ip** | **String** | Dedicated IP available in your account | | +| **domain** | **String** | Domain of the IP | | +| **weight** | **Integer** | Weight of the IP for this sender | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetSendersListIps.new( + ip: 123.98.689.7, + domain: mycompany.com, + weight: 50 +) +``` diff --git a/docs/GetSendersListSenders.md b/docs/GetSendersListSenders.md index 1bdb75a..ffe9d56 100644 --- a/docs/GetSendersListSenders.md +++ b/docs/GetSendersListSenders.md @@ -1,12 +1,26 @@ # SibApiV3Sdk::GetSendersListSenders ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | Id of the sender | -**name** | **String** | From Name associated to the sender | -**email** | **String** | From Email associated to the sender | -**active** | **BOOLEAN** | Status of sender (true=activated, false=deactivated) | -**ips** | [**Array<GetSendersListIps>**](GetSendersListIps.md) | List of dedicated IP(s) available in the account. This data is displayed only for dedicated IPs | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **Integer** | Id of the sender | | +| **name** | **String** | From Name associated to the sender | | +| **email** | **String** | From Email associated to the sender | | +| **active** | **Boolean** | Status of sender (true=activated, false=deactivated) | | +| **ips** | [**Array<GetSendersListIps>**](GetSendersListIps.md) | List of dedicated IP(s) available in the account. This data is displayed only for dedicated IPs | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetSendersListSenders.new( + id: 0, + name: Marketing, + email: marketing@mycompany.com, + active: false, + ips: null +) +``` diff --git a/docs/GetSharedTemplateUrl.md b/docs/GetSharedTemplateUrl.md index 65f38bc..f9d9967 100644 --- a/docs/GetSharedTemplateUrl.md +++ b/docs/GetSharedTemplateUrl.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::GetSharedTemplateUrl ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**shared_url** | **String** | A unique URL for the email campaign or transactional template. This URL can be shared with other Sendinblue users. | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **shared_url** | **String** | A unique URL for the email campaign or transactional template. This URL can be shared with other Sendinblue users. | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetSharedTemplateUrl.new( + shared_url: https://my.sendinblue.com/pt2YU7R5W_guXlowgumy_VX4pFsKu._zd0Gjj96x1_GMmzc1Qps5ZIpj6nx- +) +``` diff --git a/docs/GetSmsCampaign.md b/docs/GetSmsCampaign.md index 6f51b1a..75969b0 100644 --- a/docs/GetSmsCampaign.md +++ b/docs/GetSmsCampaign.md @@ -1,17 +1,36 @@ # SibApiV3Sdk::GetSmsCampaign ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | ID of the SMS Campaign | -**name** | **String** | Name of the SMS Campaign | -**status** | **String** | Status of the SMS Campaign | -**content** | **String** | Content of the SMS Campaign | -**scheduled_at** | **String** | UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format | [optional] -**sender** | **String** | Sender of the SMS Campaign | -**created_at** | **String** | Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | -**modified_at** | **String** | UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | -**recipients** | [**GetSmsCampaignRecipients**](GetSmsCampaignRecipients.md) | | -**statistics** | [**GetSmsCampaignRecipients**](GetSmsCampaignRecipients.md) | | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **Integer** | ID of the SMS Campaign | | +| **name** | **String** | Name of the SMS Campaign | | +| **status** | **String** | Status of the SMS Campaign | | +| **content** | **String** | Content of the SMS Campaign | | +| **scheduled_at** | **String** | UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format | [optional] | +| **sender** | **String** | Sender of the SMS Campaign | | +| **created_at** | **String** | Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | | +| **modified_at** | **String** | UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | | +| **recipients** | [**GetCampaignRecipients**](GetCampaignRecipients.md) | | | +| **statistics** | [**GetSmsCampaignStats**](GetSmsCampaignStats.md) | | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetSmsCampaign.new( + id: 2, + name: PROMO CODE, + status: draft, + content: Visit our Store and get some discount !, + scheduled_at: 2017-06-01T12:30:00Z, + sender: MyCompany, + created_at: 2017-06-01T12:30:00Z, + modified_at: 2017-05-01T12:30:00Z, + recipients: null, + statistics: null +) +``` diff --git a/docs/GetSmsCampaignAllOf.md b/docs/GetSmsCampaignAllOf.md new file mode 100644 index 0000000..b1904eb --- /dev/null +++ b/docs/GetSmsCampaignAllOf.md @@ -0,0 +1,20 @@ +# SibApiV3Sdk::GetSmsCampaignAllOf + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **recipients** | [**GetCampaignRecipients**](GetCampaignRecipients.md) | | | +| **statistics** | [**GetSmsCampaignStats**](GetSmsCampaignStats.md) | | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetSmsCampaignAllOf.new( + recipients: null, + statistics: null +) +``` + diff --git a/docs/GetSmsCampaignOverview.md b/docs/GetSmsCampaignOverview.md index bbf4fa1..c1ca280 100644 --- a/docs/GetSmsCampaignOverview.md +++ b/docs/GetSmsCampaignOverview.md @@ -1,15 +1,32 @@ # SibApiV3Sdk::GetSmsCampaignOverview ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | ID of the SMS Campaign | -**name** | **String** | Name of the SMS Campaign | -**status** | **String** | Status of the SMS Campaign | -**content** | **String** | Content of the SMS Campaign | -**scheduled_at** | **String** | UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format | [optional] -**sender** | **String** | Sender of the SMS Campaign | -**created_at** | **String** | Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | -**modified_at** | **String** | UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **Integer** | ID of the SMS Campaign | | +| **name** | **String** | Name of the SMS Campaign | | +| **status** | **String** | Status of the SMS Campaign | | +| **content** | **String** | Content of the SMS Campaign | | +| **scheduled_at** | **String** | UTC date-time on which SMS campaign is scheduled. Should be in YYYY-MM-DDTHH:mm:ss.SSSZ format | [optional] | +| **sender** | **String** | Sender of the SMS Campaign | | +| **created_at** | **String** | Creation UTC date-time of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | | +| **modified_at** | **String** | UTC date-time of last modification of the SMS campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetSmsCampaignOverview.new( + id: 2, + name: PROMO CODE, + status: draft, + content: Visit our Store and get some discount !, + scheduled_at: 2017-06-01T12:30:00Z, + sender: MyCompany, + created_at: 2017-06-01T12:30:00Z, + modified_at: 2017-05-01T12:30:00Z +) +``` diff --git a/docs/GetSmsCampaignRecipients.md b/docs/GetSmsCampaignRecipients.md deleted file mode 100644 index ec6cf36..0000000 --- a/docs/GetSmsCampaignRecipients.md +++ /dev/null @@ -1,7 +0,0 @@ -# SibApiV3Sdk::GetSmsCampaignRecipients - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - diff --git a/docs/GetSmsCampaignStats.md b/docs/GetSmsCampaignStats.md index a8be76d..f88d59c 100644 --- a/docs/GetSmsCampaignStats.md +++ b/docs/GetSmsCampaignStats.md @@ -1,14 +1,30 @@ # SibApiV3Sdk::GetSmsCampaignStats ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**delivered** | **Integer** | Number of delivered SMS | -**sent** | **Integer** | Number of sent SMS | -**processing** | **Integer** | Number of processing SMS | -**soft_bounces** | **Integer** | Number of softbounced SMS | -**hard_bounces** | **Integer** | Number of hardbounced SMS | -**unsubscriptions** | **Integer** | Number of unsubscription SMS | -**answered** | **Integer** | Number of replies to the SMS | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **delivered** | **Integer** | Number of delivered SMS | | +| **sent** | **Integer** | Number of sent SMS | | +| **processing** | **Integer** | Number of processing SMS | | +| **soft_bounces** | **Integer** | Number of softbounced SMS | | +| **hard_bounces** | **Integer** | Number of hardbounced SMS | | +| **unsubscriptions** | **Integer** | Number of unsubscription SMS | | +| **answered** | **Integer** | Number of replies to the SMS | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetSmsCampaignStats.new( + delivered: 2987, + sent: 3000, + processing: 0, + soft_bounces: 3, + hard_bounces: 1, + unsubscriptions: 3, + answered: 2 +) +``` diff --git a/docs/GetSmsCampaigns.md b/docs/GetSmsCampaigns.md index daf7612..711865b 100644 --- a/docs/GetSmsCampaigns.md +++ b/docs/GetSmsCampaigns.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::GetSmsCampaigns ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**campaigns** | **Array<Object>** | | [optional] -**count** | **Integer** | Number of SMS campaigns retrieved | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaigns** | [**Array<GetSmsCampaignOverview>**](GetSmsCampaignOverview.md) | | [optional] | +| **count** | **Integer** | Number of SMS campaigns retrieved | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetSmsCampaigns.new( + campaigns: null, + count: 12 +) +``` diff --git a/docs/GetSmsEventReport.md b/docs/GetSmsEventReport.md index cb0d716..a34805c 100644 --- a/docs/GetSmsEventReport.md +++ b/docs/GetSmsEventReport.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::GetSmsEventReport ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**events** | [**Array<GetSmsEventReportEvents>**](GetSmsEventReportEvents.md) | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **events** | [**Array<GetSmsEventReportEvents>**](GetSmsEventReportEvents.md) | | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetSmsEventReport.new( + events: null +) +``` diff --git a/docs/GetSmsEventReportEvents.md b/docs/GetSmsEventReportEvents.md index 7ceef3b..741e834 100644 --- a/docs/GetSmsEventReportEvents.md +++ b/docs/GetSmsEventReportEvents.md @@ -1,14 +1,30 @@ # SibApiV3Sdk::GetSmsEventReportEvents ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**phone_number** | **String** | Phone number which has generated the event | [optional] -**date** | **String** | UTC date-time on which the event has been generated | [optional] -**message_id** | **String** | Message ID which generated the event | [optional] -**event** | **String** | Event which occurred | [optional] -**reason** | **String** | Reason of bounce (only available if the event is hardbounce or softbounce) | [optional] -**reply** | **String** | | [optional] -**tag** | **String** | Tag of the SMS which generated the event | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **phone_number** | **String** | Phone number which has generated the event | [optional] | +| **date** | **String** | UTC date-time on which the event has been generated | [optional] | +| **message_id** | **String** | Message ID which generated the event | [optional] | +| **event** | **String** | Event which occurred | [optional] | +| **reason** | **String** | Reason of bounce (only available if the event is hardbounce or softbounce) | [optional] | +| **reply** | **String** | | [optional] | +| **tag** | **String** | Tag of the SMS which generated the event | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetSmsEventReportEvents.new( + phone_number: 00189001094, + date: 2017-03-12T12:30:00Z, + message_id: 1472640582425378, + event: accepted, + reason: Message is undeliverable due to an incorrect / invalid / blacklisted / permanently barred MSISDN for this operator, + reply: null, + tag: CabWaiting +) +``` diff --git a/docs/GetSmtpTemplateOverview.md b/docs/GetSmtpTemplateOverview.md index 104fa21..edd1ed8 100644 --- a/docs/GetSmtpTemplateOverview.md +++ b/docs/GetSmtpTemplateOverview.md @@ -1,20 +1,42 @@ # SibApiV3Sdk::GetSmtpTemplateOverview ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Integer** | ID of the template | -**name** | **String** | Name of the template | -**subject** | **String** | Subject of the template | -**is_active** | **BOOLEAN** | Status of template (true=active, false=inactive) | -**test_sent** | **BOOLEAN** | Status of test sending for the template (true=test email has been sent, false=test email has not been sent) | -**sender** | [**GetSmtpTemplateOverviewSender**](GetSmtpTemplateOverviewSender.md) | | -**reply_to** | **String** | Email defined as the \"Reply to\" for the template | -**to_field** | **String** | Customisation of the \"to\" field for the template | -**tag** | **String** | Tag of the template | -**html_content** | **String** | HTML content of the template | -**created_at** | **String** | Creation UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) | -**modified_at** | **String** | Last modification UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) | -**doi_template** | **BOOLEAN** | It is true if template is a valid Double opt-in (DOI) template, otherwise it is false. This field will be available only in case of single template detail call. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **Integer** | ID of the template | | +| **name** | **String** | Name of the template | | +| **subject** | **String** | Subject of the template | | +| **is_active** | **Boolean** | Status of template (true=active, false=inactive) | | +| **test_sent** | **Boolean** | Status of test sending for the template (true=test email has been sent, false=test email has not been sent) | | +| **sender** | [**GetSmtpTemplateOverviewSender**](GetSmtpTemplateOverviewSender.md) | | | +| **reply_to** | **String** | Email defined as the \"Reply to\" for the template | | +| **to_field** | **String** | Customisation of the \"to\" field for the template | | +| **tag** | **String** | Tag of the template | | +| **html_content** | **String** | HTML content of the template | | +| **created_at** | **String** | Creation UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) | | +| **modified_at** | **String** | Last modification UTC date-time of the template (YYYY-MM-DDTHH:mm:ss.SSSZ) | | +| **doi_template** | **Boolean** | It is true if template is a valid Double opt-in (DOI) template, otherwise it is false. This field will be available only in case of single template detail call. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetSmtpTemplateOverview.new( + id: 4, + name: Order Confirmation - EN, + subject: Thanks for your order !, + is_active: true, + test_sent: true, + sender: null, + reply_to: replyto@domain.com, + to_field: {FIRSTNAME} {LASTNAME}, + tag: sports, + html_content: Your order n°xxxxx has been confirmed. Thanks for your purchase., + created_at: 2017-05-01T12:30:00Z, + modified_at: 2017-05-12T12:30:00Z, + doi_template: false +) +``` diff --git a/docs/GetSmtpTemplateOverviewSender.md b/docs/GetSmtpTemplateOverviewSender.md index bc7a7bd..a4bfa8f 100644 --- a/docs/GetSmtpTemplateOverviewSender.md +++ b/docs/GetSmtpTemplateOverviewSender.md @@ -1,10 +1,22 @@ # SibApiV3Sdk::GetSmtpTemplateOverviewSender ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | From email for the template | [optional] -**email** | **String** | From email for the template | [optional] -**id** | **String** | Sender id of the template | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | From email for the template | [optional] | +| **email** | **String** | From email for the template | [optional] | +| **id** | **String** | Sender id of the template | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetSmtpTemplateOverviewSender.new( + name: Mary form MyShop, + email: contact@myshop.fr, + id: 43 +) +``` diff --git a/docs/GetSmtpTemplates.md b/docs/GetSmtpTemplates.md index 4687e69..f7e2233 100644 --- a/docs/GetSmtpTemplates.md +++ b/docs/GetSmtpTemplates.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::GetSmtpTemplates ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **Integer** | Count of transactional email templates | [optional] -**templates** | [**Array<GetSmtpTemplateOverview>**](GetSmtpTemplateOverview.md) | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **count** | **Integer** | Count of transactional email templates | [optional] | +| **templates** | [**Array<GetSmtpTemplateOverview>**](GetSmtpTemplateOverview.md) | | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetSmtpTemplates.new( + count: 1, + templates: null +) +``` diff --git a/docs/GetSsoToken.md b/docs/GetSsoToken.md index 59d9236..154e916 100644 --- a/docs/GetSsoToken.md +++ b/docs/GetSsoToken.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::GetSsoToken ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**token** | **String** | Session token. It will remain valid for a short period of time only. | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **token** | **String** | Session token. It will remain valid for a short period of time only. | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetSsoToken.new( + token: ede520dxxxxxxxxxxxx76d631fba2 +) +``` diff --git a/docs/GetStatsByBrowser.md b/docs/GetStatsByBrowser.md deleted file mode 100644 index 49c19c5..0000000 --- a/docs/GetStatsByBrowser.md +++ /dev/null @@ -1,7 +0,0 @@ -# SibApiV3Sdk::GetStatsByBrowser - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - diff --git a/docs/GetStatsByDevice.md b/docs/GetStatsByDevice.md index ba6eedf..4fda7bb 100644 --- a/docs/GetStatsByDevice.md +++ b/docs/GetStatsByDevice.md @@ -1,11 +1,24 @@ # SibApiV3Sdk::GetStatsByDevice ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**desktop** | [**Hash<String, GetDeviceBrowserStats>**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of desktop devices | [optional] -**mobile** | [**Hash<String, GetDeviceBrowserStats>**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of mobile devices | [optional] -**tablet** | [**Hash<String, GetDeviceBrowserStats>**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of tablet devices | [optional] -**unknown** | [**Hash<String, GetDeviceBrowserStats>**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of unknown devices | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **desktop** | [**Hash<String, GetDeviceBrowserStats>**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of desktop devices | [optional] | +| **mobile** | [**Hash<String, GetDeviceBrowserStats>**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of mobile devices | [optional] | +| **tablet** | [**Hash<String, GetDeviceBrowserStats>**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of tablet devices | [optional] | +| **unknown** | [**Hash<String, GetDeviceBrowserStats>**](GetDeviceBrowserStats.md) | Statistics of the campaign on the basis of unknown devices | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetStatsByDevice.new( + desktop: null, + mobile: null, + tablet: null, + unknown: null +) +``` diff --git a/docs/GetStatsByDomain.md b/docs/GetStatsByDomain.md deleted file mode 100644 index c3ff0da..0000000 --- a/docs/GetStatsByDomain.md +++ /dev/null @@ -1,7 +0,0 @@ -# SibApiV3Sdk::GetStatsByDomain - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - diff --git a/docs/GetTransacAggregatedSmsReport.md b/docs/GetTransacAggregatedSmsReport.md index cf53df5..9d39948 100644 --- a/docs/GetTransacAggregatedSmsReport.md +++ b/docs/GetTransacAggregatedSmsReport.md @@ -1,17 +1,36 @@ # SibApiV3Sdk::GetTransacAggregatedSmsReport ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**range** | **String** | Time frame of the report | [optional] -**requests** | **Integer** | Number of requests for the timeframe | [optional] -**delivered** | **Integer** | Number of delivered SMS for the timeframe | [optional] -**hard_bounces** | **Integer** | Number of hardbounces for the timeframe | [optional] -**soft_bounces** | **Integer** | Number of softbounces for the timeframe | [optional] -**blocked** | **Integer** | Number of blocked contact for the timeframe | [optional] -**unsubscribed** | **Integer** | Number of unsubscription for the timeframe | [optional] -**replied** | **Integer** | Number of answered SMS for the timeframe | [optional] -**accepted** | **Integer** | Number of accepted for the timeframe | [optional] -**rejected** | **Integer** | Number of rejected for the timeframe | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **range** | **String** | Time frame of the report | [optional] | +| **requests** | **Integer** | Number of requests for the timeframe | [optional] | +| **delivered** | **Integer** | Number of delivered SMS for the timeframe | [optional] | +| **hard_bounces** | **Integer** | Number of hardbounces for the timeframe | [optional] | +| **soft_bounces** | **Integer** | Number of softbounces for the timeframe | [optional] | +| **blocked** | **Integer** | Number of blocked contact for the timeframe | [optional] | +| **unsubscribed** | **Integer** | Number of unsubscription for the timeframe | [optional] | +| **replied** | **Integer** | Number of answered SMS for the timeframe | [optional] | +| **accepted** | **Integer** | Number of accepted for the timeframe | [optional] | +| **rejected** | **Integer** | Number of rejected for the timeframe | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetTransacAggregatedSmsReport.new( + range: 2016-09-08|2017-04-06, + requests: 263, + delivered: 249, + hard_bounces: 1, + soft_bounces: 4, + blocked: 2, + unsubscribed: 6, + replied: 12, + accepted: 252, + rejected: 8 +) +``` diff --git a/docs/GetTransacBlockedContacts.md b/docs/GetTransacBlockedContacts.md index d6e8c99..b5042fb 100644 --- a/docs/GetTransacBlockedContacts.md +++ b/docs/GetTransacBlockedContacts.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::GetTransacBlockedContacts ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **Integer** | Count of blocked or unsubscribed contact | [optional] -**contacts** | [**Array<GetTransacBlockedContactsContacts>**](GetTransacBlockedContactsContacts.md) | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **count** | **Integer** | Count of blocked or unsubscribed contact | [optional] | +| **contacts** | [**Array<GetTransacBlockedContactsContacts>**](GetTransacBlockedContactsContacts.md) | | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetTransacBlockedContacts.new( + count: 1, + contacts: null +) +``` diff --git a/docs/GetTransacBlockedContactsContacts.md b/docs/GetTransacBlockedContactsContacts.md index 6a95a63..dfa98aa 100644 --- a/docs/GetTransacBlockedContactsContacts.md +++ b/docs/GetTransacBlockedContactsContacts.md @@ -1,11 +1,24 @@ # SibApiV3Sdk::GetTransacBlockedContactsContacts ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | Email address of the blocked or unsubscribed contact | -**sender_email** | **String** | Sender email address of the blocked or unsubscribed contact | -**reason** | [**GetTransacBlockedContactsReason**](GetTransacBlockedContactsReason.md) | | -**blocked_at** | **String** | Date when the contact was blocked or unsubscribed on | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Email address of the blocked or unsubscribed contact | | +| **sender_email** | **String** | Sender email address of the blocked or unsubscribed contact | | +| **reason** | [**GetTransacBlockedContactsReason**](GetTransacBlockedContactsReason.md) | | | +| **blocked_at** | **String** | Date when the contact was blocked or unsubscribed on | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetTransacBlockedContactsContacts.new( + email: john.smith@example.com, + sender_email: john.smith@example.com, + reason: null, + blocked_at: 2017-05-01T12:30:00Z +) +``` diff --git a/docs/GetTransacBlockedContactsReason.md b/docs/GetTransacBlockedContactsReason.md index 6eafcf2..0e69975 100644 --- a/docs/GetTransacBlockedContactsReason.md +++ b/docs/GetTransacBlockedContactsReason.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::GetTransacBlockedContactsReason ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **String** | Reason code for blocking / unsubscribing (This code is safe for comparison) | [optional] -**message** | **String** | Reason for blocking / unsubscribing (This string is not safe for comparison) | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **code** | **String** | Reason code for blocking / unsubscribing (This code is safe for comparison) | [optional] | +| **message** | **String** | Reason for blocking / unsubscribing (This string is not safe for comparison) | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetTransacBlockedContactsReason.new( + code: AdminBlocked, + message: Admin blocked +) +``` diff --git a/docs/GetTransacEmailContent.md b/docs/GetTransacEmailContent.md index 0b8516a..63cac4b 100644 --- a/docs/GetTransacEmailContent.md +++ b/docs/GetTransacEmailContent.md @@ -1,14 +1,30 @@ # SibApiV3Sdk::GetTransacEmailContent ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | Email address to which transactional email has been sent | -**subject** | **String** | Subject of the sent email | -**template_id** | **Integer** | Id of the template | [optional] -**date** | **String** | Date on which transactional email was sent | -**events** | [**Array<GetTransacEmailContentEvents>**](GetTransacEmailContentEvents.md) | Series of events which occurred on the transactional email | -**body** | **String** | Actual content of the transactional email that has been sent | -**attachment_count** | **Integer** | Count of the attachments that were sent in the email | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Email address to which transactional email has been sent | | +| **subject** | **String** | Subject of the sent email | | +| **template_id** | **Integer** | Id of the template | [optional] | +| **date** | **String** | Date on which transactional email was sent | | +| **events** | [**Array<GetTransacEmailContentEvents>**](GetTransacEmailContentEvents.md) | Series of events which occurred on the transactional email | | +| **body** | **String** | Actual content of the transactional email that has been sent | | +| **attachment_count** | **Integer** | Count of the attachments that were sent in the email | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetTransacEmailContent.new( + email: abc@example.com, + subject: Summer Camp, + template_id: 2, + date: 2017-03-12T12:30:00Z, + events: null, + body: <!DOCTYPE html> <html> <body> <h1>Greetings from the team</h1> <p>This is the actual html content sent</p> </body> </html>, + attachment_count: 2 +) +``` diff --git a/docs/GetTransacEmailContentEvents.md b/docs/GetTransacEmailContentEvents.md index f5ee9b7..dde755c 100644 --- a/docs/GetTransacEmailContentEvents.md +++ b/docs/GetTransacEmailContentEvents.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::GetTransacEmailContentEvents ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Name of the event that occurred on the sent email | -**time** | **String** | Time at which the event occurred | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of the event that occurred on the sent email | | +| **time** | **String** | Time at which the event occurred | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetTransacEmailContentEvents.new( + name: delivered, + time: 2017-03-12T12:30:00Z +) +``` diff --git a/docs/GetTransacEmailsList.md b/docs/GetTransacEmailsList.md index d448d61..fd8f4ea 100644 --- a/docs/GetTransacEmailsList.md +++ b/docs/GetTransacEmailsList.md @@ -1,8 +1,20 @@ # SibApiV3Sdk::GetTransacEmailsList ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**transactional_emails** | [**Array<GetTransacEmailsListTransactionalEmails>**](GetTransacEmailsListTransactionalEmails.md) | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **count** | **Integer** | Total number of transactional emails available on your account according to the passed filter | [optional] | +| **transactional_emails** | [**Array<GetTransacEmailsListTransactionalEmails>**](GetTransacEmailsListTransactionalEmails.md) | | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetTransacEmailsList.new( + count: 5, + transactional_emails: null +) +``` diff --git a/docs/GetTransacEmailsListTransactionalEmails.md b/docs/GetTransacEmailsListTransactionalEmails.md index dd407ab..193b52a 100644 --- a/docs/GetTransacEmailsListTransactionalEmails.md +++ b/docs/GetTransacEmailsListTransactionalEmails.md @@ -1,15 +1,32 @@ # SibApiV3Sdk::GetTransacEmailsListTransactionalEmails ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | Email address to which transactional email has been sent | -**subject** | **String** | Subject of the sent email | -**template_id** | **Integer** | Id of the template | [optional] -**message_id** | **String** | Message Id of the sent email | -**uuid** | **String** | Unique id of the email sent to a particular contact | -**date** | **String** | Date on which transactional email was sent | -**from** | **String** | Email address of the sender from which the email was sent | [optional] -**tags** | **Array<String>** | Tags used for your email | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Email address to which transactional email has been sent | | +| **subject** | **String** | Subject of the sent email | | +| **template_id** | **Integer** | Id of the template | [optional] | +| **message_id** | **String** | Message Id of the sent email | | +| **uuid** | **String** | Unique id of the email sent to a particular contact | | +| **date** | **String** | Date on which transactional email was sent | | +| **from** | **String** | Email address of the sender from which the email was sent | [optional] | +| **tags** | **Array<String>** | Tags used for your email | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetTransacEmailsListTransactionalEmails.new( + email: john.smith@example.com, + subject: Summer Camp, + template_id: 2, + message_id: <201798300811.5700093@relay.domain.com>, + uuid: 5a78c-209ok98262910-s99a341, + date: 2017-03-12T12:30:00Z, + from: diana.doe@example.com, + tags: null +) +``` diff --git a/docs/GetTransacSmsReport.md b/docs/GetTransacSmsReport.md index b61ad9f..44766d5 100644 --- a/docs/GetTransacSmsReport.md +++ b/docs/GetTransacSmsReport.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::GetTransacSmsReport ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**reports** | [**Array<GetTransacSmsReportReports>**](GetTransacSmsReportReports.md) | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **reports** | [**Array<GetTransacSmsReportReports>**](GetTransacSmsReportReports.md) | | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetTransacSmsReport.new( + reports: null +) +``` diff --git a/docs/GetTransacSmsReportReports.md b/docs/GetTransacSmsReportReports.md index 92548c1..ed13f24 100644 --- a/docs/GetTransacSmsReportReports.md +++ b/docs/GetTransacSmsReportReports.md @@ -1,17 +1,36 @@ # SibApiV3Sdk::GetTransacSmsReportReports ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**date** | **Date** | Date for which statistics are retrieved | [optional] -**requests** | **Integer** | Number of requests for the date | [optional] -**delivered** | **Integer** | Number of delivered SMS for the date | [optional] -**hard_bounces** | **Integer** | Number of hardbounces for the date | [optional] -**soft_bounces** | **Integer** | Number of softbounces for the date | [optional] -**blocked** | **Integer** | Number of blocked contact for the date | [optional] -**unsubscribed** | **Integer** | Number of unsubscription for the date | [optional] -**replied** | **Integer** | Number of answered SMS for the date | [optional] -**accepted** | **Integer** | Number of accepted for the date | [optional] -**rejected** | **Integer** | Number of rejected for the date | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **date** | **Date** | Date for which statistics are retrieved | [optional] | +| **requests** | **Integer** | Number of requests for the date | [optional] | +| **delivered** | **Integer** | Number of delivered SMS for the date | [optional] | +| **hard_bounces** | **Integer** | Number of hardbounces for the date | [optional] | +| **soft_bounces** | **Integer** | Number of softbounces for the date | [optional] | +| **blocked** | **Integer** | Number of blocked contact for the date | [optional] | +| **unsubscribed** | **Integer** | Number of unsubscription for the date | [optional] | +| **replied** | **Integer** | Number of answered SMS for the date | [optional] | +| **accepted** | **Integer** | Number of accepted for the date | [optional] | +| **rejected** | **Integer** | Number of rejected for the date | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetTransacSmsReportReports.new( + date: Fri Mar 17 05:30:00 IST 2017, + requests: 87, + delivered: 85, + hard_bounces: 1, + soft_bounces: 1, + blocked: 0, + unsubscribed: 1, + replied: 2, + accepted: 85, + rejected: 1 +) +``` diff --git a/docs/GetWebhook.md b/docs/GetWebhook.md index 656f79b..763eb92 100644 --- a/docs/GetWebhook.md +++ b/docs/GetWebhook.md @@ -1,14 +1,30 @@ # SibApiV3Sdk::GetWebhook ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**url** | **String** | URL of the webhook | -**id** | **Integer** | ID of the webhook | -**description** | **String** | Description of the webhook | -**events** | **Array<String>** | | -**type** | **String** | Type of webhook (marketing or transac) | -**created_at** | **String** | Creation UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) | -**modified_at** | **String** | Last modification UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **url** | **String** | URL of the webhook | | +| **id** | **Integer** | ID of the webhook | | +| **description** | **String** | Description of the webhook | | +| **events** | **Array<String>** | | | +| **type** | **String** | Type of webhook (marketing or transac) | | +| **created_at** | **String** | Creation UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) | | +| **modified_at** | **String** | Last modification UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ) | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetWebhook.new( + url: http://requestb.in/173lyyx1, + id: 654, + description: Webhook triggered on campaign openings, + events: null, + type: marketing, + created_at: 2016-12-01T12:50:00Z, + modified_at: 2017-05-12T13:15:00Z +) +``` diff --git a/docs/GetWebhooks.md b/docs/GetWebhooks.md index 3175828..6e9ecdf 100644 --- a/docs/GetWebhooks.md +++ b/docs/GetWebhooks.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::GetWebhooks ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**webhooks** | **Array<Object>** | | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **webhooks** | [**Array<GetWebhook>**](GetWebhook.md) | | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::GetWebhooks.new( + webhooks: null +) +``` diff --git a/docs/ListsApi.md b/docs/ListsApi.md index 6d3c6fd..138aa02 100644 --- a/docs/ListsApi.md +++ b/docs/ListsApi.md @@ -2,63 +2,80 @@ All URIs are relative to *https://api.sendinblue.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_contact_to_list**](ListsApi.md#add_contact_to_list) | **POST** /contacts/lists/{listId}/contacts/add | Add existing contacts to a list -[**create_list**](ListsApi.md#create_list) | **POST** /contacts/lists | Create a list -[**delete_list**](ListsApi.md#delete_list) | **DELETE** /contacts/lists/{listId} | Delete a list -[**get_contacts_from_list**](ListsApi.md#get_contacts_from_list) | **GET** /contacts/lists/{listId}/contacts | Get contacts in a list -[**get_folder_lists**](ListsApi.md#get_folder_lists) | **GET** /contacts/folders/{folderId}/lists | Get lists in a folder -[**get_list**](ListsApi.md#get_list) | **GET** /contacts/lists/{listId} | Get a list's details -[**get_lists**](ListsApi.md#get_lists) | **GET** /contacts/lists | Get all the lists -[**remove_contact_from_list**](ListsApi.md#remove_contact_from_list) | **POST** /contacts/lists/{listId}/contacts/remove | Delete a contact from a list -[**update_list**](ListsApi.md#update_list) | **PUT** /contacts/lists/{listId} | Update a list - - -# **add_contact_to_list** -> PostContactInfo add_contact_to_list(list_id, contact_emails) +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**add_contact_to_list**](ListsApi.md#add_contact_to_list) | **POST** /contacts/lists/{listId}/contacts/add | Add existing contacts to a list | +| [**create_list**](ListsApi.md#create_list) | **POST** /contacts/lists | Create a list | +| [**delete_list**](ListsApi.md#delete_list) | **DELETE** /contacts/lists/{listId} | Delete a list | +| [**get_contacts_from_list**](ListsApi.md#get_contacts_from_list) | **GET** /contacts/lists/{listId}/contacts | Get contacts in a list | +| [**get_folder_lists**](ListsApi.md#get_folder_lists) | **GET** /contacts/folders/{folderId}/lists | Get lists in a folder | +| [**get_list**](ListsApi.md#get_list) | **GET** /contacts/lists/{listId} | Get a list's details | +| [**get_lists**](ListsApi.md#get_lists) | **GET** /contacts/lists | Get all the lists | +| [**remove_contact_from_list**](ListsApi.md#remove_contact_from_list) | **POST** /contacts/lists/{listId}/contacts/remove | Delete a contact from a list | +| [**update_list**](ListsApi.md#update_list) | **PUT** /contacts/lists/{listId} | Update a list | + + +## add_contact_to_list + +> add_contact_to_list(list_id, contact_emails) Add existing contacts to a list -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ListsApi.new - list_id = 789 # Integer | Id of the list - contact_emails = SibApiV3Sdk::AddContactToList.new # AddContactToList | Emails addresses OR IDs of the contacts - begin - #Add existing contacts to a list + # Add existing contacts to a list result = api_instance.add_contact_to_list(list_id, contact_emails) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ListsApi->add_contact_to_list: #{e}" + puts "Error when calling ListsApi->add_contact_to_list: #{e}" +end +``` + +#### Using the add_contact_to_list_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> add_contact_to_list_with_http_info(list_id, contact_emails) + +```ruby +begin + # Add existing contacts to a list + data, status_code, headers = api_instance.add_contact_to_list_with_http_info(list_id, contact_emails) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ListsApi->add_contact_to_list_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **Integer**| Id of the list | - **contact_emails** | [**AddContactToList**](AddContactToList.md)| Emails addresses OR IDs of the contacts | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **list_id** | **Integer** | Id of the list | | +| **contact_emails** | [**AddContactToList**](AddContactToList.md) | Emails addresses OR IDs of the contacts | | ### Return type @@ -70,52 +87,69 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## create_list -# **create_list** -> CreateModel create_list(create_list) +> create_list(create_list) Create a list -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ListsApi.new - -create_list = SibApiV3Sdk::CreateList.new # CreateList | Values to create a list - +create_list = SibApiV3Sdk::CreateList.new({name: 'Magento Customer - ES', folder_id: 2}) # CreateList | Values to create a list begin - #Create a list + # Create a list result = api_instance.create_list(create_list) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ListsApi->create_list: #{e}" + puts "Error when calling ListsApi->create_list: #{e}" +end +``` + +#### Using the create_list_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_list_with_http_info(create_list) + +```ruby +begin + # Create a list + data, status_code, headers = api_instance.create_list_with_http_info(create_list) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ListsApi->create_list_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **create_list** | [**CreateList**](CreateList.md)| Values to create a list | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **create_list** | [**CreateList**](CreateList.md) | Values to create a list | | ### Return type @@ -127,51 +161,68 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## delete_list -# **delete_list** > delete_list(list_id) Delete a list -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ListsApi.new - list_id = 789 # Integer | Id of the list - begin - #Delete a list + # Delete a list api_instance.delete_list(list_id) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ListsApi->delete_list: #{e}" + puts "Error when calling ListsApi->delete_list: #{e}" +end +``` + +#### Using the delete_list_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_list_with_http_info(list_id) + +```ruby +begin + # Delete a list + data, status_code, headers = api_instance.delete_list_with_http_info(list_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ListsApi->delete_list_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **Integer**| Id of the list | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **list_id** | **Integer** | Id of the list | | ### Return type @@ -183,62 +234,79 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_contacts_from_list -# **get_contacts_from_list** -> GetContacts get_contacts_from_list(list_id, opts) +> get_contacts_from_list(list_id, opts) Get contacts in a list -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ListsApi.new - list_id = 789 # Integer | Id of the list - -opts = { +opts = { modified_since: 'modified_since_example', # String | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. - limit: 50, # Integer | Number of documents per page - offset: 0, # Integer | Index of the first document of the page - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + limit: 789, # Integer | Number of documents per page + offset: 789, # Integer | Index of the first document of the page + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Get contacts in a list + # Get contacts in a list result = api_instance.get_contacts_from_list(list_id, opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ListsApi->get_contacts_from_list: #{e}" + puts "Error when calling ListsApi->get_contacts_from_list: #{e}" +end +``` + +#### Using the get_contacts_from_list_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_contacts_from_list_with_http_info(list_id, opts) + +```ruby +begin + # Get contacts in a list + data, status_code, headers = api_instance.get_contacts_from_list_with_http_info(list_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ListsApi->get_contacts_from_list_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **Integer**| Id of the list | - **modified_since** | **String**| Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional] - **limit** | **Integer**| Number of documents per page | [optional] [default to 50] - **offset** | **Integer**| Index of the first document of the page | [optional] [default to 0] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **list_id** | **Integer** | Id of the list | | +| **modified_since** | **String** | Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional] | +| **limit** | **Integer** | Number of documents per page | [optional][default to 50] | +| **offset** | **Integer** | Index of the first document of the page | [optional][default to 0] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -250,60 +318,77 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_folder_lists -# **get_folder_lists** -> GetFolderLists get_folder_lists(folder_id, opts) +> get_folder_lists(folder_id, opts) Get lists in a folder -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ListsApi.new - folder_id = 789 # Integer | Id of the folder - -opts = { - limit: 10, # Integer | Number of documents per page - offset: 0, # Integer | Index of the first document of the page - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed +opts = { + limit: 789, # Integer | Number of documents per page + offset: 789, # Integer | Index of the first document of the page + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Get lists in a folder + # Get lists in a folder result = api_instance.get_folder_lists(folder_id, opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ListsApi->get_folder_lists: #{e}" + puts "Error when calling ListsApi->get_folder_lists: #{e}" +end +``` + +#### Using the get_folder_lists_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_folder_lists_with_http_info(folder_id, opts) + +```ruby +begin + # Get lists in a folder + data, status_code, headers = api_instance.get_folder_lists_with_http_info(folder_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ListsApi->get_folder_lists_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **folder_id** | **Integer**| Id of the folder | - **limit** | **Integer**| Number of documents per page | [optional] [default to 10] - **offset** | **Integer**| Index of the first document of the page | [optional] [default to 0] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **folder_id** | **Integer** | Id of the folder | | +| **limit** | **Integer** | Number of documents per page | [optional][default to 10] | +| **offset** | **Integer** | Index of the first document of the page | [optional][default to 0] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -315,52 +400,69 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_list -# **get_list** -> GetExtendedList get_list(list_id) +> get_list(list_id) Get a list's details -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ListsApi.new - list_id = 789 # Integer | Id of the list - begin - #Get a list's details + # Get a list's details result = api_instance.get_list(list_id) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ListsApi->get_list: #{e}" + puts "Error when calling ListsApi->get_list: #{e}" +end +``` + +#### Using the get_list_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_list_with_http_info(list_id) + +```ruby +begin + # Get a list's details + data, status_code, headers = api_instance.get_list_with_http_info(list_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ListsApi->get_list_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **Integer**| Id of the list | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **list_id** | **Integer** | Id of the list | | ### Return type @@ -372,57 +474,75 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_lists -# **get_lists** -> GetLists get_lists(opts) +> get_lists(opts) Get all the lists -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ListsApi.new - -opts = { - limit: 10, # Integer | Number of documents per page - offset: 0, # Integer | Index of the first document of the page - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed +opts = { + limit: 789, # Integer | Number of documents per page + offset: 789, # Integer | Index of the first document of the page + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Get all the lists + # Get all the lists result = api_instance.get_lists(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ListsApi->get_lists: #{e}" + puts "Error when calling ListsApi->get_lists: #{e}" +end +``` + +#### Using the get_lists_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_lists_with_http_info(opts) + +```ruby +begin + # Get all the lists + data, status_code, headers = api_instance.get_lists_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ListsApi->get_lists_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **limit** | **Integer**| Number of documents per page | [optional] [default to 10] - **offset** | **Integer**| Index of the first document of the page | [optional] [default to 0] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **limit** | **Integer** | Number of documents per page | [optional][default to 10] | +| **offset** | **Integer** | Index of the first document of the page | [optional][default to 0] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -434,55 +554,71 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## remove_contact_from_list -# **remove_contact_from_list** -> PostContactInfo remove_contact_from_list(list_id, contact_emails) +> remove_contact_from_list(list_id, contact_emails) Delete a contact from a list -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ListsApi.new - list_id = 789 # Integer | Id of the list - contact_emails = SibApiV3Sdk::RemoveContactFromList.new # RemoveContactFromList | Emails addresses OR IDs of the contacts - begin - #Delete a contact from a list + # Delete a contact from a list result = api_instance.remove_contact_from_list(list_id, contact_emails) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ListsApi->remove_contact_from_list: #{e}" + puts "Error when calling ListsApi->remove_contact_from_list: #{e}" +end +``` + +#### Using the remove_contact_from_list_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> remove_contact_from_list_with_http_info(list_id, contact_emails) + +```ruby +begin + # Delete a contact from a list + data, status_code, headers = api_instance.remove_contact_from_list_with_http_info(list_id, contact_emails) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ListsApi->remove_contact_from_list_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **Integer**| Id of the list | - **contact_emails** | [**RemoveContactFromList**](RemoveContactFromList.md)| Emails addresses OR IDs of the contacts | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **list_id** | **Integer** | Id of the list | | +| **contact_emails** | [**RemoveContactFromList**](RemoveContactFromList.md) | Emails addresses OR IDs of the contacts | | ### Return type @@ -494,54 +630,70 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## update_list -# **update_list** > update_list(list_id, update_list) Update a list -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ListsApi.new - list_id = 789 # Integer | Id of the list - update_list = SibApiV3Sdk::UpdateList.new # UpdateList | Values to update a list - begin - #Update a list + # Update a list api_instance.update_list(list_id, update_list) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ListsApi->update_list: #{e}" + puts "Error when calling ListsApi->update_list: #{e}" +end +``` + +#### Using the update_list_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_list_with_http_info(list_id, update_list) + +```ruby +begin + # Update a list + data, status_code, headers = api_instance.update_list_with_http_info(list_id, update_list) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ListsApi->update_list_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **list_id** | **Integer**| Id of the list | - **update_list** | [**UpdateList**](UpdateList.md)| Values to update a list | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **list_id** | **Integer** | Id of the list | | +| **update_list** | [**UpdateList**](UpdateList.md) | Values to update a list | | ### Return type @@ -553,8 +705,6 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - - +- **Content-Type**: application/json +- **Accept**: application/json diff --git a/docs/ManageIp.md b/docs/ManageIp.md index 7d69750..c9a1a94 100644 --- a/docs/ManageIp.md +++ b/docs/ManageIp.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::ManageIp ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ip** | **String** | Dedicated ID | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **ip** | **String** | Dedicated ID | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::ManageIp.new( + ip: 123.65.8.22 +) +``` diff --git a/docs/PostContactInfo.md b/docs/PostContactInfo.md index dd2958e..21ac222 100644 --- a/docs/PostContactInfo.md +++ b/docs/PostContactInfo.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::PostContactInfo ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**contacts** | [**PostContactInfoContacts**](PostContactInfoContacts.md) | | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **contacts** | [**PostContactInfoContacts**](PostContactInfoContacts.md) | | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::PostContactInfo.new( + contacts: null +) +``` diff --git a/docs/PostContactInfoContacts.md b/docs/PostContactInfoContacts.md index 467bbec..c795b0e 100644 --- a/docs/PostContactInfoContacts.md +++ b/docs/PostContactInfoContacts.md @@ -1,11 +1,24 @@ # SibApiV3Sdk::PostContactInfoContacts ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**success** | **Array<String>** | | [optional] -**failure** | **Array<String>** | | [optional] -**total** | **Integer** | Displays the count of total number of contacts removed from list when user opts for \"all\" option. | [optional] -**process_id** | **Integer** | Id of the process created to remove contacts from list when user opts for \"all\" option. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **success** | **Array<String>** | | [optional] | +| **failure** | **Array<String>** | | [optional] | +| **total** | **Integer** | Displays the count of total number of contacts removed from list when user opts for \"all\" option. | [optional] | +| **process_id** | **Integer** | Id of the process created to remove contacts from list when user opts for \"all\" option. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::PostContactInfoContacts.new( + success: null, + failure: null, + total: 27, + process_id: 78 +) +``` diff --git a/docs/PostSendFailed.md b/docs/PostSendFailed.md index 2518419..8e40dde 100644 --- a/docs/PostSendFailed.md +++ b/docs/PostSendFailed.md @@ -1,12 +1,26 @@ # SibApiV3Sdk::PostSendFailed ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Integer** | Response code | -**message** | **String** | Response message | -**unexisting_emails** | **Array<String>** | | [optional] -**without_list_emails** | **Array<String>** | | [optional] -**black_listed_emails** | **Array<String>** | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **code** | **Integer** | Response code | | +| **message** | **String** | Response message | | +| **unexisting_emails** | **Array<String>** | | [optional] | +| **without_list_emails** | **Array<String>** | | [optional] | +| **black_listed_emails** | **Array<String>** | | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::PostSendFailed.new( + code: null, + message: The email could not be sent to all recipients, + unexisting_emails: null, + without_list_emails: null, + black_listed_emails: null +) +``` diff --git a/docs/PostSendSmsTestFailed.md b/docs/PostSendSmsTestFailed.md index eb0011b..58f03f9 100644 --- a/docs/PostSendSmsTestFailed.md +++ b/docs/PostSendSmsTestFailed.md @@ -1,11 +1,24 @@ # SibApiV3Sdk::PostSendSmsTestFailed ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Integer** | Response code | -**message** | **String** | Response message | -**unexisting_sms** | **Array<String>** | | [optional] -**without_list_sms** | **Array<String>** | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **code** | **Integer** | Response code | | +| **message** | **String** | Response message | | +| **unexisting_sms** | **Array<String>** | | [optional] | +| **without_list_sms** | **Array<String>** | | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::PostSendSmsTestFailed.new( + code: null, + message: The SMS could not be sent to all recipients, + unexisting_sms: null, + without_list_sms: null +) +``` diff --git a/docs/ProcessApi.md b/docs/ProcessApi.md index 0f92c22..f6aabab 100644 --- a/docs/ProcessApi.md +++ b/docs/ProcessApi.md @@ -2,53 +2,71 @@ All URIs are relative to *https://api.sendinblue.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_process**](ProcessApi.md#get_process) | **GET** /processes/{processId} | Return the informations for a process -[**get_processes**](ProcessApi.md#get_processes) | **GET** /processes | Return all the processes for your account +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**get_process**](ProcessApi.md#get_process) | **GET** /processes/{processId} | Return the informations for a process | +| [**get_processes**](ProcessApi.md#get_processes) | **GET** /processes | Return all the processes for your account | -# **get_process** -> GetProcess get_process(process_id) +## get_process + +> get_process(process_id) Return the informations for a process -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ProcessApi.new - process_id = 789 # Integer | Id of the process - begin - #Return the informations for a process + # Return the informations for a process result = api_instance.get_process(process_id) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ProcessApi->get_process: #{e}" + puts "Error when calling ProcessApi->get_process: #{e}" +end +``` + +#### Using the get_process_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_process_with_http_info(process_id) + +```ruby +begin + # Return the informations for a process + data, status_code, headers = api_instance.get_process_with_http_info(process_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ProcessApi->get_process_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **process_id** | **Integer**| Id of the process | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **process_id** | **Integer** | Id of the process | | ### Return type @@ -60,57 +78,75 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_processes -# **get_processes** -> GetProcesses get_processes(opts) +> get_processes(opts) Return all the processes for your account -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ProcessApi.new - -opts = { - limit: 10, # Integer | Number limitation for the result returned - offset: 0, # Integer | Beginning point in the list to retrieve from. - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed +opts = { + limit: 789, # Integer | Number limitation for the result returned + offset: 789, # Integer | Beginning point in the list to retrieve from. + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Return all the processes for your account + # Return all the processes for your account result = api_instance.get_processes(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ProcessApi->get_processes: #{e}" + puts "Error when calling ProcessApi->get_processes: #{e}" +end +``` + +#### Using the get_processes_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_processes_with_http_info(opts) + +```ruby +begin + # Return all the processes for your account + data, status_code, headers = api_instance.get_processes_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ProcessApi->get_processes_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **limit** | **Integer**| Number limitation for the result returned | [optional] [default to 10] - **offset** | **Integer**| Beginning point in the list to retrieve from. | [optional] [default to 0] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **limit** | **Integer** | Number limitation for the result returned | [optional][default to 10] | +| **offset** | **Integer** | Beginning point in the list to retrieve from. | [optional][default to 0] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -122,8 +158,6 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - - +- **Content-Type**: Not defined +- **Accept**: application/json diff --git a/docs/RemainingCreditModel.md b/docs/RemainingCreditModel.md index 1cf298b..7eb3886 100644 --- a/docs/RemainingCreditModel.md +++ b/docs/RemainingCreditModel.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::RemainingCreditModel ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**child** | [**RemainingCreditModelChild**](RemainingCreditModelChild.md) | | -**reseller** | [**RemainingCreditModelReseller**](RemainingCreditModelReseller.md) | | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **child** | [**RemainingCreditModelChild**](RemainingCreditModelChild.md) | | | +| **reseller** | [**RemainingCreditModelReseller**](RemainingCreditModelReseller.md) | | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::RemainingCreditModel.new( + child: null, + reseller: null +) +``` diff --git a/docs/RemainingCreditModelChild.md b/docs/RemainingCreditModelChild.md index 195871a..9d094b4 100644 --- a/docs/RemainingCreditModelChild.md +++ b/docs/RemainingCreditModelChild.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::RemainingCreditModelChild ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sms** | **Float** | SMS Credits remaining for child account | -**email** | **Float** | Email Credits remaining for child account | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **sms** | **Float** | SMS Credits remaining for child account | | +| **email** | **Float** | Email Credits remaining for child account | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::RemainingCreditModelChild.new( + sms: 500.0, + email: 2000.0 +) +``` diff --git a/docs/RemainingCreditModelReseller.md b/docs/RemainingCreditModelReseller.md index 4b2bd36..be3f420 100644 --- a/docs/RemainingCreditModelReseller.md +++ b/docs/RemainingCreditModelReseller.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::RemainingCreditModelReseller ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sms** | **Float** | SMS Credits remaining for reseller account | -**email** | **Float** | Email Credits remaining for reseller account | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **sms** | **Float** | SMS Credits remaining for reseller account | | +| **email** | **Float** | Email Credits remaining for reseller account | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::RemainingCreditModelReseller.new( + sms: 12900.0, + email: 2000000.0 +) +``` diff --git a/docs/RemoveContactFromList.md b/docs/RemoveContactFromList.md index 9e88176..8297dc9 100644 --- a/docs/RemoveContactFromList.md +++ b/docs/RemoveContactFromList.md @@ -1,10 +1,22 @@ # SibApiV3Sdk::RemoveContactFromList ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**emails** | **Array<String>** | Required if 'all' is false. Emails to remove from a list. You can pass a maximum of 150 emails for removal in one request. | [optional] -**ids** | **Array<Integer>** | Mandatory if Emails are not passed, ignored otherwise. 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. | [optional] -**all** | **BOOLEAN** | Required if none of 'emails' or 'ids' are passed. Remove all existing contacts from a list. A process will be created in this scenario. You can fetch the process details to know about the progress | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **emails** | **Array<String>** | Required if 'all' is false. Emails to remove from a list. You can pass a maximum of 150 emails for removal in one request. | [optional] | +| **ids** | **Array<Integer>** | Mandatory if Emails are not passed, ignored otherwise. 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. | [optional] | +| **all** | **Boolean** | Required if none of 'emails' or 'ids' are passed. Remove all existing contacts from a list. A process will be created in this scenario. You can fetch the process details to know about the progress | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::RemoveContactFromList.new( + emails: null, + ids: null, + all: false +) +``` diff --git a/docs/RemoveCredits.md b/docs/RemoveCredits.md index aedc2a2..d23a5e0 100644 --- a/docs/RemoveCredits.md +++ b/docs/RemoveCredits.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::RemoveCredits ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sms** | **Integer** | Required if email credits are empty. SMS credits to be removed from the child account | [optional] -**email** | **Integer** | Required if sms credits are empty. Email credits to be removed from the child account | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **sms** | **Integer** | Required if email credits are empty. SMS credits to be removed from the child account | [optional] | +| **email** | **Integer** | Required if sms credits are empty. Email credits to be removed from the child account | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::RemoveCredits.new( + sms: 300, + email: 500 +) +``` diff --git a/docs/RequestContactExport.md b/docs/RequestContactExport.md index cd4b2f3..0218103 100644 --- a/docs/RequestContactExport.md +++ b/docs/RequestContactExport.md @@ -1,11 +1,24 @@ # SibApiV3Sdk::RequestContactExport ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**export_attributes** | **Array<String>** | List of all the attributes that you want to export. These attributes must be present in your contact database. For example, ['fname', 'lname', 'email']. | [optional] -**contact_filter** | **Object** | This attribute has been deprecated and will be removed by January 1st, 2021. Only one of the two filter options (contactFilter or customContactFilter) can be passed in the request. Set the filter for the contacts to be exported. For example, {\"blacklisted\":true} will export all the blacklisted contacts. | [optional] -**custom_contact_filter** | [**RequestContactExportCustomContactFilter**](RequestContactExportCustomContactFilter.md) | | [optional] -**notify_url** | **String** | Webhook that will be called once the export process is finished. For reference, https://help.sendinblue.com/hc/en-us/articles/360007666479 | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **export_attributes** | **Array<String>** | List of all the attributes that you want to export. These attributes must be present in your contact database. For example, ['fname', 'lname', 'email']. | [optional] | +| **contact_filter** | **Object** | This attribute has been deprecated and will be removed by January 1st, 2021. Only one of the two filter options (contactFilter or customContactFilter) can be passed in the request. Set the filter for the contacts to be exported. For example, {\"blacklisted\":true} will export all the blacklisted contacts. | [optional] | +| **custom_contact_filter** | [**RequestContactExportCustomContactFilter**](RequestContactExportCustomContactFilter.md) | | [optional] | +| **notify_url** | **String** | Webhook that will be called once the export process is finished. For reference, https://help.sendinblue.com/hc/en-us/articles/360007666479 | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::RequestContactExport.new( + export_attributes: null, + contact_filter: {"blacklisted":true,"listid.id":32}, + custom_contact_filter: null, + notify_url: http://requestb.in/173lyyx1 +) +``` diff --git a/docs/RequestContactExportCustomContactFilter.md b/docs/RequestContactExportCustomContactFilter.md index 2bdc238..6c35c6d 100644 --- a/docs/RequestContactExportCustomContactFilter.md +++ b/docs/RequestContactExportCustomContactFilter.md @@ -1,13 +1,28 @@ # SibApiV3Sdk::RequestContactExportCustomContactFilter ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**action_for_contacts** | **String** | Mandatory if neither actionForEmailCampaigns nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on contacts as per the list id. * allContacts - Fetch the list of all contacts for a particular list. * subscribed & unsubscribed - Fetch the list of subscribed / unsubscribed (blacklisted via any means) contacts for a particular list. * unsubscribedPerList - Fetch the list of contacts that are unsubscribed from a particular list only. | [optional] -**action_for_email_campaigns** | **String** | Mandatory if neither actionForContacts nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on email campaigns. * openers & nonOpeners - emailCampaignId is mandatory. Fetch the list of readers / non-readers for a particular email campaign. * clickers & nonClickers - emailCampaignId is mandatory. Fetch the list of clickers / non-clickers for a particular email campaign. * unsubscribed - emailCampaignId is mandatory. Fetch the list of all unsubscribed (blacklisted via any means) contacts for a particular email campaign. * hardBounces & softBounces - emailCampaignId is optional. Fetch the list of hard bounces / soft bounces for a particular / all email campaign(s). | [optional] -**action_for_sms_campaigns** | **String** | Mandatory if neither actionForContacts nor actionForEmailCampaigns is passed. This will export the contacts on the basis of provided action applied on sms campaigns. * unsubscribed - Fetch the list of all unsubscribed (blacklisted via any means) contacts for all / particular sms campaigns. * hardBounces & softBounces - Fetch the list of hard bounces / soft bounces for all / particular sms campaigns. | [optional] -**list_id** | **Integer** | Mandatory if actionForContacts is passed, ignored otherwise. Id of the list for which the corresponding action shall be applied in the filter. | [optional] -**email_campaign_id** | **Integer** | Considered only if actionForEmailCampaigns is passed, ignored otherwise. Mandatory if action is one of the following - openers, nonOpeners, clickers, nonClickers, unsubscribed. The id of the email campaign for which the corresponding action shall be applied in the filter. | [optional] -**sms_campaign_id** | **Integer** | Considered only if actionForSmsCampaigns is passed, ignored otherwise. The id of sms campaign for which the corresponding action shall be applied in the filter. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **action_for_contacts** | **String** | Mandatory if neither actionForEmailCampaigns nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on contacts as per the list id. * allContacts - Fetch the list of all contacts for a particular list. * subscribed & unsubscribed - Fetch the list of subscribed / unsubscribed (blacklisted via any means) contacts for a particular list. * unsubscribedPerList - Fetch the list of contacts that are unsubscribed from a particular list only. | [optional] | +| **action_for_email_campaigns** | **String** | Mandatory if neither actionForContacts nor actionForSmsCampaigns is passed. This will export the contacts on the basis of provided action applied on email campaigns. * openers & nonOpeners - emailCampaignId is mandatory. Fetch the list of readers / non-readers for a particular email campaign. * clickers & nonClickers - emailCampaignId is mandatory. Fetch the list of clickers / non-clickers for a particular email campaign. * unsubscribed - emailCampaignId is mandatory. Fetch the list of all unsubscribed (blacklisted via any means) contacts for a particular email campaign. * hardBounces & softBounces - emailCampaignId is optional. Fetch the list of hard bounces / soft bounces for a particular / all email campaign(s). | [optional] | +| **action_for_sms_campaigns** | **String** | Mandatory if neither actionForContacts nor actionForEmailCampaigns is passed. This will export the contacts on the basis of provided action applied on sms campaigns. * unsubscribed - Fetch the list of all unsubscribed (blacklisted via any means) contacts for all / particular sms campaigns. * hardBounces & softBounces - Fetch the list of hard bounces / soft bounces for all / particular sms campaigns. | [optional] | +| **list_id** | **Integer** | Mandatory if actionForContacts is passed, ignored otherwise. Id of the list for which the corresponding action shall be applied in the filter. | [optional] | +| **email_campaign_id** | **Integer** | Considered only if actionForEmailCampaigns is passed, ignored otherwise. Mandatory if action is one of the following - openers, nonOpeners, clickers, nonClickers, unsubscribed. The id of the email campaign for which the corresponding action shall be applied in the filter. | [optional] | +| **sms_campaign_id** | **Integer** | Considered only if actionForSmsCampaigns is passed, ignored otherwise. The id of sms campaign for which the corresponding action shall be applied in the filter. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::RequestContactExportCustomContactFilter.new( + action_for_contacts: null, + action_for_email_campaigns: null, + action_for_sms_campaigns: null, + list_id: 2, + email_campaign_id: 12, + sms_campaign_id: 12 +) +``` diff --git a/docs/RequestContactImport.md b/docs/RequestContactImport.md index a3ea879..c4e3a83 100644 --- a/docs/RequestContactImport.md +++ b/docs/RequestContactImport.md @@ -1,16 +1,34 @@ # SibApiV3Sdk::RequestContactImport ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file_url** | **String** | Mandatory if fileBody is not defined. URL of the file to be imported (no local file). Possible file formats: .txt, .csv | [optional] -**file_body** | **String** | Mandatory if fileUrl is not defined. CSV content to be imported. Use semicolon to separate multiple attributes. Maximum allowed file body size is 10MB . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of file body size while parsing. Please use fileUrl instead to import bigger files. | [optional] -**list_ids** | **Array<Integer>** | Mandatory if newList is not defined. Ids of the lists in which the contacts shall be imported. For example, [2, 4, 7]. | [optional] -**notify_url** | **String** | URL that will be called once the import process is finished. For reference, https://help.sendinblue.com/hc/en-us/articles/360007666479 | [optional] -**new_list** | [**RequestContactImportNewList**](RequestContactImportNewList.md) | | [optional] -**email_blacklist** | **BOOLEAN** | To blacklist all the contacts for email | [optional] [default to false] -**sms_blacklist** | **BOOLEAN** | To blacklist all the contacts for sms | [optional] [default to false] -**update_existing_contacts** | **BOOLEAN** | To facilitate the choice to update the existing contacts | [optional] [default to true] -**empty_contacts_attributes** | **BOOLEAN** | To facilitate the choice to erase any attribute of the existing contacts with empty value. emptyContactsAttributes = true means the empty fields in your import will erase any attribute that currently contain data in SendinBlue, & emptyContactsAttributes = false means the empty fields will not affect your existing data ( only available if `updateExistingContacts` set to true ) | [optional] [default to false] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **file_url** | **String** | Mandatory if fileBody is not defined. URL of the file to be imported (no local file). Possible file formats: .txt, .csv | [optional] | +| **file_body** | **String** | Mandatory if fileUrl is not defined. CSV content to be imported. Use semicolon to separate multiple attributes. Maximum allowed file body size is 10MB . However we recommend a safe limit of around 8 MB to avoid the issues caused due to increase of file body size while parsing. Please use fileUrl instead to import bigger files. | [optional] | +| **list_ids** | **Array<Integer>** | Mandatory if newList is not defined. Ids of the lists in which the contacts shall be imported. For example, [2, 4, 7]. | [optional] | +| **notify_url** | **String** | URL that will be called once the import process is finished. For reference, https://help.sendinblue.com/hc/en-us/articles/360007666479 | [optional] | +| **new_list** | [**RequestContactImportNewList**](RequestContactImportNewList.md) | | [optional] | +| **email_blacklist** | **Boolean** | To blacklist all the contacts for email | [optional][default to false] | +| **sms_blacklist** | **Boolean** | To blacklist all the contacts for sms | [optional][default to false] | +| **update_existing_contacts** | **Boolean** | To facilitate the choice to update the existing contacts | [optional][default to true] | +| **empty_contacts_attributes** | **Boolean** | To facilitate the choice to erase any attribute of the existing contacts with empty value. emptyContactsAttributes = true means the empty fields in your import will erase any attribute that currently contain data in SendinBlue, & emptyContactsAttributes = false means the empty fields will not affect your existing data ( only available if `updateExistingContacts` set to true ) | [optional][default to false] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::RequestContactImport.new( + file_url: https://importfile.domain.com, + file_body: NAME;SURNAME;EMAIL\n"Smith";"John";"john.smith@example.com"\n"Roger";"Ellie";"ellie36@example.com, + list_ids: null, + notify_url: http://requestb.in/173lyyx1, + new_list: null, + email_blacklist: false, + sms_blacklist: false, + update_existing_contacts: true, + empty_contacts_attributes: true +) +``` diff --git a/docs/RequestContactImportNewList.md b/docs/RequestContactImportNewList.md index f29f2dd..0d67645 100644 --- a/docs/RequestContactImportNewList.md +++ b/docs/RequestContactImportNewList.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::RequestContactImportNewList ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**list_name** | **String** | List with listName will be created first and users will be imported in it (Mandatory if listIds is empty). | [optional] -**folder_id** | **Integer** | Id of the folder where this new list shall be created (Mandatory if listName is not empty). | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **list_name** | **String** | List with listName will be created first and users will be imported in it (Mandatory if listIds is empty). | [optional] | +| **folder_id** | **Integer** | Id of the folder where this new list shall be created (Mandatory if listName is not empty). | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::RequestContactImportNewList.new( + list_name: ContactImport - 2017-05, + folder_id: 2 +) +``` diff --git a/docs/RequestSMSRecipientExport.md b/docs/RequestSMSRecipientExport.md index 2054583..72a66a2 100644 --- a/docs/RequestSMSRecipientExport.md +++ b/docs/RequestSMSRecipientExport.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::RequestSmsRecipientExport ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**notify_url** | **String** | URL that will be called once the export process is finished. For reference, https://help.sendinblue.com/hc/en-us/articles/360007666479 | [optional] -**recipients_type** | **String** | Filter the recipients based on how they interacted with the campaign | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **notify_url** | **String** | URL that will be called once the export process is finished. For reference, https://help.sendinblue.com/hc/en-us/articles/360007666479 | [optional] | +| **recipients_type** | **String** | Filter the recipients based on how they interacted with the campaign | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::RequestSmsRecipientExport.new( + notify_url: http://requestb.in/173lyyx1, + recipients_type: answered +) +``` diff --git a/docs/ResellerApi.md b/docs/ResellerApi.md index 31d1566..8d0553f 100644 --- a/docs/ResellerApi.md +++ b/docs/ResellerApi.md @@ -2,70 +2,87 @@ All URIs are relative to *https://api.sendinblue.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_credits**](ResellerApi.md#add_credits) | **POST** /reseller/children/{childIdentifier}/credits/add | Add Email and/or SMS credits to a specific child account -[**associate_ip_to_child**](ResellerApi.md#associate_ip_to_child) | **POST** /reseller/children/{childIdentifier}/ips/associate | Associate a dedicated IP to the child -[**create_child_domain**](ResellerApi.md#create_child_domain) | **POST** /reseller/children/{childIdentifier}/domains | Create a domain for a child account -[**create_reseller_child**](ResellerApi.md#create_reseller_child) | **POST** /reseller/children | Creates a reseller child -[**delete_child_domain**](ResellerApi.md#delete_child_domain) | **DELETE** /reseller/children/{childIdentifier}/domains/{domainName} | Delete the sender domain of the reseller child based on the childIdentifier and domainName passed -[**delete_reseller_child**](ResellerApi.md#delete_reseller_child) | **DELETE** /reseller/children/{childIdentifier} | Delete a single reseller child based on the child identifier supplied -[**dissociate_ip_from_child**](ResellerApi.md#dissociate_ip_from_child) | **POST** /reseller/children/{childIdentifier}/ips/dissociate | Dissociate a dedicated IP to the child -[**get_child_account_creation_status**](ResellerApi.md#get_child_account_creation_status) | **GET** /reseller/children/{childIdentifier}/accountCreationStatus | Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied -[**get_child_domains**](ResellerApi.md#get_child_domains) | **GET** /reseller/children/{childIdentifier}/domains | Get all sender domains for a specific child account -[**get_child_info**](ResellerApi.md#get_child_info) | **GET** /reseller/children/{childIdentifier} | Get a child account's details -[**get_reseller_childs**](ResellerApi.md#get_reseller_childs) | **GET** /reseller/children | Get the list of all children accounts -[**get_sso_token**](ResellerApi.md#get_sso_token) | **GET** /reseller/children/{childIdentifier}/auth | Get session token to access Sendinblue (SSO) -[**remove_credits**](ResellerApi.md#remove_credits) | **POST** /reseller/children/{childIdentifier}/credits/remove | Remove Email and/or SMS credits from a specific child account -[**update_child_account_status**](ResellerApi.md#update_child_account_status) | **PUT** /reseller/children/{childIdentifier}/accountStatus | Update info of reseller's child account status based on the childIdentifier supplied -[**update_child_domain**](ResellerApi.md#update_child_domain) | **PUT** /reseller/children/{childIdentifier}/domains/{domainName} | Update the sender domain of reseller's child based on the childIdentifier and domainName passed -[**update_reseller_child**](ResellerApi.md#update_reseller_child) | **PUT** /reseller/children/{childIdentifier} | Update info of reseller's child based on the child identifier supplied - - -# **add_credits** -> RemainingCreditModel add_credits(child_identifier, add_credits) +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**add_credits**](ResellerApi.md#add_credits) | **POST** /reseller/children/{childIdentifier}/credits/add | Add Email and/or SMS credits to a specific child account | +| [**associate_ip_to_child**](ResellerApi.md#associate_ip_to_child) | **POST** /reseller/children/{childIdentifier}/ips/associate | Associate a dedicated IP to the child | +| [**create_child_domain**](ResellerApi.md#create_child_domain) | **POST** /reseller/children/{childIdentifier}/domains | Create a domain for a child account | +| [**create_reseller_child**](ResellerApi.md#create_reseller_child) | **POST** /reseller/children | Creates a reseller child | +| [**delete_child_domain**](ResellerApi.md#delete_child_domain) | **DELETE** /reseller/children/{childIdentifier}/domains/{domainName} | Delete the sender domain of the reseller child based on the childIdentifier and domainName passed | +| [**delete_reseller_child**](ResellerApi.md#delete_reseller_child) | **DELETE** /reseller/children/{childIdentifier} | Delete a single reseller child based on the child identifier supplied | +| [**dissociate_ip_from_child**](ResellerApi.md#dissociate_ip_from_child) | **POST** /reseller/children/{childIdentifier}/ips/dissociate | Dissociate a dedicated IP to the child | +| [**get_child_account_creation_status**](ResellerApi.md#get_child_account_creation_status) | **GET** /reseller/children/{childIdentifier}/accountCreationStatus | Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied | +| [**get_child_domains**](ResellerApi.md#get_child_domains) | **GET** /reseller/children/{childIdentifier}/domains | Get all sender domains for a specific child account | +| [**get_child_info**](ResellerApi.md#get_child_info) | **GET** /reseller/children/{childIdentifier} | Get a child account's details | +| [**get_reseller_childs**](ResellerApi.md#get_reseller_childs) | **GET** /reseller/children | Get the list of all children accounts | +| [**get_sso_token**](ResellerApi.md#get_sso_token) | **GET** /reseller/children/{childIdentifier}/auth | Get session token to access Sendinblue (SSO) | +| [**remove_credits**](ResellerApi.md#remove_credits) | **POST** /reseller/children/{childIdentifier}/credits/remove | Remove Email and/or SMS credits from a specific child account | +| [**update_child_account_status**](ResellerApi.md#update_child_account_status) | **PUT** /reseller/children/{childIdentifier}/accountStatus | Update info of reseller's child account status based on the childIdentifier supplied | +| [**update_child_domain**](ResellerApi.md#update_child_domain) | **PUT** /reseller/children/{childIdentifier}/domains/{domainName} | Update the sender domain of reseller's child based on the childIdentifier and domainName passed | +| [**update_reseller_child**](ResellerApi.md#update_reseller_child) | **PUT** /reseller/children/{childIdentifier} | Update info of reseller's child based on the child identifier supplied | + + +## add_credits + +> add_credits(child_identifier, add_credits) Add Email and/or SMS credits to a specific child account -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ResellerApi.new - child_identifier = 'child_identifier_example' # String | Either auth key or id of reseller's child - add_credits = SibApiV3Sdk::AddCredits.new # AddCredits | Values to post to add credit to a specific child account - begin - #Add Email and/or SMS credits to a specific child account + # Add Email and/or SMS credits to a specific child account result = api_instance.add_credits(child_identifier, add_credits) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ResellerApi->add_credits: #{e}" + puts "Error when calling ResellerApi->add_credits: #{e}" +end +``` + +#### Using the add_credits_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> add_credits_with_http_info(child_identifier, add_credits) + +```ruby +begin + # Add Email and/or SMS credits to a specific child account + data, status_code, headers = api_instance.add_credits_with_http_info(child_identifier, add_credits) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ResellerApi->add_credits_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **child_identifier** | **String**| Either auth key or id of reseller's child | - **add_credits** | [**AddCredits**](AddCredits.md)| Values to post to add credit to a specific child account | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **child_identifier** | **String** | Either auth key or id of reseller's child | | +| **add_credits** | [**AddCredits**](AddCredits.md) | Values to post to add credit to a specific child account | | ### Return type @@ -77,54 +94,70 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## associate_ip_to_child -# **associate_ip_to_child** > associate_ip_to_child(child_identifier, ip) Associate a dedicated IP to the child -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ResellerApi.new - child_identifier = 'child_identifier_example' # String | Either auth key or id of reseller's child - ip = SibApiV3Sdk::ManageIp.new # ManageIp | IP to associate - begin - #Associate a dedicated IP to the child + # Associate a dedicated IP to the child api_instance.associate_ip_to_child(child_identifier, ip) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ResellerApi->associate_ip_to_child: #{e}" + puts "Error when calling ResellerApi->associate_ip_to_child: #{e}" +end +``` + +#### Using the associate_ip_to_child_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> associate_ip_to_child_with_http_info(child_identifier, ip) + +```ruby +begin + # Associate a dedicated IP to the child + data, status_code, headers = api_instance.associate_ip_to_child_with_http_info(child_identifier, ip) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ResellerApi->associate_ip_to_child_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **child_identifier** | **String**| Either auth key or id of reseller's child | - **ip** | [**ManageIp**](ManageIp.md)| IP to associate | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **child_identifier** | **String** | Either auth key or id of reseller's child | | +| **ip** | [**ManageIp**](ManageIp.md) | IP to associate | | ### Return type @@ -136,54 +169,70 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## create_child_domain -# **create_child_domain** > create_child_domain(child_identifier, add_child_domain) Create a domain for a child account -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ResellerApi.new - child_identifier = 'child_identifier_example' # String | Either auth key or id of reseller's child - add_child_domain = SibApiV3Sdk::AddChildDomain.new # AddChildDomain | Sender domain to add for a specific child account. This will not be displayed to the parent account. - begin - #Create a domain for a child account + # Create a domain for a child account api_instance.create_child_domain(child_identifier, add_child_domain) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ResellerApi->create_child_domain: #{e}" + puts "Error when calling ResellerApi->create_child_domain: #{e}" +end +``` + +#### Using the create_child_domain_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> create_child_domain_with_http_info(child_identifier, add_child_domain) + +```ruby +begin + # Create a domain for a child account + data, status_code, headers = api_instance.create_child_domain_with_http_info(child_identifier, add_child_domain) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ResellerApi->create_child_domain_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **child_identifier** | **String**| Either auth key or id of reseller's child | - **add_child_domain** | [**AddChildDomain**](AddChildDomain.md)| Sender domain to add for a specific child account. This will not be displayed to the parent account. | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **child_identifier** | **String** | Either auth key or id of reseller's child | | +| **add_child_domain** | [**AddChildDomain**](AddChildDomain.md) | Sender domain to add for a specific child account. This will not be displayed to the parent account. | | ### Return type @@ -195,53 +244,71 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## create_reseller_child -# **create_reseller_child** -> CreateReseller create_reseller_child(opts) +> create_reseller_child(opts) Creates a reseller child -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ResellerApi.new - -opts = { - reseller_child: SibApiV3Sdk::CreateChild.new # CreateChild | reseller child to add +opts = { + reseller_child: SibApiV3Sdk::CreateChild.new({email: 'josh.cruise@example.com', first_name: 'Josh', last_name: 'Cruise', company_name: 'Your Company', password: 'Pa55w0rd65'}) # CreateChild | reseller child to add } begin - #Creates a reseller child + # Creates a reseller child result = api_instance.create_reseller_child(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ResellerApi->create_reseller_child: #{e}" + puts "Error when calling ResellerApi->create_reseller_child: #{e}" +end +``` + +#### Using the create_reseller_child_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_reseller_child_with_http_info(opts) + +```ruby +begin + # Creates a reseller child + data, status_code, headers = api_instance.create_reseller_child_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ResellerApi->create_reseller_child_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **reseller_child** | [**CreateChild**](CreateChild.md)| reseller child to add | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **reseller_child** | [**CreateChild**](CreateChild.md) | reseller child to add | [optional] | ### Return type @@ -253,54 +320,70 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## delete_child_domain -# **delete_child_domain** > delete_child_domain(child_identifier, domain_name) Delete the sender domain of the reseller child based on the childIdentifier and domainName passed -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ResellerApi.new - child_identifier = 'child_identifier_example' # String | Either auth key or id of reseller's child - domain_name = 'domain_name_example' # String | Pass the existing domain that needs to be deleted - begin - #Delete the sender domain of the reseller child based on the childIdentifier and domainName passed + # Delete the sender domain of the reseller child based on the childIdentifier and domainName passed api_instance.delete_child_domain(child_identifier, domain_name) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ResellerApi->delete_child_domain: #{e}" + puts "Error when calling ResellerApi->delete_child_domain: #{e}" +end +``` + +#### Using the delete_child_domain_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_child_domain_with_http_info(child_identifier, domain_name) + +```ruby +begin + # Delete the sender domain of the reseller child based on the childIdentifier and domainName passed + data, status_code, headers = api_instance.delete_child_domain_with_http_info(child_identifier, domain_name) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ResellerApi->delete_child_domain_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **child_identifier** | **String**| Either auth key or id of reseller's child | - **domain_name** | **String**| Pass the existing domain that needs to be deleted | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **child_identifier** | **String** | Either auth key or id of reseller's child | | +| **domain_name** | **String** | Pass the existing domain that needs to be deleted | | ### Return type @@ -312,51 +395,68 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## delete_reseller_child -# **delete_reseller_child** > delete_reseller_child(child_identifier) Delete a single reseller child based on the child identifier supplied -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ResellerApi.new - child_identifier = 'child_identifier_example' # String | Either auth key or child id of reseller's child - begin - #Delete a single reseller child based on the child identifier supplied + # Delete a single reseller child based on the child identifier supplied api_instance.delete_reseller_child(child_identifier) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ResellerApi->delete_reseller_child: #{e}" + puts "Error when calling ResellerApi->delete_reseller_child: #{e}" +end +``` + +#### Using the delete_reseller_child_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_reseller_child_with_http_info(child_identifier) + +```ruby +begin + # Delete a single reseller child based on the child identifier supplied + data, status_code, headers = api_instance.delete_reseller_child_with_http_info(child_identifier) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ResellerApi->delete_reseller_child_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **child_identifier** | **String**| Either auth key or child id of reseller's child | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **child_identifier** | **String** | Either auth key or child id of reseller's child | | ### Return type @@ -368,54 +468,70 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## dissociate_ip_from_child -# **dissociate_ip_from_child** > dissociate_ip_from_child(child_identifier, ip) Dissociate a dedicated IP to the child -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ResellerApi.new - child_identifier = 'child_identifier_example' # String | Either auth key or id of reseller's child - ip = SibApiV3Sdk::ManageIp.new # ManageIp | IP to dissociate - begin - #Dissociate a dedicated IP to the child + # Dissociate a dedicated IP to the child api_instance.dissociate_ip_from_child(child_identifier, ip) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ResellerApi->dissociate_ip_from_child: #{e}" + puts "Error when calling ResellerApi->dissociate_ip_from_child: #{e}" +end +``` + +#### Using the dissociate_ip_from_child_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> dissociate_ip_from_child_with_http_info(child_identifier, ip) + +```ruby +begin + # Dissociate a dedicated IP to the child + data, status_code, headers = api_instance.dissociate_ip_from_child_with_http_info(child_identifier, ip) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ResellerApi->dissociate_ip_from_child_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **child_identifier** | **String**| Either auth key or id of reseller's child | - **ip** | [**ManageIp**](ManageIp.md)| IP to dissociate | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **child_identifier** | **String** | Either auth key or id of reseller's child | | +| **ip** | [**ManageIp**](ManageIp.md) | IP to dissociate | | ### Return type @@ -427,52 +543,69 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## get_child_account_creation_status -# **get_child_account_creation_status** -> GetChildAccountCreationStatus get_child_account_creation_status(child_identifier) +> get_child_account_creation_status(child_identifier) Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ResellerApi.new - child_identifier = 'child_identifier_example' # String | Either auth key or id of reseller's child - begin - #Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied + # Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied result = api_instance.get_child_account_creation_status(child_identifier) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ResellerApi->get_child_account_creation_status: #{e}" + puts "Error when calling ResellerApi->get_child_account_creation_status: #{e}" +end +``` + +#### Using the get_child_account_creation_status_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_child_account_creation_status_with_http_info(child_identifier) + +```ruby +begin + # Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied + data, status_code, headers = api_instance.get_child_account_creation_status_with_http_info(child_identifier) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ResellerApi->get_child_account_creation_status_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **child_identifier** | **String**| Either auth key or id of reseller's child | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **child_identifier** | **String** | Either auth key or id of reseller's child | | ### Return type @@ -484,56 +617,73 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_child_domains -# **get_child_domains** -> GetChildDomains get_child_domains(child_identifier) +> > get_child_domains(child_identifier) Get all sender domains for a specific child account -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ResellerApi.new - child_identifier = 'child_identifier_example' # String | Either auth key or id of reseller's child - begin - #Get all sender domains for a specific child account + # Get all sender domains for a specific child account result = api_instance.get_child_domains(child_identifier) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ResellerApi->get_child_domains: #{e}" + puts "Error when calling ResellerApi->get_child_domains: #{e}" +end +``` + +#### Using the get_child_domains_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> get_child_domains_with_http_info(child_identifier) + +```ruby +begin + # Get all sender domains for a specific child account + data, status_code, headers = api_instance.get_child_domains_with_http_info(child_identifier) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ResellerApi->get_child_domains_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **child_identifier** | **String**| Either auth key or id of reseller's child | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **child_identifier** | **String** | Either auth key or id of reseller's child | | ### Return type -[**GetChildDomains**](GetChildDomains.md) +[**Array<GetChildDomain>**](GetChildDomain.md) ### Authorization @@ -541,52 +691,69 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_child_info -# **get_child_info** -> GetChildInfo get_child_info(child_identifier) +> get_child_info(child_identifier) Get a child account's details -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ResellerApi.new - child_identifier = 'child_identifier_example' # String | Either auth key or id of reseller's child - begin - #Get a child account's details + # Get a child account's details result = api_instance.get_child_info(child_identifier) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ResellerApi->get_child_info: #{e}" + puts "Error when calling ResellerApi->get_child_info: #{e}" +end +``` + +#### Using the get_child_info_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_child_info_with_http_info(child_identifier) + +```ruby +begin + # Get a child account's details + data, status_code, headers = api_instance.get_child_info_with_http_info(child_identifier) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ResellerApi->get_child_info_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **child_identifier** | **String**| Either auth key or id of reseller's child | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **child_identifier** | **String** | Either auth key or id of reseller's child | | ### Return type @@ -598,55 +765,73 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_reseller_childs -# **get_reseller_childs** -> GetChildrenList get_reseller_childs(opts) +> get_reseller_childs(opts) Get the list of all children accounts -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ResellerApi.new - -opts = { - limit: 10, # Integer | Number of documents for child accounts information per page - offset: 0 # Integer | Index of the first document in the page +opts = { + limit: 789, # Integer | Number of documents for child accounts information per page + offset: 789 # Integer | Index of the first document in the page } begin - #Get the list of all children accounts + # Get the list of all children accounts result = api_instance.get_reseller_childs(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ResellerApi->get_reseller_childs: #{e}" + puts "Error when calling ResellerApi->get_reseller_childs: #{e}" +end +``` + +#### Using the get_reseller_childs_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_reseller_childs_with_http_info(opts) + +```ruby +begin + # Get the list of all children accounts + data, status_code, headers = api_instance.get_reseller_childs_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ResellerApi->get_reseller_childs_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **limit** | **Integer**| Number of documents for child accounts information per page | [optional] [default to 10] - **offset** | **Integer**| Index of the first document in the page | [optional] [default to 0] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **limit** | **Integer** | Number of documents for child accounts information per page | [optional][default to 10] | +| **offset** | **Integer** | Index of the first document in the page | [optional][default to 0] | ### Return type @@ -658,54 +843,71 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_sso_token -# **get_sso_token** -> GetSsoToken get_sso_token(child_identifier) +> get_sso_token(child_identifier) Get session token to access Sendinblue (SSO) It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token] -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ResellerApi.new - child_identifier = 'child_identifier_example' # String | Either auth key or id of reseller's child - begin - #Get session token to access Sendinblue (SSO) + # Get session token to access Sendinblue (SSO) result = api_instance.get_sso_token(child_identifier) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ResellerApi->get_sso_token: #{e}" + puts "Error when calling ResellerApi->get_sso_token: #{e}" +end +``` + +#### Using the get_sso_token_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_sso_token_with_http_info(child_identifier) + +```ruby +begin + # Get session token to access Sendinblue (SSO) + data, status_code, headers = api_instance.get_sso_token_with_http_info(child_identifier) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ResellerApi->get_sso_token_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **child_identifier** | **String**| Either auth key or id of reseller's child | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **child_identifier** | **String** | Either auth key or id of reseller's child | | ### Return type @@ -717,55 +919,71 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## remove_credits -# **remove_credits** -> RemainingCreditModel remove_credits(child_identifier, remove_credits) +> remove_credits(child_identifier, remove_credits) Remove Email and/or SMS credits from a specific child account -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ResellerApi.new - child_identifier = 'child_identifier_example' # String | Either auth key or id of reseller's child - remove_credits = SibApiV3Sdk::RemoveCredits.new # RemoveCredits | Values to post to remove email or SMS credits from a specific child account - begin - #Remove Email and/or SMS credits from a specific child account + # Remove Email and/or SMS credits from a specific child account result = api_instance.remove_credits(child_identifier, remove_credits) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ResellerApi->remove_credits: #{e}" + puts "Error when calling ResellerApi->remove_credits: #{e}" +end +``` + +#### Using the remove_credits_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> remove_credits_with_http_info(child_identifier, remove_credits) + +```ruby +begin + # Remove Email and/or SMS credits from a specific child account + data, status_code, headers = api_instance.remove_credits_with_http_info(child_identifier, remove_credits) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ResellerApi->remove_credits_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **child_identifier** | **String**| Either auth key or id of reseller's child | - **remove_credits** | [**RemoveCredits**](RemoveCredits.md)| Values to post to remove email or SMS credits from a specific child account | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **child_identifier** | **String** | Either auth key or id of reseller's child | | +| **remove_credits** | [**RemoveCredits**](RemoveCredits.md) | Values to post to remove email or SMS credits from a specific child account | | ### Return type @@ -777,54 +995,70 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## update_child_account_status -# **update_child_account_status** > update_child_account_status(child_identifier, update_child_account_status) Update info of reseller's child account status based on the childIdentifier supplied -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ResellerApi.new - child_identifier = 'child_identifier_example' # String | Either auth key or id of reseller's child - update_child_account_status = SibApiV3Sdk::UpdateChildAccountStatus.new # UpdateChildAccountStatus | values to update in child account status - begin - #Update info of reseller's child account status based on the childIdentifier supplied + # Update info of reseller's child account status based on the childIdentifier supplied api_instance.update_child_account_status(child_identifier, update_child_account_status) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ResellerApi->update_child_account_status: #{e}" + puts "Error when calling ResellerApi->update_child_account_status: #{e}" +end +``` + +#### Using the update_child_account_status_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_child_account_status_with_http_info(child_identifier, update_child_account_status) + +```ruby +begin + # Update info of reseller's child account status based on the childIdentifier supplied + data, status_code, headers = api_instance.update_child_account_status_with_http_info(child_identifier, update_child_account_status) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ResellerApi->update_child_account_status_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **child_identifier** | **String**| Either auth key or id of reseller's child | - **update_child_account_status** | [**UpdateChildAccountStatus**](UpdateChildAccountStatus.md)| values to update in child account status | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **child_identifier** | **String** | Either auth key or id of reseller's child | | +| **update_child_account_status** | [**UpdateChildAccountStatus**](UpdateChildAccountStatus.md) | values to update in child account status | | ### Return type @@ -836,57 +1070,72 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## update_child_domain -# **update_child_domain** > update_child_domain(child_identifier, domain_name, update_child_domain) Update the sender domain of reseller's child based on the childIdentifier and domainName passed -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ResellerApi.new - child_identifier = 'child_identifier_example' # String | Either auth key or id of reseller's child - domain_name = 'domain_name_example' # String | Pass the existing domain that needs to be updated - update_child_domain = SibApiV3Sdk::UpdateChildDomain.new # UpdateChildDomain | value to update for sender domain - begin - #Update the sender domain of reseller's child based on the childIdentifier and domainName passed + # Update the sender domain of reseller's child based on the childIdentifier and domainName passed api_instance.update_child_domain(child_identifier, domain_name, update_child_domain) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ResellerApi->update_child_domain: #{e}" + puts "Error when calling ResellerApi->update_child_domain: #{e}" +end +``` + +#### Using the update_child_domain_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_child_domain_with_http_info(child_identifier, domain_name, update_child_domain) + +```ruby +begin + # Update the sender domain of reseller's child based on the childIdentifier and domainName passed + data, status_code, headers = api_instance.update_child_domain_with_http_info(child_identifier, domain_name, update_child_domain) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ResellerApi->update_child_domain_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **child_identifier** | **String**| Either auth key or id of reseller's child | - **domain_name** | **String**| Pass the existing domain that needs to be updated | - **update_child_domain** | [**UpdateChildDomain**](UpdateChildDomain.md)| value to update for sender domain | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **child_identifier** | **String** | Either auth key or id of reseller's child | | +| **domain_name** | **String** | Pass the existing domain that needs to be updated | | +| **update_child_domain** | [**UpdateChildDomain**](UpdateChildDomain.md) | value to update for sender domain | | ### Return type @@ -898,54 +1147,70 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## update_reseller_child -# **update_reseller_child** > update_reseller_child(child_identifier, reseller_child) Update info of reseller's child based on the child identifier supplied -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::ResellerApi.new - child_identifier = 'child_identifier_example' # String | Either auth key or id of reseller's child - reseller_child = SibApiV3Sdk::UpdateChild.new # UpdateChild | values to update in child profile - begin - #Update info of reseller's child based on the child identifier supplied + # Update info of reseller's child based on the child identifier supplied api_instance.update_reseller_child(child_identifier, reseller_child) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling ResellerApi->update_reseller_child: #{e}" + puts "Error when calling ResellerApi->update_reseller_child: #{e}" +end +``` + +#### Using the update_reseller_child_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_reseller_child_with_http_info(child_identifier, reseller_child) + +```ruby +begin + # Update info of reseller's child based on the child identifier supplied + data, status_code, headers = api_instance.update_reseller_child_with_http_info(child_identifier, reseller_child) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling ResellerApi->update_reseller_child_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **child_identifier** | **String**| Either auth key or id of reseller's child | - **reseller_child** | [**UpdateChild**](UpdateChild.md)| values to update in child profile | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **child_identifier** | **String** | Either auth key or id of reseller's child | | +| **reseller_child** | [**UpdateChild**](UpdateChild.md) | values to update in child profile | | ### Return type @@ -957,8 +1222,6 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - - +- **Content-Type**: application/json +- **Accept**: application/json diff --git a/docs/SMSCampaignsApi.md b/docs/SMSCampaignsApi.md index 0b548b4..f6151f5 100644 --- a/docs/SMSCampaignsApi.md +++ b/docs/SMSCampaignsApi.md @@ -2,61 +2,79 @@ All URIs are relative to *https://api.sendinblue.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_sms_campaign**](SMSCampaignsApi.md#create_sms_campaign) | **POST** /smsCampaigns | Creates an SMS campaign -[**delete_sms_campaign**](SMSCampaignsApi.md#delete_sms_campaign) | **DELETE** /smsCampaigns/{campaignId} | Delete an SMS campaign -[**get_sms_campaign**](SMSCampaignsApi.md#get_sms_campaign) | **GET** /smsCampaigns/{campaignId} | Get an SMS campaign -[**get_sms_campaigns**](SMSCampaignsApi.md#get_sms_campaigns) | **GET** /smsCampaigns | Returns the information for all your created SMS campaigns -[**request_sms_recipient_export**](SMSCampaignsApi.md#request_sms_recipient_export) | **POST** /smsCampaigns/{campaignId}/exportRecipients | Export an SMS campaign's recipients -[**send_sms_campaign_now**](SMSCampaignsApi.md#send_sms_campaign_now) | **POST** /smsCampaigns/{campaignId}/sendNow | Send your SMS campaign immediately -[**send_sms_report**](SMSCampaignsApi.md#send_sms_report) | **POST** /smsCampaigns/{campaignId}/sendReport | Send an SMS campaign's report -[**send_test_sms**](SMSCampaignsApi.md#send_test_sms) | **POST** /smsCampaigns/{campaignId}/sendTest | Send a test SMS campaign -[**update_sms_campaign**](SMSCampaignsApi.md#update_sms_campaign) | **PUT** /smsCampaigns/{campaignId} | Update an SMS campaign -[**update_sms_campaign_status**](SMSCampaignsApi.md#update_sms_campaign_status) | **PUT** /smsCampaigns/{campaignId}/status | Update a campaign's status - - -# **create_sms_campaign** -> CreateModel create_sms_campaign(create_sms_campaign) +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**create_sms_campaign**](SMSCampaignsApi.md#create_sms_campaign) | **POST** /smsCampaigns | Creates an SMS campaign | +| [**delete_sms_campaign**](SMSCampaignsApi.md#delete_sms_campaign) | **DELETE** /smsCampaigns/{campaignId} | Delete an SMS campaign | +| [**get_sms_campaign**](SMSCampaignsApi.md#get_sms_campaign) | **GET** /smsCampaigns/{campaignId} | Get an SMS campaign | +| [**get_sms_campaigns**](SMSCampaignsApi.md#get_sms_campaigns) | **GET** /smsCampaigns | Returns the information for all your created SMS campaigns | +| [**request_sms_recipient_export**](SMSCampaignsApi.md#request_sms_recipient_export) | **POST** /smsCampaigns/{campaignId}/exportRecipients | Export an SMS campaign's recipients | +| [**send_sms_campaign_now**](SMSCampaignsApi.md#send_sms_campaign_now) | **POST** /smsCampaigns/{campaignId}/sendNow | Send your SMS campaign immediately | +| [**send_sms_report**](SMSCampaignsApi.md#send_sms_report) | **POST** /smsCampaigns/{campaignId}/sendReport | Send an SMS campaign's report | +| [**send_test_sms**](SMSCampaignsApi.md#send_test_sms) | **POST** /smsCampaigns/{campaignId}/sendTest | Send a test SMS campaign | +| [**update_sms_campaign**](SMSCampaignsApi.md#update_sms_campaign) | **PUT** /smsCampaigns/{campaignId} | Update an SMS campaign | +| [**update_sms_campaign_status**](SMSCampaignsApi.md#update_sms_campaign_status) | **PUT** /smsCampaigns/{campaignId}/status | Update a campaign's status | + + +## create_sms_campaign + +> create_sms_campaign(create_sms_campaign) Creates an SMS campaign -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::SMSCampaignsApi.new - -create_sms_campaign = SibApiV3Sdk::CreateSmsCampaign.new # CreateSmsCampaign | Values to create an SMS Campaign - +create_sms_campaign = SibApiV3Sdk::CreateSmsCampaign.new({name: 'Spring Promo Code', sender: 'MyShop', content: 'Get a discount by visiting our NY store and saying : Happy Spring !'}) # CreateSmsCampaign | Values to create an SMS Campaign begin - #Creates an SMS campaign + # Creates an SMS campaign result = api_instance.create_sms_campaign(create_sms_campaign) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMSCampaignsApi->create_sms_campaign: #{e}" + puts "Error when calling SMSCampaignsApi->create_sms_campaign: #{e}" +end +``` + +#### Using the create_sms_campaign_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_sms_campaign_with_http_info(create_sms_campaign) + +```ruby +begin + # Creates an SMS campaign + data, status_code, headers = api_instance.create_sms_campaign_with_http_info(create_sms_campaign) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling SMSCampaignsApi->create_sms_campaign_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **create_sms_campaign** | [**CreateSmsCampaign**](CreateSmsCampaign.md)| Values to create an SMS Campaign | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **create_sms_campaign** | [**CreateSmsCampaign**](CreateSmsCampaign.md) | Values to create an SMS Campaign | | ### Return type @@ -68,51 +86,68 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## delete_sms_campaign -# **delete_sms_campaign** > delete_sms_campaign(campaign_id) Delete an SMS campaign -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::SMSCampaignsApi.new - campaign_id = 789 # Integer | id of the SMS campaign - begin - #Delete an SMS campaign + # Delete an SMS campaign api_instance.delete_sms_campaign(campaign_id) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMSCampaignsApi->delete_sms_campaign: #{e}" + puts "Error when calling SMSCampaignsApi->delete_sms_campaign: #{e}" +end +``` + +#### Using the delete_sms_campaign_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_sms_campaign_with_http_info(campaign_id) + +```ruby +begin + # Delete an SMS campaign + data, status_code, headers = api_instance.delete_sms_campaign_with_http_info(campaign_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling SMSCampaignsApi->delete_sms_campaign_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | **Integer**| id of the SMS campaign | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | id of the SMS campaign | | ### Return type @@ -124,52 +159,69 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_sms_campaign -# **get_sms_campaign** -> GetSmsCampaign get_sms_campaign(campaign_id) +> get_sms_campaign(campaign_id) Get an SMS campaign -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::SMSCampaignsApi.new - campaign_id = 789 # Integer | id of the SMS campaign - begin - #Get an SMS campaign + # Get an SMS campaign result = api_instance.get_sms_campaign(campaign_id) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMSCampaignsApi->get_sms_campaign: #{e}" + puts "Error when calling SMSCampaignsApi->get_sms_campaign: #{e}" +end +``` + +#### Using the get_sms_campaign_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_sms_campaign_with_http_info(campaign_id) + +```ruby +begin + # Get an SMS campaign + data, status_code, headers = api_instance.get_sms_campaign_with_http_info(campaign_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling SMSCampaignsApi->get_sms_campaign_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | **Integer**| id of the SMS campaign | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | id of the SMS campaign | | ### Return type @@ -181,63 +233,81 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_sms_campaigns -# **get_sms_campaigns** -> GetSmsCampaigns get_sms_campaigns(opts) +> get_sms_campaigns(opts) Returns the information for all your created SMS campaigns -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::SMSCampaignsApi.new - -opts = { - status: 'status_example', # String | Status of campaign. +opts = { + status: 'suspended', # String | Status of campaign. start_date: 'start_date_example', # String | 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 'status' not passed and if passed is set to 'sent' ) end_date: 'end_date_example', # String | Mandatory if startDate is used. Ending (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 'status' not passed and if passed is set to 'sent' ) - limit: 500, # Integer | Number limitation for the result returned - offset: 0, # Integer | Beginning point in the list to retrieve from. - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + limit: 789, # Integer | Number limitation for the result returned + offset: 789, # Integer | Beginning point in the list to retrieve from. + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Returns the information for all your created SMS campaigns + # Returns the information for all your created SMS campaigns result = api_instance.get_sms_campaigns(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMSCampaignsApi->get_sms_campaigns: #{e}" + puts "Error when calling SMSCampaignsApi->get_sms_campaigns: #{e}" +end +``` + +#### Using the get_sms_campaigns_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_sms_campaigns_with_http_info(opts) + +```ruby +begin + # Returns the information for all your created SMS campaigns + data, status_code, headers = api_instance.get_sms_campaigns_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling SMSCampaignsApi->get_sms_campaigns_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | **String**| Status of campaign. | [optional] - **start_date** | **String**| 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 'status' not passed and if passed is set to 'sent' ) | [optional] - **end_date** | **String**| Mandatory if startDate is used. Ending (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 'status' not passed and if passed is set to 'sent' ) | [optional] - **limit** | **Integer**| Number limitation for the result returned | [optional] [default to 500] - **offset** | **Integer**| Beginning point in the list to retrieve from. | [optional] [default to 0] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **status** | **String** | Status of campaign. | [optional] | +| **start_date** | **String** | 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 'status' not passed and if passed is set to 'sent' ) | [optional] | +| **end_date** | **String** | Mandatory if startDate is used. Ending (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 'status' not passed and if passed is set to 'sent' ) | [optional] | +| **limit** | **Integer** | Number limitation for the result returned | [optional][default to 500] | +| **offset** | **Integer** | Beginning point in the list to retrieve from. | [optional][default to 0] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -249,58 +319,75 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## request_sms_recipient_export -# **request_sms_recipient_export** -> CreatedProcessId request_sms_recipient_export(campaign_id, opts) +> request_sms_recipient_export(campaign_id, opts) Export an SMS campaign's recipients It returns the background process ID which on completion calls the notify URL that you have set in the input. -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::SMSCampaignsApi.new - campaign_id = 789 # Integer | id of the campaign - -opts = { - recipient_export: SibApiV3Sdk::RequestSmsRecipientExport.new # RequestSmsRecipientExport | Values to send for a recipient export request +opts = { + recipient_export: SibApiV3Sdk::RequestSmsRecipientExport.new({recipients_type: 'all'}) # RequestSmsRecipientExport | Values to send for a recipient export request } begin - #Export an SMS campaign's recipients + # Export an SMS campaign's recipients result = api_instance.request_sms_recipient_export(campaign_id, opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMSCampaignsApi->request_sms_recipient_export: #{e}" + puts "Error when calling SMSCampaignsApi->request_sms_recipient_export: #{e}" +end +``` + +#### Using the request_sms_recipient_export_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> request_sms_recipient_export_with_http_info(campaign_id, opts) + +```ruby +begin + # Export an SMS campaign's recipients + data, status_code, headers = api_instance.request_sms_recipient_export_with_http_info(campaign_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling SMSCampaignsApi->request_sms_recipient_export_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | **Integer**| id of the campaign | - **recipient_export** | [**RequestSmsRecipientExport**](RequestSmsRecipientExport.md)| Values to send for a recipient export request | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | id of the campaign | | +| **recipient_export** | [**RequestSmsRecipientExport**](RequestSmsRecipientExport.md) | Values to send for a recipient export request | [optional] | ### Return type @@ -312,51 +399,68 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## send_sms_campaign_now -# **send_sms_campaign_now** > send_sms_campaign_now(campaign_id) Send your SMS campaign immediately -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::SMSCampaignsApi.new - campaign_id = 789 # Integer | id of the campaign - begin - #Send your SMS campaign immediately + # Send your SMS campaign immediately api_instance.send_sms_campaign_now(campaign_id) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMSCampaignsApi->send_sms_campaign_now: #{e}" + puts "Error when calling SMSCampaignsApi->send_sms_campaign_now: #{e}" +end +``` + +#### Using the send_sms_campaign_now_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> send_sms_campaign_now_with_http_info(campaign_id) + +```ruby +begin + # Send your SMS campaign immediately + data, status_code, headers = api_instance.send_sms_campaign_now_with_http_info(campaign_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling SMSCampaignsApi->send_sms_campaign_now_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | **Integer**| id of the campaign | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | id of the campaign | | ### Return type @@ -368,56 +472,72 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## send_sms_report -# **send_sms_report** > send_sms_report(campaign_id, send_report) Send an SMS campaign's report Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail. -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::SMSCampaignsApi.new - campaign_id = 789 # Integer | id of the campaign +send_report = SibApiV3Sdk::SendReport.new({email: SibApiV3Sdk::SendReportEmail.new({to: ['jim.suehan@example.com'], body: 'Please find attached the report of our last email campaign.'})}) # SendReport | Values for send a report + +begin + # Send an SMS campaign's report + api_instance.send_sms_report(campaign_id, send_report) +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling SMSCampaignsApi->send_sms_report: #{e}" +end +``` + +#### Using the send_sms_report_with_http_info variant -send_report = SibApiV3Sdk::SendReport.new # SendReport | Values for send a report +This returns an Array which contains the response data (`nil` in this case), status code and headers. +> send_sms_report_with_http_info(campaign_id, send_report) +```ruby begin - #Send an SMS campaign's report - api_instance.send_sms_report(campaign_id, send_report) + # Send an SMS campaign's report + data, status_code, headers = api_instance.send_sms_report_with_http_info(campaign_id, send_report) + p status_code # => 2xx + p headers # => { ... } + p data # => nil rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMSCampaignsApi->send_sms_report: #{e}" + puts "Error when calling SMSCampaignsApi->send_sms_report_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | **Integer**| id of the campaign | - **send_report** | [**SendReport**](SendReport.md)| Values for send a report | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | id of the campaign | | +| **send_report** | [**SendReport**](SendReport.md) | Values for send a report | | ### Return type @@ -429,54 +549,70 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## send_test_sms -# **send_test_sms** > send_test_sms(campaign_id, phone_number) Send a test SMS campaign -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::SMSCampaignsApi.new - campaign_id = 789 # Integer | Id of the SMS campaign - phone_number = SibApiV3Sdk::SendTestSms.new # SendTestSms | 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 - begin - #Send a test SMS campaign + # Send a test SMS campaign api_instance.send_test_sms(campaign_id, phone_number) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMSCampaignsApi->send_test_sms: #{e}" + puts "Error when calling SMSCampaignsApi->send_test_sms: #{e}" +end +``` + +#### Using the send_test_sms_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> send_test_sms_with_http_info(campaign_id, phone_number) + +```ruby +begin + # Send a test SMS campaign + data, status_code, headers = api_instance.send_test_sms_with_http_info(campaign_id, phone_number) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling SMSCampaignsApi->send_test_sms_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | **Integer**| Id of the SMS campaign | - **phone_number** | [**SendTestSms**](SendTestSms.md)| 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 | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | Id of the SMS campaign | | +| **phone_number** | [**SendTestSms**](SendTestSms.md) | 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 | | ### Return type @@ -488,54 +624,70 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## update_sms_campaign -# **update_sms_campaign** > update_sms_campaign(campaign_id, update_sms_campaign) Update an SMS campaign -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::SMSCampaignsApi.new - campaign_id = 789 # Integer | id of the SMS campaign - update_sms_campaign = SibApiV3Sdk::UpdateSmsCampaign.new # UpdateSmsCampaign | Values to update an SMS Campaign - begin - #Update an SMS campaign + # Update an SMS campaign api_instance.update_sms_campaign(campaign_id, update_sms_campaign) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMSCampaignsApi->update_sms_campaign: #{e}" + puts "Error when calling SMSCampaignsApi->update_sms_campaign: #{e}" +end +``` + +#### Using the update_sms_campaign_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_sms_campaign_with_http_info(campaign_id, update_sms_campaign) + +```ruby +begin + # Update an SMS campaign + data, status_code, headers = api_instance.update_sms_campaign_with_http_info(campaign_id, update_sms_campaign) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling SMSCampaignsApi->update_sms_campaign_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | **Integer**| id of the SMS campaign | - **update_sms_campaign** | [**UpdateSmsCampaign**](UpdateSmsCampaign.md)| Values to update an SMS Campaign | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | id of the SMS campaign | | +| **update_sms_campaign** | [**UpdateSmsCampaign**](UpdateSmsCampaign.md) | Values to update an SMS Campaign | | ### Return type @@ -547,54 +699,70 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## update_sms_campaign_status -# **update_sms_campaign_status** > update_sms_campaign_status(campaign_id, status) Update a campaign's status -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::SMSCampaignsApi.new - campaign_id = 789 # Integer | id of the campaign - status = SibApiV3Sdk::UpdateCampaignStatus.new # UpdateCampaignStatus | Status of the campaign. - begin - #Update a campaign's status + # Update a campaign's status api_instance.update_sms_campaign_status(campaign_id, status) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SMSCampaignsApi->update_sms_campaign_status: #{e}" + puts "Error when calling SMSCampaignsApi->update_sms_campaign_status: #{e}" +end +``` + +#### Using the update_sms_campaign_status_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_sms_campaign_status_with_http_info(campaign_id, status) + +```ruby +begin + # Update a campaign's status + data, status_code, headers = api_instance.update_sms_campaign_status_with_http_info(campaign_id, status) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling SMSCampaignsApi->update_sms_campaign_status_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_id** | **Integer**| id of the campaign | - **status** | [**UpdateCampaignStatus**](UpdateCampaignStatus.md)| Status of the campaign. | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **campaign_id** | **Integer** | id of the campaign | | +| **status** | [**UpdateCampaignStatus**](UpdateCampaignStatus.md) | Status of the campaign. | | ### Return type @@ -606,8 +774,6 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - - +- **Content-Type**: application/json +- **Accept**: application/json diff --git a/docs/SendEmail.md b/docs/SendEmail.md index bbdbb8a..98780bb 100644 --- a/docs/SendEmail.md +++ b/docs/SendEmail.md @@ -1,16 +1,34 @@ # SibApiV3Sdk::SendEmail ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email_to** | **Array<String>** | List of the email addresses of the recipients. For example, ['abc@example.com', 'asd@example.com']. | -**email_bcc** | **Array<String>** | List of the email addresses of the recipients in bcc | [optional] -**email_cc** | **Array<String>** | List of the email addresses of the recipients in cc | [optional] -**reply_to** | **String** | Email address which shall be used by campaign recipients to reply back | [optional] -**attachment_url** | **String** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional] -**attachment** | [**Array<SendEmailAttachment>**](SendEmailAttachment.md) | Pass the list of content (base64 encoded) and name of the attachment. For example, [{\"content\":\"base64 encoded content 1\", \"name\":\"attcahment1\"}, {\"content\":\"base64 encoded content 2\", \"name\":\"attcahment2\"}]. | [optional] -**headers** | **Object** | Pass the set of headers that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. Headers are allowed in `This-Case-Only` (i.e. words separated by hyphen with first letter of each word in capital letter), they will be converted to such case styling if not in this format in the request payload. For example, {\"Content-Type\":\"text/html\", \"charset\":\"iso-8859-1\", \"sender.ip\":\"1.2.3.4\"} | [optional] -**attributes** | **Object** | Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"} | [optional] -**tags** | **Array<String>** | Tag your emails to find them more easily | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email_to** | **Array<String>** | List of the email addresses of the recipients. For example, ['abc@example.com', 'asd@example.com']. | | +| **email_bcc** | **Array<String>** | List of the email addresses of the recipients in bcc | [optional] | +| **email_cc** | **Array<String>** | List of the email addresses of the recipients in cc | [optional] | +| **reply_to** | **String** | Email address which shall be used by campaign recipients to reply back | [optional] | +| **attachment_url** | **String** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional] | +| **attachment** | [**Array<SendEmailAttachment>**](SendEmailAttachment.md) | Pass the list of content (base64 encoded) and name of the attachment. For example, [{\"content\":\"base64 encoded content 1\", \"name\":\"attcahment1\"}, {\"content\":\"base64 encoded content 2\", \"name\":\"attcahment2\"}]. | [optional] | +| **headers** | **Object** | Pass the set of headers that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. Headers are allowed in `This-Case-Only` (i.e. words separated by hyphen with first letter of each word in capital letter), they will be converted to such case styling if not in this format in the request payload. For example, {\"Content-Type\":\"text/html\", \"charset\":\"iso-8859-1\", \"sender.ip\":\"1.2.3.4\"} | [optional] | +| **attributes** | **Object** | Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"} | [optional] | +| **tags** | **Array<String>** | Tag your emails to find them more easily | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendEmail.new( + email_to: null, + email_bcc: null, + email_cc: null, + reply_to: support@myshop.com, + attachment_url: https://attachment.domain.com, + attachment: null, + headers: {"Content-Type":"text/html","charset":"iso-8859-1","sender.ip":"1.2.3.4"}, + attributes: {"FNAME":"Joe","LNAME":"Doe"}, + tags: null +) +``` diff --git a/docs/SendEmailAttachment.md b/docs/SendEmailAttachment.md index f94eb4b..a463a9a 100644 --- a/docs/SendEmailAttachment.md +++ b/docs/SendEmailAttachment.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::SendEmailAttachment ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**content** | **String** | Base64 encoded chunk data of the attachment generated on the fly | -**name** | **String** | Required for content. Name of the attachment | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **content** | **String** | Base64 encoded chunk data of the attachment generated on the fly | | +| **name** | **String** | Required for content. Name of the attachment | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendEmailAttachment.new( + content: b3JkZXIucGRm, + name: myAttachment.png +) +``` diff --git a/docs/SendReport.md b/docs/SendReport.md index e614155..42bc97d 100644 --- a/docs/SendReport.md +++ b/docs/SendReport.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::SendReport ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**language** | **String** | Language of email content for campaign report sending. | [optional] [default to 'fr'] -**email** | [**SendReportEmail**](SendReportEmail.md) | | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **language** | **String** | Language of email content for campaign report sending. | [optional][default to 'fr'] | +| **email** | [**SendReportEmail**](SendReportEmail.md) | | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendReport.new( + language: en, + email: null +) +``` diff --git a/docs/SendReportEmail.md b/docs/SendReportEmail.md index ca4c8b7..310d32d 100644 --- a/docs/SendReportEmail.md +++ b/docs/SendReportEmail.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::SendReportEmail ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**to** | **Array<String>** | Email addresses of the recipients | -**body** | **String** | Custom text message to be presented in the report email. | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **to** | **Array<String>** | Email addresses of the recipients | | +| **body** | **String** | Custom text message to be presented in the report email. | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendReportEmail.new( + to: null, + body: Please find attached the report of our last email campaign. +) +``` diff --git a/docs/SendSms.md b/docs/SendSms.md index f9cdb85..81f85db 100644 --- a/docs/SendSms.md +++ b/docs/SendSms.md @@ -1,12 +1,26 @@ # SibApiV3Sdk::SendSms ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**reference** | **String** | | -**message_id** | **Integer** | | -**sms_count** | **Integer** | Count of SMS's to send multiple text messages | [optional] -**used_credits** | **Float** | SMS credits used per text message | [optional] -**remaining_credits** | **Float** | Remaining SMS credits of the user | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **reference** | **String** | | | +| **message_id** | **Integer** | | | +| **sms_count** | **Integer** | Count of SMS's to send multiple text messages | [optional] | +| **used_credits** | **Float** | SMS credits used per text message | [optional] | +| **remaining_credits** | **Float** | Remaining SMS credits of the user | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendSms.new( + reference: ab1cde2fgh3i4jklmno, + message_id: 1511882900176220, + sms_count: 2, + used_credits: 0.7, + remaining_credits: 82.85 +) +``` diff --git a/docs/SendSmtpEmail.md b/docs/SendSmtpEmail.md index 545552f..81e4f88 100644 --- a/docs/SendSmtpEmail.md +++ b/docs/SendSmtpEmail.md @@ -1,21 +1,44 @@ # SibApiV3Sdk::SendSmtpEmail ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sender** | [**SendSmtpEmailSender**](SendSmtpEmailSender.md) | | [optional] -**to** | [**Array<SendSmtpEmailTo>**](SendSmtpEmailTo.md) | Mandatory if messageVersions are not passed, ignored if messageVersions are passed. List of email addresses and names (optional) of the recipients. For example, [{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}] | [optional] -**bcc** | [**Array<SendSmtpEmailBcc>**](SendSmtpEmailBcc.md) | List of email addresses and names (optional) of the recipients in bcc | [optional] -**cc** | [**Array<SendSmtpEmailCc>**](SendSmtpEmailCc.md) | List of email addresses and names (optional) of the recipients in cc | [optional] -**html_content** | **String** | HTML body of the message ( Mandatory if 'templateId' is not passed, ignored if 'templateId' is passed ) | [optional] -**text_content** | **String** | Plain Text body of the message ( Ignored if 'templateId' is passed ) | [optional] -**subject** | **String** | Subject of the message. Mandatory if 'templateId' is not passed | [optional] -**reply_to** | [**SendSmtpEmailReplyTo**](SendSmtpEmailReplyTo.md) | | [optional] -**attachment** | [**Array<SendSmtpEmailAttachment>**](SendSmtpEmailAttachment.md) | Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, `[{\"url\":\"https://attachment.domain.com/myAttachmentFromUrl.jpg\", \"name\":\"myAttachmentFromUrl.jpg\"}, {\"content\":\"base64 example content\", \"name\":\"myAttachmentFromBase64.jpg\"}]`. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps, odt, mp3, m4a, m4v, wma, ogg, flac, wav, aif, aifc, aiff, mp4, mov, avi, mkv, mpeg, mpg and wmv ( If 'templateId' is passed and is in New Template Language format then both attachment url and content are accepted. If template is in Old template Language format, then 'attachment' is ignored ) | [optional] -**headers** | **Object** | Pass the set of custom headers (not the standard headers) that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. Headers are allowed in `This-Case-Only` (i.e. words separated by hyphen with first letter of each word in capital letter), they will be converted to such case styling if not in this format in the request payload. For example, `{\"sender.ip\":\"1.2.3.4\", \"X-Mailin-custom\":\"some_custom_header\"}`. | [optional] -**template_id** | **Integer** | Id of the template. Mandatory if messageVersions are passed | [optional] -**params** | **Object** | Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. It's considered only if template is in New Template Language format. | [optional] -**message_versions** | [**Array<SendSmtpEmailMessageVersions>**](SendSmtpEmailMessageVersions.md) | You can customize and send out multiple versions of a templateId. Some global parameters such as **to(mandatory), bcc, cc, replyTo, subject** can also be customized specific to each version. The size of individual params in all the messageVersions shall not exceed 100 KB limit and that of cumulative params shall not exceed 1000 KB. This feature is currently in its beta version. You can follow this **step-by-step guide** on how to use **messageVersions** to batch send emails - https://developers.sendinblue.com/docs/batch-send-transactional-emails | [optional] -**tags** | **Array<String>** | Tag your emails to find them more easily | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **sender** | [**SendSmtpEmailSender**](SendSmtpEmailSender.md) | | [optional] | +| **to** | [**Array<SendSmtpEmailTo>**](SendSmtpEmailTo.md) | Mandatory if messageVersions are not passed, ignored if messageVersions are passed. List of email addresses and names (optional) of the recipients. For example, [{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}] | [optional] | +| **bcc** | [**Array<SendSmtpEmailBcc>**](SendSmtpEmailBcc.md) | List of email addresses and names (optional) of the recipients in bcc | [optional] | +| **cc** | [**Array<SendSmtpEmailCc>**](SendSmtpEmailCc.md) | List of email addresses and names (optional) of the recipients in cc | [optional] | +| **html_content** | **String** | HTML body of the message ( Mandatory if 'templateId' is not passed, ignored if 'templateId' is passed ) | [optional] | +| **text_content** | **String** | Plain Text body of the message ( Ignored if 'templateId' is passed ) | [optional] | +| **subject** | **String** | Subject of the message. Mandatory if 'templateId' is not passed | [optional] | +| **reply_to** | [**SendSmtpEmailReplyTo**](SendSmtpEmailReplyTo.md) | | [optional] | +| **attachment** | [**Array<SendSmtpEmailAttachment>**](SendSmtpEmailAttachment.md) | Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, `[{\"url\":\"https://attachment.domain.com/myAttachmentFromUrl.jpg\", \"name\":\"myAttachmentFromUrl.jpg\"}, {\"content\":\"base64 example content\", \"name\":\"myAttachmentFromBase64.jpg\"}]`. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps, odt, mp3, m4a, m4v, wma, ogg, flac, wav, aif, aifc, aiff, mp4, mov, avi, mkv, mpeg, mpg and wmv ( If 'templateId' is passed and is in New Template Language format then both attachment url and content are accepted. If template is in Old template Language format, then 'attachment' is ignored ) | [optional] | +| **headers** | **Object** | Pass the set of custom headers (not the standard headers) that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. Headers are allowed in `This-Case-Only` (i.e. words separated by hyphen with first letter of each word in capital letter), they will be converted to such case styling if not in this format in the request payload. For example, `{\"sender.ip\":\"1.2.3.4\", \"X-Mailin-custom\":\"some_custom_header\"}`. | [optional] | +| **template_id** | **Integer** | Id of the template. Mandatory if messageVersions are passed | [optional] | +| **params** | **Object** | Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. It's considered only if template is in New Template Language format. | [optional] | +| **message_versions** | [**Array<SendSmtpEmailMessageVersions>**](SendSmtpEmailMessageVersions.md) | You can customize and send out multiple versions of a templateId. Some global parameters such as **to(mandatory), bcc, cc, replyTo, subject** can also be customized specific to each version. The size of individual params in all the messageVersions shall not exceed 100 KB limit and that of cumulative params shall not exceed 1000 KB. This feature is currently in its beta version. You can follow this **step-by-step guide** on how to use **messageVersions** to batch send emails - https://developers.sendinblue.com/docs/batch-send-transactional-emails | [optional] | +| **tags** | **Array<String>** | Tag your emails to find them more easily | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendSmtpEmail.new( + sender: null, + to: null, + bcc: null, + cc: null, + html_content: <!DOCTYPE html> <html> <body> <h1>Confirm you email</h1> <p>Please confirm your email address by clicking on the link below</p> </body> </html>, + text_content: Please confirm your email address by clicking on the link https://text.domain.com, + subject: Login Email confirmation, + reply_to: null, + attachment: null, + headers: {"sender.ip":"1.2.3.4","X-Mailin-custom":"some_custom_header"}, + template_id: 2, + params: {"FNAME":"Joe","LNAME":"Doe"}, + message_versions: null, + tags: null +) +``` diff --git a/docs/SendSmtpEmailAttachment.md b/docs/SendSmtpEmailAttachment.md index 3a3b5eb..9750340 100644 --- a/docs/SendSmtpEmailAttachment.md +++ b/docs/SendSmtpEmailAttachment.md @@ -1,10 +1,22 @@ # SibApiV3Sdk::SendSmtpEmailAttachment ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**url** | **String** | Absolute url of the attachment (no local file). | [optional] -**content** | **String** | Base64 encoded chunk data of the attachment generated on the fly | [optional] -**name** | **String** | Required if content is passed. Name of the attachment | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **url** | **String** | Absolute url of the attachment (no local file). | [optional] | +| **content** | **String** | Base64 encoded chunk data of the attachment generated on the fly | [optional] | +| **name** | **String** | Required if content is passed. Name of the attachment | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendSmtpEmailAttachment.new( + url: https://attachment.domain.com/myAttachmentFromUrl.jpg, + content: b3JkZXIucGRm, + name: myAttachment.png +) +``` diff --git a/docs/SendSmtpEmailBcc.md b/docs/SendSmtpEmailBcc.md index a4b046e..60d223a 100644 --- a/docs/SendSmtpEmailBcc.md +++ b/docs/SendSmtpEmailBcc.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::SendSmtpEmailBcc ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | Email address of the recipient in bcc | -**name** | **String** | Name of the recipient in bcc. Maximum allowed characters are 70. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Email address of the recipient in bcc | | +| **name** | **String** | Name of the recipient in bcc. Maximum allowed characters are 70. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendSmtpEmailBcc.new( + email: helen9766@example.com, + name: Helen +) +``` diff --git a/docs/SendSmtpEmailCc.md b/docs/SendSmtpEmailCc.md index 2ba26b8..5385f5b 100644 --- a/docs/SendSmtpEmailCc.md +++ b/docs/SendSmtpEmailCc.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::SendSmtpEmailCc ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | Email address of the recipient in cc | -**name** | **String** | Name of the recipient in cc. Maximum allowed characters are 70. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Email address of the recipient in cc | | +| **name** | **String** | Name of the recipient in cc. Maximum allowed characters are 70. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendSmtpEmailCc.new( + email: ann6533@example.com, + name: Ann +) +``` diff --git a/docs/SendSmtpEmailMessageVersions.md b/docs/SendSmtpEmailMessageVersions.md index af60e74..e059c2a 100644 --- a/docs/SendSmtpEmailMessageVersions.md +++ b/docs/SendSmtpEmailMessageVersions.md @@ -1,13 +1,28 @@ # SibApiV3Sdk::SendSmtpEmailMessageVersions ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**to** | [**Array<SendSmtpEmailTo1>**](SendSmtpEmailTo1.md) | List of email addresses and names (_optional_) of the recipients. For example, [{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}] | -**params** | **Hash<String, Object>** | Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. It's considered only if template is in New Template Language format. | [optional] -**bcc** | [**Array<SendSmtpEmailBcc>**](SendSmtpEmailBcc.md) | List of email addresses and names (optional) of the recipients in bcc | [optional] -**cc** | [**Array<SendSmtpEmailCc>**](SendSmtpEmailCc.md) | List of email addresses and names (optional) of the recipients in cc | [optional] -**reply_to** | [**SendSmtpEmailReplyTo1**](SendSmtpEmailReplyTo1.md) | | [optional] -**subject** | **String** | Custom subject specific to message version | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **to** | [**Array<SendSmtpEmailTo1>**](SendSmtpEmailTo1.md) | List of email addresses and names (_optional_) of the recipients. For example, [{\"name\":\"Jimmy\", \"email\":\"jimmy98@example.com\"}, {\"name\":\"Joe\", \"email\":\"joe@example.com\"}] | | +| **params** | **Hash<String, Object>** | Pass the set of attributes to customize the template. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. It's considered only if template is in New Template Language format. | [optional] | +| **bcc** | [**Array<SendSmtpEmailBcc>**](SendSmtpEmailBcc.md) | List of email addresses and names (optional) of the recipients in bcc | [optional] | +| **cc** | [**Array<SendSmtpEmailCc>**](SendSmtpEmailCc.md) | List of email addresses and names (optional) of the recipients in cc | [optional] | +| **reply_to** | [**SendSmtpEmailReplyTo1**](SendSmtpEmailReplyTo1.md) | | [optional] | +| **subject** | **String** | Custom subject specific to message version | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendSmtpEmailMessageVersions.new( + to: null, + params: {"FNAME":"Joe","LNAME":"Doe"}, + bcc: null, + cc: null, + reply_to: null, + subject: Login Email confirmation +) +``` diff --git a/docs/SendSmtpEmailReplyTo.md b/docs/SendSmtpEmailReplyTo.md index c172858..825b516 100644 --- a/docs/SendSmtpEmailReplyTo.md +++ b/docs/SendSmtpEmailReplyTo.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::SendSmtpEmailReplyTo ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | Email address in reply to | -**name** | **String** | Name in reply to. Maximum allowed characters are 70. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Email address in reply to | | +| **name** | **String** | Name in reply to. Maximum allowed characters are 70. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendSmtpEmailReplyTo.new( + email: ann6533@example.com, + name: Ann +) +``` diff --git a/docs/SendSmtpEmailReplyTo1.md b/docs/SendSmtpEmailReplyTo1.md index 426caf7..274adb3 100644 --- a/docs/SendSmtpEmailReplyTo1.md +++ b/docs/SendSmtpEmailReplyTo1.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::SendSmtpEmailReplyTo1 ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | Email address in reply to | -**name** | **String** | Name in reply to. Maximum allowed characters are 70. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Email address in reply to | | +| **name** | **String** | Name in reply to. Maximum allowed characters are 70. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendSmtpEmailReplyTo1.new( + email: ann6533@example.com, + name: Ann +) +``` diff --git a/docs/SendSmtpEmailSender.md b/docs/SendSmtpEmailSender.md index 509d14f..89bd0f3 100644 --- a/docs/SendSmtpEmailSender.md +++ b/docs/SendSmtpEmailSender.md @@ -1,10 +1,22 @@ # SibApiV3Sdk::SendSmtpEmailSender ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Name of the sender from which the emails will be sent. Maximum allowed characters are 70. Applicable only when email is passed. | [optional] -**email** | **String** | Email of the sender from which the emails will be sent. Mandatory if sender id is not passed. | [optional] -**id** | **Integer** | Id of the sender from which the emails will be sent. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). Mandatory if email is not passed. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of the sender from which the emails will be sent. Maximum allowed characters are 70. Applicable only when email is passed. | [optional] | +| **email** | **String** | Email of the sender from which the emails will be sent. Mandatory if sender id is not passed. | [optional] | +| **id** | **Integer** | Id of the sender from which the emails will be sent. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). Mandatory if email is not passed. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendSmtpEmailSender.new( + name: Mary from MyShop, + email: no-reply@myshop.com, + id: 2 +) +``` diff --git a/docs/SendSmtpEmailTo.md b/docs/SendSmtpEmailTo.md index cd472c8..138752c 100644 --- a/docs/SendSmtpEmailTo.md +++ b/docs/SendSmtpEmailTo.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::SendSmtpEmailTo ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | Email address of the recipient | -**name** | **String** | Name of the recipient. Maximum allowed characters are 70. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Email address of the recipient | | +| **name** | **String** | Name of the recipient. Maximum allowed characters are 70. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendSmtpEmailTo.new( + email: jimmy98@example.com, + name: Jimmy +) +``` diff --git a/docs/SendSmtpEmailTo1.md b/docs/SendSmtpEmailTo1.md index f459b97..e1c0b93 100644 --- a/docs/SendSmtpEmailTo1.md +++ b/docs/SendSmtpEmailTo1.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::SendSmtpEmailTo1 ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | Email address of the recipient | -**name** | **String** | Name of the recipient. **Maximum allowed characters are 70**. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Email address of the recipient | | +| **name** | **String** | Name of the recipient. **Maximum allowed characters are 70**. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendSmtpEmailTo1.new( + email: jimmy98@example.com, + name: Jimmy +) +``` diff --git a/docs/SendTemplateEmail.md b/docs/SendTemplateEmail.md index 2d8d5be..70d20f6 100644 --- a/docs/SendTemplateEmail.md +++ b/docs/SendTemplateEmail.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::SendTemplateEmail ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**message_id** | **String** | Message ID of the template Email sent | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **message_id** | **String** | Message ID of the template Email sent | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendTemplateEmail.new( + message_id: <201798300811.5787683@relay.domain.com> +) +``` diff --git a/docs/SendTestEmail.md b/docs/SendTestEmail.md index af3c9a6..f3e8da2 100644 --- a/docs/SendTestEmail.md +++ b/docs/SendTestEmail.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::SendTestEmail ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email_to** | **Array<String>** | List of the email addresses of the recipients whom you wish to send the test mail. If left empty, the test mail will be sent to your entire test list. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email_to** | **Array<String>** | List of the email addresses of the recipients whom you wish to send the test mail. If left empty, the test mail will be sent to your entire test list. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendTestEmail.new( + email_to: null +) +``` diff --git a/docs/SendTestSms.md b/docs/SendTestSms.md index 10cdc5e..e30923d 100644 --- a/docs/SendTestSms.md +++ b/docs/SendTestSms.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::SendTestSms ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**phone_number** | **String** | 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 | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **phone_number** | **String** | 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 | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendTestSms.new( + phone_number: 33689965433 +) +``` diff --git a/docs/SendTransacSms.md b/docs/SendTransacSms.md index 69b8a51..96b1f76 100644 --- a/docs/SendTransacSms.md +++ b/docs/SendTransacSms.md @@ -1,13 +1,28 @@ # SibApiV3Sdk::SendTransacSms ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sender** | **String** | Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** | -**recipient** | **String** | Mobile number to send SMS with the country code | -**content** | **String** | Content of the message. If more than 160 characters long, will be sent as multiple text messages | -**type** | **String** | Type of the SMS. Marketing SMS messages are those sent typically with marketing content. Transactional SMS messages are sent to individuals and are triggered in response to some action, such as a sign-up, purchase, etc. | [optional] [default to 'transactional'] -**tag** | **String** | Tag of the message | [optional] -**web_url** | **String** | Webhook to call for each event triggered by the message (delivered etc.) | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **sender** | **String** | Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** | | +| **recipient** | **String** | Mobile number to send SMS with the country code | | +| **content** | **String** | Content of the message. If more than 160 characters long, will be sent as multiple text messages | | +| **type** | **String** | Type of the SMS. Marketing SMS messages are those sent typically with marketing content. Transactional SMS messages are sent to individuals and are triggered in response to some action, such as a sign-up, purchase, etc. | [optional][default to 'transactional'] | +| **tag** | **String** | Tag of the message | [optional] | +| **web_url** | **String** | Webhook to call for each event triggered by the message (delivered etc.) | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::SendTransacSms.new( + sender: MyShop, + recipient: 33689965433, + content: Enter this code:CCJJG8 to validate your account, + type: marketing, + tag: accountValidation, + web_url: http://requestb.in/173lyyx1 +) +``` diff --git a/docs/SendersApi.md b/docs/SendersApi.md index cf35466..ba0a66f 100644 --- a/docs/SendersApi.md +++ b/docs/SendersApi.md @@ -2,58 +2,77 @@ All URIs are relative to *https://api.sendinblue.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_sender**](SendersApi.md#create_sender) | **POST** /senders | Create a new sender -[**delete_sender**](SendersApi.md#delete_sender) | **DELETE** /senders/{senderId} | Delete a sender -[**get_ips**](SendersApi.md#get_ips) | **GET** /senders/ips | Get all the dedicated IPs for your account -[**get_ips_from_sender**](SendersApi.md#get_ips_from_sender) | **GET** /senders/{senderId}/ips | Get all the dedicated IPs for a sender -[**get_senders**](SendersApi.md#get_senders) | **GET** /senders | Get the list of all your senders -[**update_sender**](SendersApi.md#update_sender) | **PUT** /senders/{senderId} | Update a sender +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**create_sender**](SendersApi.md#create_sender) | **POST** /senders | Create a new sender | +| [**delete_sender**](SendersApi.md#delete_sender) | **DELETE** /senders/{senderId} | Delete a sender | +| [**get_ips**](SendersApi.md#get_ips) | **GET** /senders/ips | Get all the dedicated IPs for your account | +| [**get_ips_from_sender**](SendersApi.md#get_ips_from_sender) | **GET** /senders/{senderId}/ips | Get all the dedicated IPs for a sender | +| [**get_senders**](SendersApi.md#get_senders) | **GET** /senders | Get the list of all your senders | +| [**update_sender**](SendersApi.md#update_sender) | **PUT** /senders/{senderId} | Update a sender | -# **create_sender** -> CreateSenderModel create_sender(opts) +## create_sender + +> create_sender(opts) Create a new sender -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::SendersApi.new - -opts = { - sender: SibApiV3Sdk::CreateSender.new # CreateSender | sender's name +opts = { + sender: SibApiV3Sdk::CreateSender.new({name: 'Newsletter', email: 'newsletter@mycompany.com'}) # CreateSender | sender's name } begin - #Create a new sender + # Create a new sender result = api_instance.create_sender(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SendersApi->create_sender: #{e}" + puts "Error when calling SendersApi->create_sender: #{e}" +end +``` + +#### Using the create_sender_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_sender_with_http_info(opts) + +```ruby +begin + # Create a new sender + data, status_code, headers = api_instance.create_sender_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling SendersApi->create_sender_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **sender** | [**CreateSender**](CreateSender.md)| sender's name | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **sender** | [**CreateSender**](CreateSender.md) | sender's name | [optional] | ### Return type @@ -65,51 +84,68 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## delete_sender -# **delete_sender** > delete_sender(sender_id) Delete a sender -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::SendersApi.new - sender_id = 789 # Integer | Id of the sender - begin - #Delete a sender + # Delete a sender api_instance.delete_sender(sender_id) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SendersApi->delete_sender: #{e}" + puts "Error when calling SendersApi->delete_sender: #{e}" +end +``` + +#### Using the delete_sender_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_sender_with_http_info(sender_id) + +```ruby +begin + # Delete a sender + data, status_code, headers = api_instance.delete_sender_with_http_info(sender_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling SendersApi->delete_sender_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **sender_id** | **Integer**| Id of the sender | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **sender_id** | **Integer** | Id of the sender | | ### Return type @@ -121,45 +157,65 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_ips -# **get_ips** -> GetIps get_ips +> get_ips Get all the dedicated IPs for your account -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::SendersApi.new begin - #Get all the dedicated IPs for your account + # Get all the dedicated IPs for your account result = api_instance.get_ips p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SendersApi->get_ips: #{e}" + puts "Error when calling SendersApi->get_ips: #{e}" +end +``` + +#### Using the get_ips_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_ips_with_http_info + +```ruby +begin + # Get all the dedicated IPs for your account + data, status_code, headers = api_instance.get_ips_with_http_info + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling SendersApi->get_ips_with_http_info: #{e}" end ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -172,52 +228,69 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_ips_from_sender -# **get_ips_from_sender** -> GetIpsFromSender get_ips_from_sender(sender_id) +> get_ips_from_sender(sender_id) Get all the dedicated IPs for a sender -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::SendersApi.new - sender_id = 789 # Integer | Id of the sender - begin - #Get all the dedicated IPs for a sender + # Get all the dedicated IPs for a sender result = api_instance.get_ips_from_sender(sender_id) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SendersApi->get_ips_from_sender: #{e}" + puts "Error when calling SendersApi->get_ips_from_sender: #{e}" +end +``` + +#### Using the get_ips_from_sender_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_ips_from_sender_with_http_info(sender_id) + +```ruby +begin + # Get all the dedicated IPs for a sender + data, status_code, headers = api_instance.get_ips_from_sender_with_http_info(sender_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling SendersApi->get_ips_from_sender_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **sender_id** | **Integer**| Id of the sender | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **sender_id** | **Integer** | Id of the sender | | ### Return type @@ -229,55 +302,73 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_senders -# **get_senders** -> GetSendersList get_senders(opts) +> get_senders(opts) Get the list of all your senders -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::SendersApi.new - -opts = { +opts = { ip: 'ip_example', # String | Filter your senders for a specific ip (available for dedicated IP usage only) domain: 'domain_example' # String | Filter your senders for a specific domain } begin - #Get the list of all your senders + # Get the list of all your senders result = api_instance.get_senders(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SendersApi->get_senders: #{e}" + puts "Error when calling SendersApi->get_senders: #{e}" +end +``` + +#### Using the get_senders_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_senders_with_http_info(opts) + +```ruby +begin + # Get the list of all your senders + data, status_code, headers = api_instance.get_senders_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling SendersApi->get_senders_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ip** | **String**| Filter your senders for a specific ip (available for dedicated IP usage only) | [optional] - **domain** | **String**| Filter your senders for a specific domain | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **ip** | **String** | Filter your senders for a specific ip (available for dedicated IP usage only) | [optional] | +| **domain** | **String** | Filter your senders for a specific domain | [optional] | ### Return type @@ -289,55 +380,72 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## update_sender -# **update_sender** > update_sender(sender_id, opts) Update a sender -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::SendersApi.new - sender_id = 789 # Integer | Id of the sender - -opts = { +opts = { sender: SibApiV3Sdk::UpdateSender.new # UpdateSender | sender's name } begin - #Update a sender + # Update a sender api_instance.update_sender(sender_id, opts) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling SendersApi->update_sender: #{e}" + puts "Error when calling SendersApi->update_sender: #{e}" +end +``` + +#### Using the update_sender_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_sender_with_http_info(sender_id, opts) + +```ruby +begin + # Update a sender + data, status_code, headers = api_instance.update_sender_with_http_info(sender_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling SendersApi->update_sender_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **sender_id** | **Integer**| Id of the sender | - **sender** | [**UpdateSender**](UpdateSender.md)| sender's name | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **sender_id** | **Integer** | Id of the sender | | +| **sender** | [**UpdateSender**](UpdateSender.md) | sender's name | [optional] | ### Return type @@ -349,8 +457,6 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - - +- **Content-Type**: application/json +- **Accept**: application/json diff --git a/docs/TransactionalEmailsApi.md b/docs/TransactionalEmailsApi.md index 577a663..0832fbf 100644 --- a/docs/TransactionalEmailsApi.md +++ b/docs/TransactionalEmailsApi.md @@ -2,72 +2,90 @@ All URIs are relative to *https://api.sendinblue.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**block_new_domain**](TransactionalEmailsApi.md#block_new_domain) | **POST** /smtp/blockedDomains | Add a new domain to the list of blocked domains -[**create_smtp_template**](TransactionalEmailsApi.md#create_smtp_template) | **POST** /smtp/templates | Create an email template -[**delete_blocked_domain**](TransactionalEmailsApi.md#delete_blocked_domain) | **DELETE** /smtp/blockedDomains/{domain} | Unblock an existing domain from the list of blocked domains -[**delete_hardbounces**](TransactionalEmailsApi.md#delete_hardbounces) | **POST** /smtp/deleteHardbounces | Delete hardbounces -[**delete_smtp_template**](TransactionalEmailsApi.md#delete_smtp_template) | **DELETE** /smtp/templates/{templateId} | Delete an inactive email template -[**get_aggregated_smtp_report**](TransactionalEmailsApi.md#get_aggregated_smtp_report) | **GET** /smtp/statistics/aggregatedReport | Get your transactional email activity aggregated over a period of time -[**get_blocked_domains**](TransactionalEmailsApi.md#get_blocked_domains) | **GET** /smtp/blockedDomains | Get the list of blocked domains -[**get_email_event_report**](TransactionalEmailsApi.md#get_email_event_report) | **GET** /smtp/statistics/events | Get all your transactional email activity (unaggregated events) -[**get_smtp_report**](TransactionalEmailsApi.md#get_smtp_report) | **GET** /smtp/statistics/reports | Get your transactional email activity aggregated per day -[**get_smtp_template**](TransactionalEmailsApi.md#get_smtp_template) | **GET** /smtp/templates/{templateId} | Returns the template information -[**get_smtp_templates**](TransactionalEmailsApi.md#get_smtp_templates) | **GET** /smtp/templates | Get the list of email templates -[**get_transac_blocked_contacts**](TransactionalEmailsApi.md#get_transac_blocked_contacts) | **GET** /smtp/blockedContacts | Get the list of blocked or unsubscribed transactional contacts -[**get_transac_email_content**](TransactionalEmailsApi.md#get_transac_email_content) | **GET** /smtp/emails/{uuid} | Get the personalized content of a sent transactional email -[**get_transac_emails_list**](TransactionalEmailsApi.md#get_transac_emails_list) | **GET** /smtp/emails | Get the list of transactional emails on the basis of allowed filters -[**send_template**](TransactionalEmailsApi.md#send_template) | **POST** /smtp/templates/{templateId}/send | Send a template -[**send_test_template**](TransactionalEmailsApi.md#send_test_template) | **POST** /smtp/templates/{templateId}/sendTest | Send a template to your test list -[**send_transac_email**](TransactionalEmailsApi.md#send_transac_email) | **POST** /smtp/email | Send a transactional email -[**smtp_blocked_contacts_email_delete**](TransactionalEmailsApi.md#smtp_blocked_contacts_email_delete) | **DELETE** /smtp/blockedContacts/{email} | Unblock or resubscribe a transactional contact -[**smtp_log_message_id_delete**](TransactionalEmailsApi.md#smtp_log_message_id_delete) | **DELETE** /smtp/log/{messageId} | Delete an SMTP transactional log -[**update_smtp_template**](TransactionalEmailsApi.md#update_smtp_template) | **PUT** /smtp/templates/{templateId} | Update an email template - - -# **block_new_domain** +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**block_new_domain**](TransactionalEmailsApi.md#block_new_domain) | **POST** /smtp/blockedDomains | Add a new domain to the list of blocked domains | +| [**create_smtp_template**](TransactionalEmailsApi.md#create_smtp_template) | **POST** /smtp/templates | Create an email template | +| [**delete_blocked_domain**](TransactionalEmailsApi.md#delete_blocked_domain) | **DELETE** /smtp/blockedDomains/{domain} | Unblock an existing domain from the list of blocked domains | +| [**delete_hardbounces**](TransactionalEmailsApi.md#delete_hardbounces) | **POST** /smtp/deleteHardbounces | Delete hardbounces | +| [**delete_smtp_template**](TransactionalEmailsApi.md#delete_smtp_template) | **DELETE** /smtp/templates/{templateId} | Delete an inactive email template | +| [**get_aggregated_smtp_report**](TransactionalEmailsApi.md#get_aggregated_smtp_report) | **GET** /smtp/statistics/aggregatedReport | Get your transactional email activity aggregated over a period of time | +| [**get_blocked_domains**](TransactionalEmailsApi.md#get_blocked_domains) | **GET** /smtp/blockedDomains | Get the list of blocked domains | +| [**get_email_event_report**](TransactionalEmailsApi.md#get_email_event_report) | **GET** /smtp/statistics/events | Get all your transactional email activity (unaggregated events) | +| [**get_smtp_report**](TransactionalEmailsApi.md#get_smtp_report) | **GET** /smtp/statistics/reports | Get your transactional email activity aggregated per day | +| [**get_smtp_template**](TransactionalEmailsApi.md#get_smtp_template) | **GET** /smtp/templates/{templateId} | Returns the template information | +| [**get_smtp_templates**](TransactionalEmailsApi.md#get_smtp_templates) | **GET** /smtp/templates | Get the list of email templates | +| [**get_transac_blocked_contacts**](TransactionalEmailsApi.md#get_transac_blocked_contacts) | **GET** /smtp/blockedContacts | Get the list of blocked or unsubscribed transactional contacts | +| [**get_transac_email_content**](TransactionalEmailsApi.md#get_transac_email_content) | **GET** /smtp/emails/{uuid} | Get the personalized content of a sent transactional email | +| [**get_transac_emails_list**](TransactionalEmailsApi.md#get_transac_emails_list) | **GET** /smtp/emails | Get the list of transactional emails on the basis of allowed filters | +| [**send_template**](TransactionalEmailsApi.md#send_template) | **POST** /smtp/templates/{templateId}/send | Send a template | +| [**send_test_template**](TransactionalEmailsApi.md#send_test_template) | **POST** /smtp/templates/{templateId}/sendTest | Send a template to your test list | +| [**send_transac_email**](TransactionalEmailsApi.md#send_transac_email) | **POST** /smtp/email | Send a transactional email | +| [**smtp_blocked_contacts_email_delete**](TransactionalEmailsApi.md#smtp_blocked_contacts_email_delete) | **DELETE** /smtp/blockedContacts/{email} | Unblock or resubscribe a transactional contact | +| [**smtp_log_message_id_delete**](TransactionalEmailsApi.md#smtp_log_message_id_delete) | **DELETE** /smtp/log/{messageId} | Delete an SMTP transactional log | +| [**update_smtp_template**](TransactionalEmailsApi.md#update_smtp_template) | **PUT** /smtp/templates/{templateId} | Update an email template | + + +## block_new_domain + > block_new_domain(block_domain) Add a new domain to the list of blocked domains Blocks a new domain in order to avoid messages being sent to the same -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new +block_domain = SibApiV3Sdk::BlockDomain.new({domain: 'example.com'}) # BlockDomain | + +begin + # Add a new domain to the list of blocked domains + api_instance.block_new_domain(block_domain) +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->block_new_domain: #{e}" +end +``` -block_domain = SibApiV3Sdk::BlockDomain.new # BlockDomain | +#### Using the block_new_domain_with_http_info variant +This returns an Array which contains the response data (`nil` in this case), status code and headers. +> block_new_domain_with_http_info(block_domain) + +```ruby begin - #Add a new domain to the list of blocked domains - api_instance.block_new_domain(block_domain) + # Add a new domain to the list of blocked domains + data, status_code, headers = api_instance.block_new_domain_with_http_info(block_domain) + p status_code # => 2xx + p headers # => { ... } + p data # => nil rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->block_new_domain: #{e}" + puts "Error when calling TransactionalEmailsApi->block_new_domain_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **block_domain** | [**BlockDomain**](BlockDomain.md)| | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **block_domain** | [**BlockDomain**](BlockDomain.md) | | | ### Return type @@ -79,52 +97,69 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## create_smtp_template -# **create_smtp_template** -> CreateModel create_smtp_template(smtp_template) +> create_smtp_template(smtp_template) Create an email template -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new - -smtp_template = SibApiV3Sdk::CreateSmtpTemplate.new # CreateSmtpTemplate | values to update in transactional email template - +smtp_template = SibApiV3Sdk::CreateSmtpTemplate.new({sender: SibApiV3Sdk::CreateSmtpTemplateSender.new, template_name: 'Order Confirmation - EN', subject: 'Thanks for your purchase !'}) # CreateSmtpTemplate | values to update in transactional email template begin - #Create an email template + # Create an email template result = api_instance.create_smtp_template(smtp_template) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->create_smtp_template: #{e}" + puts "Error when calling TransactionalEmailsApi->create_smtp_template: #{e}" +end +``` + +#### Using the create_smtp_template_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_smtp_template_with_http_info(smtp_template) + +```ruby +begin + # Create an email template + data, status_code, headers = api_instance.create_smtp_template_with_http_info(smtp_template) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->create_smtp_template_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **smtp_template** | [**CreateSmtpTemplate**](CreateSmtpTemplate.md)| values to update in transactional email template | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **smtp_template** | [**CreateSmtpTemplate**](CreateSmtpTemplate.md) | values to update in transactional email template | | ### Return type @@ -136,53 +171,70 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## delete_blocked_domain -# **delete_blocked_domain** > delete_blocked_domain(domain) Unblock an existing domain from the list of blocked domains Unblocks an existing domain from the list of blocked domains -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new - domain = 'domain_example' # String | The name of the domain to be deleted - begin - #Unblock an existing domain from the list of blocked domains + # Unblock an existing domain from the list of blocked domains api_instance.delete_blocked_domain(domain) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->delete_blocked_domain: #{e}" + puts "Error when calling TransactionalEmailsApi->delete_blocked_domain: #{e}" +end +``` + +#### Using the delete_blocked_domain_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_blocked_domain_with_http_info(domain) + +```ruby +begin + # Unblock an existing domain from the list of blocked domains + data, status_code, headers = api_instance.delete_blocked_domain_with_http_info(domain) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->delete_blocked_domain_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **domain** | **String**| The name of the domain to be deleted | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **domain** | **String** | The name of the domain to be deleted | | ### Return type @@ -194,54 +246,72 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## delete_hardbounces -# **delete_hardbounces** > delete_hardbounces(opts) Delete hardbounces Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new - -opts = { +opts = { delete_hardbounces: SibApiV3Sdk::DeleteHardbounces.new # DeleteHardbounces | values to delete hardbounces } begin - #Delete hardbounces + # Delete hardbounces api_instance.delete_hardbounces(opts) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->delete_hardbounces: #{e}" + puts "Error when calling TransactionalEmailsApi->delete_hardbounces: #{e}" +end +``` + +#### Using the delete_hardbounces_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_hardbounces_with_http_info(opts) + +```ruby +begin + # Delete hardbounces + data, status_code, headers = api_instance.delete_hardbounces_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->delete_hardbounces_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **delete_hardbounces** | [**DeleteHardbounces**](DeleteHardbounces.md)| values to delete hardbounces | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **delete_hardbounces** | [**DeleteHardbounces**](DeleteHardbounces.md) | values to delete hardbounces | [optional] | ### Return type @@ -253,51 +323,68 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## delete_smtp_template -# **delete_smtp_template** > delete_smtp_template(template_id) Delete an inactive email template -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new - template_id = 789 # Integer | id of the template - begin - #Delete an inactive email template + # Delete an inactive email template api_instance.delete_smtp_template(template_id) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->delete_smtp_template: #{e}" + puts "Error when calling TransactionalEmailsApi->delete_smtp_template: #{e}" +end +``` + +#### Using the delete_smtp_template_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_smtp_template_with_http_info(template_id) + +```ruby +begin + # Delete an inactive email template + data, status_code, headers = api_instance.delete_smtp_template_with_http_info(template_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->delete_smtp_template_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **template_id** | **Integer**| id of the template | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **template_id** | **Integer** | id of the template | | ### Return type @@ -309,36 +396,36 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_aggregated_smtp_report -# **get_aggregated_smtp_report** -> GetAggregatedReport get_aggregated_smtp_report(opts) +> get_aggregated_smtp_report(opts) Get your transactional email activity aggregated over a period of time -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new - -opts = { +opts = { start_date: 'start_date_example', # String | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate end_date: 'end_date_example', # String | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate days: 789, # Integer | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' @@ -346,22 +433,40 @@ opts = { } begin - #Get your transactional email activity aggregated over a period of time + # Get your transactional email activity aggregated over a period of time result = api_instance.get_aggregated_smtp_report(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->get_aggregated_smtp_report: #{e}" + puts "Error when calling TransactionalEmailsApi->get_aggregated_smtp_report: #{e}" +end +``` + +#### Using the get_aggregated_smtp_report_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_aggregated_smtp_report_with_http_info(opts) + +```ruby +begin + # Get your transactional email activity aggregated over a period of time + data, status_code, headers = api_instance.get_aggregated_smtp_report_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->get_aggregated_smtp_report_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **String**| Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate | [optional] - **end_date** | **String**| Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional] - **days** | **Integer**| Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional] - **tag** | **String**| Tag of the emails | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **start_date** | **String** | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate | [optional] | +| **end_date** | **String** | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional] | +| **days** | **Integer** | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional] | +| **tag** | **String** | Tag of the emails | [optional] | ### Return type @@ -373,47 +478,67 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_blocked_domains -# **get_blocked_domains** -> GetBlockedDomains get_blocked_domains +> get_blocked_domains Get the list of blocked domains Get the list of blocked domains -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new begin - #Get the list of blocked domains + # Get the list of blocked domains result = api_instance.get_blocked_domains p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->get_blocked_domains: #{e}" + puts "Error when calling TransactionalEmailsApi->get_blocked_domains: #{e}" +end +``` + +#### Using the get_blocked_domains_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_blocked_domains_with_http_info + +```ruby +begin + # Get the list of blocked domains + data, status_code, headers = api_instance.get_blocked_domains_with_http_info + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->get_blocked_domains_with_http_info: #{e}" end ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -426,73 +551,91 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_email_event_report -# **get_email_event_report** -> GetEmailEventReport get_email_event_report(opts) +> get_email_event_report(opts) Get all your transactional email activity (unaggregated events) -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new - -opts = { - limit: 50, # Integer | Number limitation for the result returned - offset: 0, # Integer | Beginning point in the list to retrieve from. +opts = { + limit: 789, # Integer | Number limitation for the result returned + offset: 789, # Integer | Beginning point in the list to retrieve from. start_date: 'start_date_example', # String | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate end_date: 'end_date_example', # String | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate days: 789, # Integer | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' - email: 'email_example', # String | Filter the report for a specific email addresses - event: 'event_example', # String | Filter the report for a specific event type + email: TODO, # String | Filter the report for a specific email addresses + event: 'bounces', # String | Filter the report for a specific event type tags: 'tags_example', # String | Filter the report for tags (serialized and urlencoded array) message_id: 'message_id_example', # String | Filter on a specific message id template_id: 789, # Integer | Filter on a specific template id - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Get all your transactional email activity (unaggregated events) + # Get all your transactional email activity (unaggregated events) result = api_instance.get_email_event_report(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->get_email_event_report: #{e}" + puts "Error when calling TransactionalEmailsApi->get_email_event_report: #{e}" +end +``` + +#### Using the get_email_event_report_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_email_event_report_with_http_info(opts) + +```ruby +begin + # Get all your transactional email activity (unaggregated events) + data, status_code, headers = api_instance.get_email_event_report_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->get_email_event_report_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **limit** | **Integer**| Number limitation for the result returned | [optional] [default to 50] - **offset** | **Integer**| Beginning point in the list to retrieve from. | [optional] [default to 0] - **start_date** | **String**| Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate | [optional] - **end_date** | **String**| Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional] - **days** | **Integer**| Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional] - **email** | **String**| Filter the report for a specific email addresses | [optional] - **event** | **String**| Filter the report for a specific event type | [optional] - **tags** | **String**| Filter the report for tags (serialized and urlencoded array) | [optional] - **message_id** | **String**| Filter on a specific message id | [optional] - **template_id** | **Integer**| Filter on a specific template id | [optional] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **limit** | **Integer** | Number limitation for the result returned | [optional][default to 50] | +| **offset** | **Integer** | Beginning point in the list to retrieve from. | [optional][default to 0] | +| **start_date** | **String** | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate | [optional] | +| **end_date** | **String** | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate | [optional] | +| **days** | **Integer** | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional] | +| **email** | [**String**](.md) | Filter the report for a specific email addresses | [optional] | +| **event** | **String** | Filter the report for a specific event type | [optional] | +| **tags** | **String** | Filter the report for tags (serialized and urlencoded array) | [optional] | +| **message_id** | **String** | Filter on a specific message id | [optional] | +| **template_id** | **Integer** | Filter on a specific template id | [optional] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -504,65 +647,83 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_smtp_report -# **get_smtp_report** -> GetReports get_smtp_report(opts) +> get_smtp_report(opts) Get your transactional email activity aggregated per day -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new - -opts = { - limit: 10, # Integer | Number of documents returned per page - offset: 0, # Integer | Index of the first document on the page +opts = { + limit: 789, # Integer | Number of documents returned per page + offset: 789, # Integer | Index of the first document on the page start_date: 'start_date_example', # String | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) end_date: 'end_date_example', # String | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) days: 789, # Integer | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' tag: 'tag_example', # String | Tag of the emails - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Get your transactional email activity aggregated per day + # Get your transactional email activity aggregated per day result = api_instance.get_smtp_report(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->get_smtp_report: #{e}" + puts "Error when calling TransactionalEmailsApi->get_smtp_report: #{e}" +end +``` + +#### Using the get_smtp_report_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_smtp_report_with_http_info(opts) + +```ruby +begin + # Get your transactional email activity aggregated per day + data, status_code, headers = api_instance.get_smtp_report_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->get_smtp_report_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **limit** | **Integer**| Number of documents returned per page | [optional] [default to 10] - **offset** | **Integer**| Index of the first document on the page | [optional] [default to 0] - **start_date** | **String**| Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) | [optional] - **end_date** | **String**| Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) | [optional] - **days** | **Integer**| Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional] - **tag** | **String**| Tag of the emails | [optional] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **limit** | **Integer** | Number of documents returned per page | [optional][default to 10] | +| **offset** | **Integer** | Index of the first document on the page | [optional][default to 0] | +| **start_date** | **String** | Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD) | [optional] | +| **end_date** | **String** | Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) | [optional] | +| **days** | **Integer** | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional] | +| **tag** | **String** | Tag of the emails | [optional] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -574,52 +735,69 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_smtp_template -# **get_smtp_template** -> GetSmtpTemplateOverview get_smtp_template(template_id) +> get_smtp_template(template_id) Returns the template information -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new - template_id = 789 # Integer | id of the template - begin - #Returns the template information + # Returns the template information result = api_instance.get_smtp_template(template_id) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->get_smtp_template: #{e}" + puts "Error when calling TransactionalEmailsApi->get_smtp_template: #{e}" +end +``` + +#### Using the get_smtp_template_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_smtp_template_with_http_info(template_id) + +```ruby +begin + # Returns the template information + data, status_code, headers = api_instance.get_smtp_template_with_http_info(template_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->get_smtp_template_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **template_id** | **Integer**| id of the template | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **template_id** | **Integer** | id of the template | | ### Return type @@ -631,59 +809,77 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_smtp_templates -# **get_smtp_templates** -> GetSmtpTemplates get_smtp_templates(opts) +> get_smtp_templates(opts) Get the list of email templates -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new - -opts = { - template_status: true, # BOOLEAN | Filter on the status of the template. Active = true, inactive = false - limit: 50, # Integer | Number of documents returned per page - offset: 0, # Integer | Index of the first document in the page - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed +opts = { + template_status: true, # Boolean | Filter on the status of the template. Active = true, inactive = false + limit: 789, # Integer | Number of documents returned per page + offset: 789, # Integer | Index of the first document in the page + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Get the list of email templates + # Get the list of email templates result = api_instance.get_smtp_templates(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->get_smtp_templates: #{e}" + puts "Error when calling TransactionalEmailsApi->get_smtp_templates: #{e}" +end +``` + +#### Using the get_smtp_templates_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_smtp_templates_with_http_info(opts) + +```ruby +begin + # Get the list of email templates + data, status_code, headers = api_instance.get_smtp_templates_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->get_smtp_templates_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **template_status** | **BOOLEAN**| Filter on the status of the template. Active = true, inactive = false | [optional] - **limit** | **Integer**| Number of documents returned per page | [optional] [default to 50] - **offset** | **Integer**| Index of the first document in the page | [optional] [default to 0] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **template_status** | **Boolean** | Filter on the status of the template. Active = true, inactive = false | [optional] | +| **limit** | **Integer** | Number of documents returned per page | [optional][default to 50] | +| **offset** | **Integer** | Index of the first document in the page | [optional][default to 0] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -695,63 +891,81 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_transac_blocked_contacts -# **get_transac_blocked_contacts** -> GetTransacBlockedContacts get_transac_blocked_contacts(opts) +> get_transac_blocked_contacts(opts) Get the list of blocked or unsubscribed transactional contacts -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new - -opts = { +opts = { start_date: 'start_date_example', # String | Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts end_date: 'end_date_example', # String | Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts - limit: 50, # Integer | Number of documents returned per page - offset: 0, # Integer | Index of the first document on the page - senders: ['senders_example'], # Array | Comma separated list of emails of the senders from which contacts are blocked or unsubscribed - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + limit: 789, # Integer | Number of documents returned per page + offset: 789, # Integer | Index of the first document on the page + senders: ['inner_example'], # Array | Comma separated list of emails of the senders from which contacts are blocked or unsubscribed + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Get the list of blocked or unsubscribed transactional contacts + # Get the list of blocked or unsubscribed transactional contacts result = api_instance.get_transac_blocked_contacts(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->get_transac_blocked_contacts: #{e}" + puts "Error when calling TransactionalEmailsApi->get_transac_blocked_contacts: #{e}" +end +``` + +#### Using the get_transac_blocked_contacts_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_transac_blocked_contacts_with_http_info(opts) + +```ruby +begin + # Get the list of blocked or unsubscribed transactional contacts + data, status_code, headers = api_instance.get_transac_blocked_contacts_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->get_transac_blocked_contacts_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **String**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts | [optional] - **end_date** | **String**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts | [optional] - **limit** | **Integer**| Number of documents returned per page | [optional] [default to 50] - **offset** | **Integer**| Index of the first document on the page | [optional] [default to 0] - **senders** | [**Array<String>**](String.md)| Comma separated list of emails of the senders from which contacts are blocked or unsubscribed | [optional] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **start_date** | **String** | Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts | [optional] | +| **end_date** | **String** | Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts | [optional] | +| **limit** | **Integer** | Number of documents returned per page | [optional][default to 50] | +| **offset** | **Integer** | Index of the first document on the page | [optional][default to 0] | +| **senders** | [**Array<String>**](String.md) | Comma separated list of emails of the senders from which contacts are blocked or unsubscribed | [optional] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -763,52 +977,69 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_transac_email_content -# **get_transac_email_content** -> GetTransacEmailContent get_transac_email_content(uuid) +> get_transac_email_content(uuid) Get the personalized content of a sent transactional email -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new - uuid = 'uuid_example' # String | Unique id of the transactional email that has been sent to a particular contact - begin - #Get the personalized content of a sent transactional email + # Get the personalized content of a sent transactional email result = api_instance.get_transac_email_content(uuid) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->get_transac_email_content: #{e}" + puts "Error when calling TransactionalEmailsApi->get_transac_email_content: #{e}" +end +``` + +#### Using the get_transac_email_content_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_transac_email_content_with_http_info(uuid) + +```ruby +begin + # Get the personalized content of a sent transactional email + data, status_code, headers = api_instance.get_transac_email_content_with_http_info(uuid) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->get_transac_email_content_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **uuid** | **String**| Unique id of the transactional email that has been sent to a particular contact | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **uuid** | **String** | Unique id of the transactional email that has been sent to a particular contact | | ### Return type @@ -820,65 +1051,87 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_transac_emails_list -# **get_transac_emails_list** -> GetTransacEmailsList get_transac_emails_list(opts) +> get_transac_emails_list(opts) Get the list of transactional emails on the basis of allowed filters This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new - -opts = { +opts = { email: 'email_example', # String | Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. template_id: 789, # Integer | Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. message_id: 'message_id_example', # String | Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. - start_date: Date.parse('2013-10-20'), # 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. - end_date: Date.parse('2013-10-20'), # 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. - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + start_date: 'start_date_example', # String | 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. + end_date: 'end_date_example', # String | 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. + sort: 'asc', # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + limit: 789, # Integer | Number of documents returned per page + offset: 789 # Integer | Index of the first document in the page } begin - #Get the list of transactional emails on the basis of allowed filters + # Get the list of transactional emails on the basis of allowed filters result = api_instance.get_transac_emails_list(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->get_transac_emails_list: #{e}" + puts "Error when calling TransactionalEmailsApi->get_transac_emails_list: #{e}" +end +``` + +#### Using the get_transac_emails_list_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_transac_emails_list_with_http_info(opts) + +```ruby +begin + # Get the list of transactional emails on the basis of allowed filters + data, status_code, headers = api_instance.get_transac_emails_list_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->get_transac_emails_list_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **email** | **String**| Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. | [optional] - **template_id** | **Integer**| Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. | [optional] - **message_id** | **String**| Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. | [optional] - **start_date** | **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. | [optional] - **end_date** | **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. | [optional] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. | [optional] | +| **template_id** | **Integer** | Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email. | [optional] | +| **message_id** | **String** | Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. | [optional] | +| **start_date** | **String** | 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. | [optional] | +| **end_date** | **String** | 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. | [optional] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | +| **limit** | **Integer** | Number of documents returned per page | [optional][default to 500] | +| **offset** | **Integer** | Index of the first document in the page | [optional][default to 0] | ### Return type @@ -890,57 +1143,73 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## send_template -# **send_template** -> SendTemplateEmail send_template(template_id, send_email) +> send_template(template_id, send_email) Send a template This endpoint is deprecated. Prefer v3/smtp/email instead. -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new - template_id = 789 # Integer | Id of the template - -send_email = SibApiV3Sdk::SendEmail.new # SendEmail | - +send_email = SibApiV3Sdk::SendEmail.new({email_to: ['john.smith@example.com']}) # SendEmail | begin - #Send a template + # Send a template result = api_instance.send_template(template_id, send_email) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->send_template: #{e}" + puts "Error when calling TransactionalEmailsApi->send_template: #{e}" +end +``` + +#### Using the send_template_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> send_template_with_http_info(template_id, send_email) + +```ruby +begin + # Send a template + data, status_code, headers = api_instance.send_template_with_http_info(template_id, send_email) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->send_template_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **template_id** | **Integer**| Id of the template | - **send_email** | [**SendEmail**](SendEmail.md)| | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **template_id** | **Integer** | Id of the template | | +| **send_email** | [**SendEmail**](SendEmail.md) | | | ### Return type @@ -952,54 +1221,70 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## send_test_template -# **send_test_template** > send_test_template(template_id, send_test_email) Send a template to your test list -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new - template_id = 789 # Integer | Id of the template - send_test_email = SibApiV3Sdk::SendTestEmail.new # SendTestEmail | - begin - #Send a template to your test list + # Send a template to your test list api_instance.send_test_template(template_id, send_test_email) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->send_test_template: #{e}" + puts "Error when calling TransactionalEmailsApi->send_test_template: #{e}" +end +``` + +#### Using the send_test_template_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> send_test_template_with_http_info(template_id, send_test_email) + +```ruby +begin + # Send a template to your test list + data, status_code, headers = api_instance.send_test_template_with_http_info(template_id, send_test_email) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->send_test_template_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **template_id** | **Integer**| Id of the template | - **send_test_email** | [**SendTestEmail**](SendTestEmail.md)| | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **template_id** | **Integer** | Id of the template | | +| **send_test_email** | [**SendTestEmail**](SendTestEmail.md) | | | ### Return type @@ -1011,52 +1296,69 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## send_transac_email -# **send_transac_email** -> CreateSmtpEmail send_transac_email(send_smtp_email) +> send_transac_email(send_smtp_email) Send a transactional email -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new - send_smtp_email = SibApiV3Sdk::SendSmtpEmail.new # SendSmtpEmail | Values to send a transactional email - begin - #Send a transactional email + # Send a transactional email result = api_instance.send_transac_email(send_smtp_email) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->send_transac_email: #{e}" + puts "Error when calling TransactionalEmailsApi->send_transac_email: #{e}" +end +``` + +#### Using the send_transac_email_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> send_transac_email_with_http_info(send_smtp_email) + +```ruby +begin + # Send a transactional email + data, status_code, headers = api_instance.send_transac_email_with_http_info(send_smtp_email) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->send_transac_email_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **send_smtp_email** | [**SendSmtpEmail**](SendSmtpEmail.md)| Values to send a transactional email | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **send_smtp_email** | [**SendSmtpEmail**](SendSmtpEmail.md) | Values to send a transactional email | | ### Return type @@ -1068,51 +1370,68 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## smtp_blocked_contacts_email_delete -# **smtp_blocked_contacts_email_delete** > smtp_blocked_contacts_email_delete(email) Unblock or resubscribe a transactional contact -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new - email = 'email_example' # String | contact email (urlencoded) to unblock. - begin - #Unblock or resubscribe a transactional contact + # Unblock or resubscribe a transactional contact api_instance.smtp_blocked_contacts_email_delete(email) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->smtp_blocked_contacts_email_delete: #{e}" + puts "Error when calling TransactionalEmailsApi->smtp_blocked_contacts_email_delete: #{e}" +end +``` + +#### Using the smtp_blocked_contacts_email_delete_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> smtp_blocked_contacts_email_delete_with_http_info(email) + +```ruby +begin + # Unblock or resubscribe a transactional contact + data, status_code, headers = api_instance.smtp_blocked_contacts_email_delete_with_http_info(email) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->smtp_blocked_contacts_email_delete_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **email** | **String**| contact email (urlencoded) to unblock. | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | contact email (urlencoded) to unblock. | | ### Return type @@ -1124,51 +1443,68 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## smtp_log_message_id_delete -# **smtp_log_message_id_delete** > smtp_log_message_id_delete(message_id) Delete an SMTP transactional log -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new - message_id = 'message_id_example' # String | MessageId of the transactional log to delete - begin - #Delete an SMTP transactional log + # Delete an SMTP transactional log api_instance.smtp_log_message_id_delete(message_id) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->smtp_log_message_id_delete: #{e}" + puts "Error when calling TransactionalEmailsApi->smtp_log_message_id_delete: #{e}" +end +``` + +#### Using the smtp_log_message_id_delete_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> smtp_log_message_id_delete_with_http_info(message_id) + +```ruby +begin + # Delete an SMTP transactional log + data, status_code, headers = api_instance.smtp_log_message_id_delete_with_http_info(message_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->smtp_log_message_id_delete_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **message_id** | **String**| MessageId of the transactional log to delete | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **message_id** | **String** | MessageId of the transactional log to delete | | ### Return type @@ -1180,54 +1516,70 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## update_smtp_template -# **update_smtp_template** > update_smtp_template(template_id, smtp_template) Update an email template -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalEmailsApi.new - template_id = 789 # Integer | id of the template - smtp_template = SibApiV3Sdk::UpdateSmtpTemplate.new # UpdateSmtpTemplate | values to update in transactional email template - begin - #Update an email template + # Update an email template api_instance.update_smtp_template(template_id, smtp_template) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalEmailsApi->update_smtp_template: #{e}" + puts "Error when calling TransactionalEmailsApi->update_smtp_template: #{e}" +end +``` + +#### Using the update_smtp_template_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_smtp_template_with_http_info(template_id, smtp_template) + +```ruby +begin + # Update an email template + data, status_code, headers = api_instance.update_smtp_template_with_http_info(template_id, smtp_template) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalEmailsApi->update_smtp_template_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **template_id** | **Integer**| id of the template | - **smtp_template** | [**UpdateSmtpTemplate**](UpdateSmtpTemplate.md)| values to update in transactional email template | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **template_id** | **Integer** | id of the template | | +| **smtp_template** | [**UpdateSmtpTemplate**](UpdateSmtpTemplate.md) | values to update in transactional email template | | ### Return type @@ -1239,8 +1591,6 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - - +- **Content-Type**: application/json +- **Accept**: application/json diff --git a/docs/TransactionalSMSApi.md b/docs/TransactionalSMSApi.md index e2afe00..185e69f 100644 --- a/docs/TransactionalSMSApi.md +++ b/docs/TransactionalSMSApi.md @@ -2,72 +2,91 @@ All URIs are relative to *https://api.sendinblue.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_sms_events**](TransactionalSMSApi.md#get_sms_events) | **GET** /transactionalSMS/statistics/events | Get all your SMS activity (unaggregated events) -[**get_transac_aggregated_sms_report**](TransactionalSMSApi.md#get_transac_aggregated_sms_report) | **GET** /transactionalSMS/statistics/aggregatedReport | Get your SMS activity aggregated over a period of time -[**get_transac_sms_report**](TransactionalSMSApi.md#get_transac_sms_report) | **GET** /transactionalSMS/statistics/reports | Get your SMS activity aggregated per day -[**send_transac_sms**](TransactionalSMSApi.md#send_transac_sms) | **POST** /transactionalSMS/sms | Send SMS message to a mobile number +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**get_sms_events**](TransactionalSMSApi.md#get_sms_events) | **GET** /transactionalSMS/statistics/events | Get all your SMS activity (unaggregated events) | +| [**get_transac_aggregated_sms_report**](TransactionalSMSApi.md#get_transac_aggregated_sms_report) | **GET** /transactionalSMS/statistics/aggregatedReport | Get your SMS activity aggregated over a period of time | +| [**get_transac_sms_report**](TransactionalSMSApi.md#get_transac_sms_report) | **GET** /transactionalSMS/statistics/reports | Get your SMS activity aggregated per day | +| [**send_transac_sms**](TransactionalSMSApi.md#send_transac_sms) | **POST** /transactionalSMS/sms | Send SMS message to a mobile number | -# **get_sms_events** -> GetSmsEventReport get_sms_events(opts) +## get_sms_events + +> get_sms_events(opts) Get all your SMS activity (unaggregated events) -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalSMSApi.new - -opts = { - limit: 50, # Integer | Number of documents per page +opts = { + limit: 789, # Integer | Number of documents per page start_date: 'start_date_example', # String | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report end_date: 'end_date_example', # String | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report - offset: 0, # Integer | Index of the first document of the page + offset: 789, # Integer | Index of the first document of the page days: 789, # Integer | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' phone_number: 'phone_number_example', # String | Filter the report for a specific phone number - event: 'event_example', # String | Filter the report for specific events + event: 'bounces', # String | Filter the report for specific events tags: 'tags_example', # String | Filter the report for specific tags passed as a serialized urlencoded array - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Get all your SMS activity (unaggregated events) + # Get all your SMS activity (unaggregated events) result = api_instance.get_sms_events(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalSMSApi->get_sms_events: #{e}" + puts "Error when calling TransactionalSMSApi->get_sms_events: #{e}" +end +``` + +#### Using the get_sms_events_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_sms_events_with_http_info(opts) + +```ruby +begin + # Get all your SMS activity (unaggregated events) + data, status_code, headers = api_instance.get_sms_events_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalSMSApi->get_sms_events_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **limit** | **Integer**| Number of documents per page | [optional] [default to 50] - **start_date** | **String**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report | [optional] - **end_date** | **String**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report | [optional] - **offset** | **Integer**| Index of the first document of the page | [optional] [default to 0] - **days** | **Integer**| Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional] - **phone_number** | **String**| Filter the report for a specific phone number | [optional] - **event** | **String**| Filter the report for specific events | [optional] - **tags** | **String**| Filter the report for specific tags passed as a serialized urlencoded array | [optional] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **limit** | **Integer** | Number of documents per page | [optional][default to 50] | +| **start_date** | **String** | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report | [optional] | +| **end_date** | **String** | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report | [optional] | +| **offset** | **Integer** | Index of the first document of the page | [optional][default to 0] | +| **days** | **Integer** | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional] | +| **phone_number** | **String** | Filter the report for a specific phone number | [optional] | +| **event** | **String** | Filter the report for specific events | [optional] | +| **tags** | **String** | Filter the report for specific tags passed as a serialized urlencoded array | [optional] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -79,36 +98,36 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_transac_aggregated_sms_report -# **get_transac_aggregated_sms_report** -> GetTransacAggregatedSmsReport get_transac_aggregated_sms_report(opts) +> get_transac_aggregated_sms_report(opts) Get your SMS activity aggregated over a period of time -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalSMSApi.new - -opts = { +opts = { start_date: 'start_date_example', # String | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report end_date: 'end_date_example', # String | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report days: 789, # Integer | Number of days in the past including today (positive integer). Not compatible with startDate and endDate @@ -116,22 +135,40 @@ opts = { } begin - #Get your SMS activity aggregated over a period of time + # Get your SMS activity aggregated over a period of time result = api_instance.get_transac_aggregated_sms_report(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalSMSApi->get_transac_aggregated_sms_report: #{e}" + puts "Error when calling TransactionalSMSApi->get_transac_aggregated_sms_report: #{e}" +end +``` + +#### Using the get_transac_aggregated_sms_report_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_transac_aggregated_sms_report_with_http_info(opts) + +```ruby +begin + # Get your SMS activity aggregated over a period of time + data, status_code, headers = api_instance.get_transac_aggregated_sms_report_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalSMSApi->get_transac_aggregated_sms_report_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **String**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report | [optional] - **end_date** | **String**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report | [optional] - **days** | **Integer**| Number of days in the past including today (positive integer). Not compatible with startDate and endDate | [optional] - **tag** | **String**| Filter on a tag | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **start_date** | **String** | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report | [optional] | +| **end_date** | **String** | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report | [optional] | +| **days** | **Integer** | Number of days in the past including today (positive integer). Not compatible with startDate and endDate | [optional] | +| **tag** | **String** | Filter on a tag | [optional] | ### Return type @@ -143,61 +180,79 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_transac_sms_report -# **get_transac_sms_report** -> GetTransacSmsReport get_transac_sms_report(opts) +> get_transac_sms_report(opts) Get your SMS activity aggregated per day -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalSMSApi.new - -opts = { +opts = { start_date: 'start_date_example', # String | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report end_date: 'end_date_example', # String | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report days: 789, # Integer | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' tag: 'tag_example', # String | Filter on a tag - sort: 'desc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + sort: 'asc' # String | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed } begin - #Get your SMS activity aggregated per day + # Get your SMS activity aggregated per day result = api_instance.get_transac_sms_report(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalSMSApi->get_transac_sms_report: #{e}" + puts "Error when calling TransactionalSMSApi->get_transac_sms_report: #{e}" +end +``` + +#### Using the get_transac_sms_report_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_transac_sms_report_with_http_info(opts) + +```ruby +begin + # Get your SMS activity aggregated per day + data, status_code, headers = api_instance.get_transac_sms_report_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalSMSApi->get_transac_sms_report_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **start_date** | **String**| Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report | [optional] - **end_date** | **String**| Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report | [optional] - **days** | **Integer**| Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional] - **tag** | **String**| Filter on a tag | [optional] - **sort** | **String**| Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional] [default to desc] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **start_date** | **String** | Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report | [optional] | +| **end_date** | **String** | Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report | [optional] | +| **days** | **Integer** | Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' | [optional] | +| **tag** | **String** | Filter on a tag | [optional] | +| **sort** | **String** | Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed | [optional][default to 'desc'] | ### Return type @@ -209,52 +264,69 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## send_transac_sms -# **send_transac_sms** -> SendSms send_transac_sms(send_transac_sms) +> send_transac_sms(send_transac_sms) Send SMS message to a mobile number -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::TransactionalSMSApi.new - -send_transac_sms = SibApiV3Sdk::SendTransacSms.new # SendTransacSms | Values to send a transactional SMS - +send_transac_sms = SibApiV3Sdk::SendTransacSms.new({sender: 'MyShop', recipient: '33689965433', content: 'Enter this code:CCJJG8 to validate your account'}) # SendTransacSms | Values to send a transactional SMS begin - #Send SMS message to a mobile number + # Send SMS message to a mobile number result = api_instance.send_transac_sms(send_transac_sms) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling TransactionalSMSApi->send_transac_sms: #{e}" + puts "Error when calling TransactionalSMSApi->send_transac_sms: #{e}" +end +``` + +#### Using the send_transac_sms_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> send_transac_sms_with_http_info(send_transac_sms) + +```ruby +begin + # Send SMS message to a mobile number + data, status_code, headers = api_instance.send_transac_sms_with_http_info(send_transac_sms) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling TransactionalSMSApi->send_transac_sms_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **send_transac_sms** | [**SendTransacSms**](SendTransacSms.md)| Values to send a transactional SMS | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **send_transac_sms** | [**SendTransacSms**](SendTransacSms.md) | Values to send a transactional SMS | | ### Return type @@ -266,8 +338,6 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - - +- **Content-Type**: application/json +- **Accept**: application/json diff --git a/docs/UpdateAttribute.md b/docs/UpdateAttribute.md index 19ed020..53f646a 100644 --- a/docs/UpdateAttribute.md +++ b/docs/UpdateAttribute.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::UpdateAttribute ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **String** | Value of the attribute to update. Use only if the attribute's category is 'calculated' or 'global' | [optional] -**enumeration** | [**Array<UpdateAttributeEnumeration>**](UpdateAttributeEnumeration.md) | List of the 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\"}] | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **value** | **String** | Value of the attribute to update. Use only if the attribute's category is 'calculated' or 'global' | [optional] | +| **enumeration** | [**Array<UpdateAttributeEnumeration>**](UpdateAttributeEnumeration.md) | List of the 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\"}] | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::UpdateAttribute.new( + value: COUNT[BLACKLISTED,BLACKLISTED,<,NOW()], + enumeration: null +) +``` diff --git a/docs/UpdateAttributeEnumeration.md b/docs/UpdateAttributeEnumeration.md index 88a590d..50288e8 100644 --- a/docs/UpdateAttributeEnumeration.md +++ b/docs/UpdateAttributeEnumeration.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::UpdateAttributeEnumeration ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **Integer** | Id of the value | -**label** | **String** | Label of the value | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **value** | **Integer** | Id of the value | | +| **label** | **String** | Label of the value | | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::UpdateAttributeEnumeration.new( + value: 1, + label: Men +) +``` diff --git a/docs/UpdateCampaignStatus.md b/docs/UpdateCampaignStatus.md index 2b8be12..d1cf0a8 100644 --- a/docs/UpdateCampaignStatus.md +++ b/docs/UpdateCampaignStatus.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::UpdateCampaignStatus ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **String** | Note:- replicateTemplate status will be available only for template type campaigns. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **status** | **String** | Note:- replicateTemplate status will be available only for template type campaigns. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::UpdateCampaignStatus.new( + status: null +) +``` diff --git a/docs/UpdateChild.md b/docs/UpdateChild.md index 52b6ad9..2f03878 100644 --- a/docs/UpdateChild.md +++ b/docs/UpdateChild.md @@ -1,12 +1,26 @@ # SibApiV3Sdk::UpdateChild ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **String** | New Email address to update the child account | [optional] -**first_name** | **String** | New First name to use to update the child account | [optional] -**last_name** | **String** | New Last name to use to update the child account | [optional] -**company_name** | **String** | New Company name to use to update the child account | [optional] -**password** | **String** | New password for the child account to login | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **email** | **String** | New Email address to update the child account | [optional] | +| **first_name** | **String** | New First name to use to update the child account | [optional] | +| **last_name** | **String** | New Last name to use to update the child account | [optional] | +| **company_name** | **String** | New Company name to use to update the child account | [optional] | +| **password** | **String** | New password for the child account to login | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::UpdateChild.new( + email: josh.cruise@example.com, + first_name: Josh, + last_name: Cruise, + company_name: Your Company, + password: Pa55w0rd65 +) +``` diff --git a/docs/UpdateChildAccountStatus.md b/docs/UpdateChildAccountStatus.md index 3aa9dea..c3a20c1 100644 --- a/docs/UpdateChildAccountStatus.md +++ b/docs/UpdateChildAccountStatus.md @@ -1,11 +1,24 @@ # SibApiV3Sdk::UpdateChildAccountStatus ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**transactional_email** | **BOOLEAN** | Status of Transactional Email Platform activation for your account (true=enabled, false=disabled) | [optional] -**transactional_sms** | **BOOLEAN** | Status of Transactional SMS Platform activation for your account (true=enabled, false=disabled) | [optional] -**marketing_automation** | **BOOLEAN** | Status of Marketing Automation Platform activation for your account (true=enabled, false=disabled) | [optional] -**sms_campaign** | **BOOLEAN** | Status of SMS Campaign Platform activation for your account (true=enabled, false=disabled) | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **transactional_email** | **Boolean** | Status of Transactional Email Platform activation for your account (true=enabled, false=disabled) | [optional] | +| **transactional_sms** | **Boolean** | Status of Transactional SMS Platform activation for your account (true=enabled, false=disabled) | [optional] | +| **marketing_automation** | **Boolean** | Status of Marketing Automation Platform activation for your account (true=enabled, false=disabled) | [optional] | +| **sms_campaign** | **Boolean** | Status of SMS Campaign Platform activation for your account (true=enabled, false=disabled) | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::UpdateChildAccountStatus.new( + transactional_email: false, + transactional_sms: false, + marketing_automation: true, + sms_campaign: true +) +``` diff --git a/docs/UpdateChildDomain.md b/docs/UpdateChildDomain.md index 9cbd0e8..d6275b5 100644 --- a/docs/UpdateChildDomain.md +++ b/docs/UpdateChildDomain.md @@ -1,8 +1,18 @@ # SibApiV3Sdk::UpdateChildDomain ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**domain** | **String** | Value for the sender domain that will replace the existing domain | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **domain** | **String** | Value for the sender domain that will replace the existing domain | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::UpdateChildDomain.new( + domain: myupdateddomain.com +) +``` diff --git a/docs/UpdateContact.md b/docs/UpdateContact.md index 971bd55..6bd74f5 100644 --- a/docs/UpdateContact.md +++ b/docs/UpdateContact.md @@ -1,13 +1,28 @@ # SibApiV3Sdk::UpdateContact ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attributes** | **Object** | Pass the set of attributes to be updated. These attributes must be present in your account. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For example, `{ \"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}`. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in \"SMS\" field should be passed with proper country code. For example {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"} | [optional] -**email_blacklisted** | **BOOLEAN** | Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) | [optional] -**sms_blacklisted** | **BOOLEAN** | Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) | [optional] -**list_ids** | **Array<Integer>** | Ids of the lists to add the contact to | [optional] -**unlink_list_ids** | **Array<Integer>** | Ids of the lists to remove the contact from | [optional] -**smtp_blacklist_sender** | **Array<String>** | transactional email forbidden sender for contact. Use only for email Contact | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **attributes** | **Object** | Pass the set of attributes to be updated. These attributes must be present in your account. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For example, `{ \"EMAIL\":\"newemail@domain.com\", \"FNAME\":\"Ellie\", \"LNAME\":\"Roger\"}`. Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in \"SMS\" field should be passed with proper country code. For example {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"} | [optional] | +| **email_blacklisted** | **Boolean** | Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true) | [optional] | +| **sms_blacklisted** | **Boolean** | Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true) | [optional] | +| **list_ids** | **Array<Integer>** | Ids of the lists to add the contact to | [optional] | +| **unlink_list_ids** | **Array<Integer>** | Ids of the lists to remove the contact from | [optional] | +| **smtp_blacklist_sender** | **Array<String>** | transactional email forbidden sender for contact. Use only for email Contact | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::UpdateContact.new( + attributes: {"EMAIL":"newemail@domain.com","FNAME":"Ellie","LNAME":"Roger"}, + email_blacklisted: false, + sms_blacklisted: true, + list_ids: null, + unlink_list_ids: null, + smtp_blacklist_sender: null +) +``` diff --git a/docs/UpdateEmailCampaign.md b/docs/UpdateEmailCampaign.md index 80e88ba..5f6408c 100644 --- a/docs/UpdateEmailCampaign.md +++ b/docs/UpdateEmailCampaign.md @@ -1,35 +1,72 @@ # SibApiV3Sdk::UpdateEmailCampaign ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tag** | **String** | Tag of the campaign | [optional] -**sender** | [**UpdateEmailCampaignSender**](UpdateEmailCampaignSender.md) | | [optional] -**name** | **String** | Name of the campaign | [optional] -**html_content** | **String** | Body of the message (HTML version). REQUIRED if htmlUrl is empty | [optional] -**html_url** | **String** | Url which contents the body of the email message. REQUIRED if htmlContent is empty | [optional] -**scheduled_at** | **String** | UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). | [optional] -**subject** | **String** | Subject of the campaign | [optional] -**reply_to** | **String** | Email on which campaign recipients will be able to reply to | [optional] -**to_field** | **String** | To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization | [optional] -**recipients** | [**UpdateEmailCampaignRecipients**](UpdateEmailCampaignRecipients.md) | | [optional] -**attachment_url** | **String** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional] -**inline_image_activation** | **BOOLEAN** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. You cannot send a campaign of more than 4MB with images embedded in the email. Campaigns with the images embedded in the email must be sent to less than 5000 contacts. | [optional] [default to false] -**mirror_active** | **BOOLEAN** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional] -**recurring** | **BOOLEAN** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional] [default to false] -**footer** | **String** | Footer of the email campaign | [optional] -**header** | **String** | Header of the email campaign | [optional] -**utm_campaign** | **String** | Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed | [optional] -**params** | **Object** | Pass the set of attributes to customize the type 'classic' campaign. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. The 'params' field will get updated, only if the campaign is in New Template Language, else ignored. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField' | [optional] -**send_at_best_time** | **BOOLEAN** | Set this to true if you want to send your campaign at best time. Note:- if true, warmup ip will be disabled. | [optional] -**ab_testing** | **BOOLEAN** | Status of A/B Test. abTesting = false means it is disabled, & abTesting = true means it is enabled. 'subjectA', 'subjectB', 'splitRule', 'winnerCriteria' & 'winnerDelay' will be considered if abTesting is set to true. 'subject' if passed is ignored. Can be set to true only if 'sendAtBestTime' is 'false'. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B | [optional] [default to false] -**subject_a** | **String** | Subject A of the campaign. Considered if abTesting = true. subjectA & subjectB should have unique value | [optional] -**subject_b** | **String** | Subject B of the campaign. Considered if abTesting = true. subjectA & subjectB should have unique value | [optional] -**split_rule** | **Integer** | Add the size of your test groups. Considered if abTesting = true. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else | [optional] -**winner_criteria** | **String** | Choose the metrics that will determinate the winning version. Considered if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerCriteria' is ignored if passed or alreday exist in record | [optional] -**winner_delay** | **Integer** | Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Considered if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerDelay' is ignored if passed or alreday exist in record | [optional] -**ip_warmup_enable** | **BOOLEAN** | Available for dedicated ip clients. Set this to true if you wish to warm up your ip. | [optional] [default to false] -**initial_quota** | **Integer** | Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. | [optional] -**increase_rate** | **Integer** | Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **tag** | **String** | Tag of the campaign | [optional] | +| **sender** | [**UpdateEmailCampaignSender**](UpdateEmailCampaignSender.md) | | [optional] | +| **name** | **String** | Name of the campaign | [optional] | +| **html_content** | **String** | Body of the message (HTML version). REQUIRED if htmlUrl is empty | [optional] | +| **html_url** | **String** | Url which contents the body of the email message. REQUIRED if htmlContent is empty | [optional] | +| **scheduled_at** | **String** | UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). | [optional] | +| **subject** | **String** | Subject of the campaign | [optional] | +| **reply_to** | **String** | Email on which campaign recipients will be able to reply to | [optional] | +| **to_field** | **String** | To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization | [optional] | +| **recipients** | [**UpdateEmailCampaignRecipients**](UpdateEmailCampaignRecipients.md) | | [optional] | +| **attachment_url** | **String** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional] | +| **inline_image_activation** | **Boolean** | Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. You cannot send a campaign of more than 4MB with images embedded in the email. Campaigns with the images embedded in the email must be sent to less than 5000 contacts. | [optional][default to false] | +| **mirror_active** | **Boolean** | Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign | [optional] | +| **recurring** | **Boolean** | FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times | [optional][default to false] | +| **footer** | **String** | Footer of the email campaign | [optional] | +| **header** | **String** | Header of the email campaign | [optional] | +| **utm_campaign** | **String** | Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed | [optional] | +| **params** | **Object** | Pass the set of attributes to customize the type 'classic' campaign. For example, {\"FNAME\":\"Joe\", \"LNAME\":\"Doe\"}. The 'params' field will get updated, only if the campaign is in New Template Language, else ignored. The New Template Language is dependent on the values of 'subject', 'htmlContent/htmlUrl', 'sender.name' & 'toField' | [optional] | +| **send_at_best_time** | **Boolean** | Set this to true if you want to send your campaign at best time. Note:- if true, warmup ip will be disabled. | [optional] | +| **ab_testing** | **Boolean** | Status of A/B Test. abTesting = false means it is disabled, & abTesting = true means it is enabled. 'subjectA', 'subjectB', 'splitRule', 'winnerCriteria' & 'winnerDelay' will be considered if abTesting is set to true. 'subject' if passed is ignored. Can be set to true only if 'sendAtBestTime' is 'false'. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B | [optional][default to false] | +| **subject_a** | **String** | Subject A of the campaign. Considered if abTesting = true. subjectA & subjectB should have unique value | [optional] | +| **subject_b** | **String** | Subject B of the campaign. Considered if abTesting = true. subjectA & subjectB should have unique value | [optional] | +| **split_rule** | **Integer** | Add the size of your test groups. Considered if abTesting = true. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else | [optional] | +| **winner_criteria** | **String** | Choose the metrics that will determinate the winning version. Considered if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerCriteria' is ignored if passed or alreday exist in record | [optional] | +| **winner_delay** | **Integer** | Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Considered if 'splitRule' >= 1 and < 50. If splitRule = 50, 'winnerDelay' is ignored if passed or alreday exist in record | [optional] | +| **ip_warmup_enable** | **Boolean** | Available for dedicated ip clients. Set this to true if you wish to warm up your ip. | [optional][default to false] | +| **initial_quota** | **Integer** | Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000. | [optional] | +| **increase_rate** | **Integer** | Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::UpdateEmailCampaign.new( + tag: Newsletter, + sender: null, + name: Newsletter - May 2017, + html_content: Spring is here, discover my new collection, + html_url: https://html.domain.com, + scheduled_at: 2017-06-01T12:30:00+02:00, + subject: Discover the New Collection !, + reply_to: support@myshop.com, + to_field: {FNAME} {LNAME}, + recipients: null, + attachment_url: https://attachment.domain.com, + inline_image_activation: true, + mirror_active: true, + recurring: false, + footer: [DEFAULT_FOOTER], + header: [DEFAULT_HEADER], + utm_campaign: NL_05_2017, + params: {"FNAME":"Joe","LNAME":"Doe"}, + send_at_best_time: true, + ab_testing: true, + subject_a: Discover the New Collection!, + subject_b: Want to discover the New Collection?, + split_rule: 50, + winner_criteria: open, + winner_delay: 50, + ip_warmup_enable: true, + initial_quota: 3000, + increase_rate: 70 +) +``` diff --git a/docs/UpdateEmailCampaignRecipients.md b/docs/UpdateEmailCampaignRecipients.md index 7ca86ac..fefb330 100644 --- a/docs/UpdateEmailCampaignRecipients.md +++ b/docs/UpdateEmailCampaignRecipients.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::UpdateEmailCampaignRecipients ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**exclusion_list_ids** | **Array<Integer>** | List ids which have to be excluded from a campaign | [optional] -**list_ids** | **Array<Integer>** | Lists Ids to send the campaign to. REQUIRED if already not present in campaign and scheduledAt is not empty | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **exclusion_list_ids** | **Array<Integer>** | List ids which have to be excluded from a campaign | [optional] | +| **list_ids** | **Array<Integer>** | Lists Ids to send the campaign to. REQUIRED if already not present in campaign and scheduledAt is not empty | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::UpdateEmailCampaignRecipients.new( + exclusion_list_ids: null, + list_ids: null +) +``` diff --git a/docs/UpdateEmailCampaignSender.md b/docs/UpdateEmailCampaignSender.md index e67066f..ff17b4f 100644 --- a/docs/UpdateEmailCampaignSender.md +++ b/docs/UpdateEmailCampaignSender.md @@ -1,10 +1,22 @@ # SibApiV3Sdk::UpdateEmailCampaignSender ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Sender Name from which the campaign emails are sent | [optional] -**email** | **String** | Sender email from which the campaign emails are sent | [optional] -**id** | **Integer** | Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Sender Name from which the campaign emails are sent | [optional] | +| **email** | **String** | Sender email from which the campaign emails are sent | [optional] | +| **id** | **Integer** | Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::UpdateEmailCampaignSender.new( + name: Mary from MyShop, + email: newsletter@myshop.com, + id: 3 +) +``` diff --git a/docs/UpdateList.md b/docs/UpdateList.md index a63f9d7..08a7e7e 100644 --- a/docs/UpdateList.md +++ b/docs/UpdateList.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::UpdateList ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Name of the list. Either of the two parameters (name, folderId) can be updated at a time. | [optional] -**folder_id** | **Integer** | Id of the folder in which the list is to be moved. Either of the two parameters (name, folderId) can be updated at a time. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of the list. Either of the two parameters (name, folderId) can be updated at a time. | [optional] | +| **folder_id** | **Integer** | Id of the folder in which the list is to be moved. Either of the two parameters (name, folderId) can be updated at a time. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::UpdateList.new( + name: Magento Customer - ES, + folder_id: 2 +) +``` diff --git a/docs/UpdateSender.md b/docs/UpdateSender.md index 57928e6..7715d84 100644 --- a/docs/UpdateSender.md +++ b/docs/UpdateSender.md @@ -1,10 +1,22 @@ # SibApiV3Sdk::UpdateSender ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | From Name to update the sender | [optional] -**email** | **String** | From Email to update the sender | [optional] -**ips** | [**Array<CreateSenderIps>**](CreateSenderIps.md) | Only in case of dedicated IP, IPs to associate to the sender. If passed, will replace all the existing IPs. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | From Name to update the sender | [optional] | +| **email** | **String** | From Email to update the sender | [optional] | +| **ips** | [**Array<CreateSenderIps>**](CreateSenderIps.md) | Only in case of dedicated IP, IPs to associate to the sender. If passed, will replace all the existing IPs. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::UpdateSender.new( + name: Newsletter, + email: newsletter@mycompany.com, + ips: null +) +``` diff --git a/docs/UpdateSmsCampaign.md b/docs/UpdateSmsCampaign.md index 5c5e7a3..1cf1dfa 100644 --- a/docs/UpdateSmsCampaign.md +++ b/docs/UpdateSmsCampaign.md @@ -1,12 +1,26 @@ # SibApiV3Sdk::UpdateSmsCampaign ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Name of the campaign | [optional] -**sender** | **String** | Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** | [optional] -**content** | **String** | Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS | [optional] -**recipients** | [**CreateSmsCampaignRecipients**](CreateSmsCampaignRecipients.md) | | [optional] -**scheduled_at** | **String** | UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of the campaign | [optional] | +| **sender** | **String** | Name of the sender. **The number of characters is limited to 11 for alphanumeric characters and 15 for numeric characters** | [optional] | +| **content** | **String** | Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS | [optional] | +| **recipients** | [**CreateSmsCampaignRecipients**](CreateSmsCampaignRecipients.md) | | [optional] | +| **scheduled_at** | **String** | UTC date-time on which the campaign has to run (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::UpdateSmsCampaign.new( + name: Spring Promo Code, + sender: MyShop, + content: Get a discount by visiting our NY store and saying : Happy Spring!, + recipients: null, + scheduled_at: 2017-05-05T12:30:00+02:00 +) +``` diff --git a/docs/UpdateSmtpTemplate.md b/docs/UpdateSmtpTemplate.md index f2d289a..d2ea30d 100644 --- a/docs/UpdateSmtpTemplate.md +++ b/docs/UpdateSmtpTemplate.md @@ -1,17 +1,36 @@ # SibApiV3Sdk::UpdateSmtpTemplate ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tag** | **String** | Tag of the template | [optional] -**sender** | [**UpdateSmtpTemplateSender**](UpdateSmtpTemplateSender.md) | | [optional] -**template_name** | **String** | Name of the template | [optional] -**html_content** | **String** | Required if htmlUrl is empty. Body of the message (HTML must have more than 10 characters) | [optional] -**html_url** | **String** | Required if htmlContent is empty. URL to the body of the email (HTML) | [optional] -**subject** | **String** | Subject of the email | [optional] -**reply_to** | **String** | Email on which campaign recipients will be able to reply to | [optional] -**to_field** | **String** | To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization | [optional] -**attachment_url** | **String** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional] -**is_active** | **BOOLEAN** | Status of the template. isActive = false means template is inactive, isActive = true means template is active | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **tag** | **String** | Tag of the template | [optional] | +| **sender** | [**UpdateSmtpTemplateSender**](UpdateSmtpTemplateSender.md) | | [optional] | +| **template_name** | **String** | Name of the template | [optional] | +| **html_content** | **String** | Required if htmlUrl is empty. Body of the message (HTML must have more than 10 characters) | [optional] | +| **html_url** | **String** | Required if htmlContent is empty. URL to the body of the email (HTML) | [optional] | +| **subject** | **String** | Subject of the email | [optional] | +| **reply_to** | **String** | Email on which campaign recipients will be able to reply to | [optional] | +| **to_field** | **String** | To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use {{contact.FNAME}} {{contact.LNAME}} for personalization | [optional] | +| **attachment_url** | **String** | Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps | [optional] | +| **is_active** | **Boolean** | Status of the template. isActive = false means template is inactive, isActive = true means template is active | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::UpdateSmtpTemplate.new( + tag: OrderConfirmation, + sender: null, + template_name: Order Confirmation - EN, + html_content: The order n°xxxxx has been confirmed. Thanks for your purchase, + html_url: https://html.domain.com, + subject: Thanks for your purchase !, + reply_to: support@myshop.com, + to_field: {FNAME} {LNAME}, + attachment_url: https://attachment.domain.com, + is_active: true +) +``` diff --git a/docs/UpdateSmtpTemplateSender.md b/docs/UpdateSmtpTemplateSender.md index 58b6bc8..f921597 100644 --- a/docs/UpdateSmtpTemplateSender.md +++ b/docs/UpdateSmtpTemplateSender.md @@ -1,10 +1,22 @@ # SibApiV3Sdk::UpdateSmtpTemplateSender ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Name of the sender | [optional] -**email** | **String** | Email of the sender | [optional] -**id** | **Integer** | Select the sender for the template on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **name** | **String** | Name of the sender | [optional] | +| **email** | **String** | Email of the sender | [optional] | +| **id** | **Integer** | Select the sender for the template on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::UpdateSmtpTemplateSender.new( + name: Mary from MyShop, + email: contact@myshop.com, + id: 3 +) +``` diff --git a/docs/UpdateWebhook.md b/docs/UpdateWebhook.md index 711582c..21c081d 100644 --- a/docs/UpdateWebhook.md +++ b/docs/UpdateWebhook.md @@ -1,10 +1,22 @@ # SibApiV3Sdk::UpdateWebhook ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**url** | **String** | URL of the webhook | [optional] -**description** | **String** | Description of the webhook | [optional] -**events** | **Array<String>** | Events triggering the webhook. Possible values for Transactional type webhook – `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` and possible values for Marketing type webhook – `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` and `delivered` | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **url** | **String** | URL of the webhook | [optional] | +| **description** | **String** | Description of the webhook | [optional] | +| **events** | **Array<String>** | Events triggering the webhook. Possible values for Transactional type webhook – `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` and possible values for Marketing type webhook – `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` and `delivered` | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::UpdateWebhook.new( + url: http://requestb.in/173lyyx1, + description: Webhook triggered on contact hardbounce, + events: null +) +``` diff --git a/docs/UploadImageToGallery.md b/docs/UploadImageToGallery.md index 36f62af..fe8920e 100644 --- a/docs/UploadImageToGallery.md +++ b/docs/UploadImageToGallery.md @@ -1,9 +1,20 @@ # SibApiV3Sdk::UploadImageToGallery ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**image_url** | **String** | The absolute url of the image (no local file). Maximum allowed size for image is 2MB. Allowed extensions for images are - jpeg, jpg, png, bmp, gif. | -**name** | **String** | Name of the image. | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **image_url** | **String** | The absolute url of the image (no local file). Maximum allowed size for image is 2MB. Allowed extensions for images are - jpeg, jpg, png, bmp, gif. | | +| **name** | **String** | Name of the image. | [optional] | + +## Example + +```ruby +require 'sib-api-v3-sdk' + +instance = SibApiV3Sdk::UploadImageToGallery.new( + image_url: https://somedomain.com/image1.jpg, + name: nature.jpg +) +``` diff --git a/docs/WebhooksApi.md b/docs/WebhooksApi.md index 5df6da3..70fa57f 100644 --- a/docs/WebhooksApi.md +++ b/docs/WebhooksApi.md @@ -2,56 +2,74 @@ All URIs are relative to *https://api.sendinblue.com/v3* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_webhook**](WebhooksApi.md#create_webhook) | **POST** /webhooks | Create a webhook -[**delete_webhook**](WebhooksApi.md#delete_webhook) | **DELETE** /webhooks/{webhookId} | Delete a webhook -[**get_webhook**](WebhooksApi.md#get_webhook) | **GET** /webhooks/{webhookId} | Get a webhook details -[**get_webhooks**](WebhooksApi.md#get_webhooks) | **GET** /webhooks | Get all webhooks -[**update_webhook**](WebhooksApi.md#update_webhook) | **PUT** /webhooks/{webhookId} | Update a webhook +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**create_webhook**](WebhooksApi.md#create_webhook) | **POST** /webhooks | Create a webhook | +| [**delete_webhook**](WebhooksApi.md#delete_webhook) | **DELETE** /webhooks/{webhookId} | Delete a webhook | +| [**get_webhook**](WebhooksApi.md#get_webhook) | **GET** /webhooks/{webhookId} | Get a webhook details | +| [**get_webhooks**](WebhooksApi.md#get_webhooks) | **GET** /webhooks | Get all webhooks | +| [**update_webhook**](WebhooksApi.md#update_webhook) | **PUT** /webhooks/{webhookId} | Update a webhook | -# **create_webhook** -> CreateModel create_webhook(create_webhook) +## create_webhook + +> create_webhook(create_webhook) Create a webhook -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::WebhooksApi.new - -create_webhook = SibApiV3Sdk::CreateWebhook.new # CreateWebhook | Values to create a webhook - +create_webhook = SibApiV3Sdk::CreateWebhook.new({url: 'http://requestb.in/173lyyx1', events: ['sent']}) # CreateWebhook | Values to create a webhook begin - #Create a webhook + # Create a webhook result = api_instance.create_webhook(create_webhook) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling WebhooksApi->create_webhook: #{e}" + puts "Error when calling WebhooksApi->create_webhook: #{e}" +end +``` + +#### Using the create_webhook_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_webhook_with_http_info(create_webhook) + +```ruby +begin + # Create a webhook + data, status_code, headers = api_instance.create_webhook_with_http_info(create_webhook) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling WebhooksApi->create_webhook_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **create_webhook** | [**CreateWebhook**](CreateWebhook.md)| Values to create a webhook | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **create_webhook** | [**CreateWebhook**](CreateWebhook.md) | Values to create a webhook | | ### Return type @@ -63,51 +81,68 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## delete_webhook -# **delete_webhook** > delete_webhook(webhook_id) Delete a webhook -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::WebhooksApi.new - webhook_id = 789 # Integer | Id of the webhook - begin - #Delete a webhook + # Delete a webhook api_instance.delete_webhook(webhook_id) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling WebhooksApi->delete_webhook: #{e}" + puts "Error when calling WebhooksApi->delete_webhook: #{e}" +end +``` + +#### Using the delete_webhook_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> delete_webhook_with_http_info(webhook_id) + +```ruby +begin + # Delete a webhook + data, status_code, headers = api_instance.delete_webhook_with_http_info(webhook_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling WebhooksApi->delete_webhook_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **webhook_id** | **Integer**| Id of the webhook | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **webhook_id** | **Integer** | Id of the webhook | | ### Return type @@ -119,52 +154,69 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_webhook -# **get_webhook** -> GetWebhook get_webhook(webhook_id) +> get_webhook(webhook_id) Get a webhook details -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::WebhooksApi.new - webhook_id = 789 # Integer | Id of the webhook - begin - #Get a webhook details + # Get a webhook details result = api_instance.get_webhook(webhook_id) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling WebhooksApi->get_webhook: #{e}" + puts "Error when calling WebhooksApi->get_webhook: #{e}" +end +``` + +#### Using the get_webhook_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_webhook_with_http_info(webhook_id) + +```ruby +begin + # Get a webhook details + data, status_code, headers = api_instance.get_webhook_with_http_info(webhook_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling WebhooksApi->get_webhook_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **webhook_id** | **Integer**| Id of the webhook | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **webhook_id** | **Integer** | Id of the webhook | | ### Return type @@ -176,53 +228,73 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## get_webhooks -# **get_webhooks** -> GetWebhooks get_webhooks(opts) +> get_webhooks(opts) Get all webhooks -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::WebhooksApi.new - -opts = { - type: 'transactional' # String | Filter on webhook type +opts = { + type: 'marketing', # String | Filter on webhook type + sort: 'asc' # String | Sort the results in the ascending/descending order of webhook creation } begin - #Get all webhooks + # Get all webhooks result = api_instance.get_webhooks(opts) p result rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling WebhooksApi->get_webhooks: #{e}" + puts "Error when calling WebhooksApi->get_webhooks: #{e}" +end +``` + +#### Using the get_webhooks_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_webhooks_with_http_info(opts) + +```ruby +begin + # Get all webhooks + data, status_code, headers = api_instance.get_webhooks_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling WebhooksApi->get_webhooks_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **type** | **String**| Filter on webhook type | [optional] [default to transactional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **type** | **String** | Filter on webhook type | [optional][default to 'transactional'] | +| **sort** | **String** | Sort the results in the ascending/descending order of webhook creation | [optional][default to 'desc'] | ### Return type @@ -234,54 +306,70 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## update_webhook -# **update_webhook** > update_webhook(webhook_id, update_webhook) Update a webhook -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'sib-api-v3-sdk' # setup authorization SibApiV3Sdk.configure do |config| # Configure API key authorization: api-key config.api_key['api-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['api-key'] = 'Bearer' + # config.api_key_prefix['api-key'] = 'Bearer' # Configure API key authorization: partner-key config.api_key['partner-key'] = 'YOUR API KEY' # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil) - #config.api_key_prefix['partner-key'] = 'Bearer' + # config.api_key_prefix['partner-key'] = 'Bearer' end api_instance = SibApiV3Sdk::WebhooksApi.new - webhook_id = 789 # Integer | Id of the webhook - update_webhook = SibApiV3Sdk::UpdateWebhook.new # UpdateWebhook | Values to update a webhook - begin - #Update a webhook + # Update a webhook api_instance.update_webhook(webhook_id, update_webhook) rescue SibApiV3Sdk::ApiError => e - puts "Exception when calling WebhooksApi->update_webhook: #{e}" + puts "Error when calling WebhooksApi->update_webhook: #{e}" +end +``` + +#### Using the update_webhook_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_webhook_with_http_info(webhook_id, update_webhook) + +```ruby +begin + # Update a webhook + data, status_code, headers = api_instance.update_webhook_with_http_info(webhook_id, update_webhook) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue SibApiV3Sdk::ApiError => e + puts "Error when calling WebhooksApi->update_webhook_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **webhook_id** | **Integer**| Id of the webhook | - **update_webhook** | [**UpdateWebhook**](UpdateWebhook.md)| Values to update a webhook | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **webhook_id** | **Integer** | Id of the webhook | | +| **update_webhook** | [**UpdateWebhook**](UpdateWebhook.md) | Values to update a webhook | | ### Return type @@ -293,8 +381,6 @@ nil (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json - - +- **Content-Type**: application/json +- **Accept**: application/json diff --git a/git_push.sh b/git_push.sh new file mode 100644 index 0000000..ced3be2 --- /dev/null +++ b/git_push.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/lib/sib-api-v3-sdk.rb b/lib/sib-api-v3-sdk.rb index 2b016e3..2cfccf9 100644 --- a/lib/sib-api-v3-sdk.rb +++ b/lib/sib-api-v3-sdk.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -20,8 +20,6 @@ require 'sib-api-v3-sdk/models/ab_test_campaign_result' require 'sib-api-v3-sdk/models/ab_test_campaign_result_clicked_links' require 'sib-api-v3-sdk/models/ab_test_campaign_result_statistics' -require 'sib-api-v3-sdk/models/ab_test_version_clicks' -require 'sib-api-v3-sdk/models/ab_test_version_clicks_inner' require 'sib-api-v3-sdk/models/ab_test_version_stats' require 'sib-api-v3-sdk/models/add_child_domain' require 'sib-api-v3-sdk/models/add_contact_to_list' @@ -54,10 +52,11 @@ require 'sib-api-v3-sdk/models/email_export_recipients' require 'sib-api-v3-sdk/models/error_model' require 'sib-api-v3-sdk/models/get_account' -require 'sib-api-v3-sdk/models/get_account_marketing_automation' -require 'sib-api-v3-sdk/models/get_account_plan' -require 'sib-api-v3-sdk/models/get_account_relay' -require 'sib-api-v3-sdk/models/get_account_relay_data' +require 'sib-api-v3-sdk/models/get_account_all_of' +require 'sib-api-v3-sdk/models/get_account_all_of_marketing_automation' +require 'sib-api-v3-sdk/models/get_account_all_of_plan' +require 'sib-api-v3-sdk/models/get_account_all_of_relay' +require 'sib-api-v3-sdk/models/get_account_all_of_relay_data' require 'sib-api-v3-sdk/models/get_aggregated_report' require 'sib-api-v3-sdk/models/get_attributes' require 'sib-api-v3-sdk/models/get_attributes_attributes' @@ -68,13 +67,13 @@ require 'sib-api-v3-sdk/models/get_campaign_stats' require 'sib-api-v3-sdk/models/get_child_account_creation_status' require 'sib-api-v3-sdk/models/get_child_domain' -require 'sib-api-v3-sdk/models/get_child_domains' require 'sib-api-v3-sdk/models/get_child_info' -require 'sib-api-v3-sdk/models/get_child_info_api_keys' -require 'sib-api-v3-sdk/models/get_child_info_api_keys_v2' -require 'sib-api-v3-sdk/models/get_child_info_api_keys_v3' -require 'sib-api-v3-sdk/models/get_child_info_credits' -require 'sib-api-v3-sdk/models/get_child_info_statistics' +require 'sib-api-v3-sdk/models/get_child_info_all_of' +require 'sib-api-v3-sdk/models/get_child_info_all_of_api_keys' +require 'sib-api-v3-sdk/models/get_child_info_all_of_api_keys_v2' +require 'sib-api-v3-sdk/models/get_child_info_all_of_api_keys_v3' +require 'sib-api-v3-sdk/models/get_child_info_all_of_credits' +require 'sib-api-v3-sdk/models/get_child_info_all_of_statistics' require 'sib-api-v3-sdk/models/get_children_list' require 'sib-api-v3-sdk/models/get_client' require 'sib-api-v3-sdk/models/get_contact_campaign_stats' @@ -86,26 +85,30 @@ require 'sib-api-v3-sdk/models/get_contacts' require 'sib-api-v3-sdk/models/get_device_browser_stats' require 'sib-api-v3-sdk/models/get_email_campaign' +require 'sib-api-v3-sdk/models/get_email_campaign_all_of' require 'sib-api-v3-sdk/models/get_email_campaigns' require 'sib-api-v3-sdk/models/get_email_event_report' require 'sib-api-v3-sdk/models/get_email_event_report_events' require 'sib-api-v3-sdk/models/get_extended_campaign_overview' -require 'sib-api-v3-sdk/models/get_extended_campaign_overview_sender' +require 'sib-api-v3-sdk/models/get_extended_campaign_overview_all_of' +require 'sib-api-v3-sdk/models/get_extended_campaign_overview_all_of_sender' require 'sib-api-v3-sdk/models/get_extended_campaign_stats' -require 'sib-api-v3-sdk/models/get_extended_campaign_stats_global_stats' require 'sib-api-v3-sdk/models/get_extended_client' -require 'sib-api-v3-sdk/models/get_extended_client_address' +require 'sib-api-v3-sdk/models/get_extended_client_all_of' +require 'sib-api-v3-sdk/models/get_extended_client_all_of_address' require 'sib-api-v3-sdk/models/get_extended_contact_details' -require 'sib-api-v3-sdk/models/get_extended_contact_details_statistics' -require 'sib-api-v3-sdk/models/get_extended_contact_details_statistics_clicked' -require 'sib-api-v3-sdk/models/get_extended_contact_details_statistics_links' -require 'sib-api-v3-sdk/models/get_extended_contact_details_statistics_messages_sent' -require 'sib-api-v3-sdk/models/get_extended_contact_details_statistics_opened' -require 'sib-api-v3-sdk/models/get_extended_contact_details_statistics_unsubscriptions' -require 'sib-api-v3-sdk/models/get_extended_contact_details_statistics_unsubscriptions_admin_unsubscription' -require 'sib-api-v3-sdk/models/get_extended_contact_details_statistics_unsubscriptions_user_unsubscription' +require 'sib-api-v3-sdk/models/get_extended_contact_details_all_of' +require 'sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics' +require 'sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_clicked' +require 'sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_links' +require 'sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_messages_sent' +require 'sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_opened' +require 'sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_unsubscriptions' +require 'sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_unsubscriptions_admin_unsubscription' +require 'sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_unsubscriptions_user_unsubscription' require 'sib-api-v3-sdk/models/get_extended_list' -require 'sib-api-v3-sdk/models/get_extended_list_campaign_stats' +require 'sib-api-v3-sdk/models/get_extended_list_all_of' +require 'sib-api-v3-sdk/models/get_extended_list_all_of_campaign_stats' require 'sib-api-v3-sdk/models/get_folder' require 'sib-api-v3-sdk/models/get_folder_lists' require 'sib-api-v3-sdk/models/get_folders' @@ -124,8 +127,8 @@ require 'sib-api-v3-sdk/models/get_senders_list_senders' require 'sib-api-v3-sdk/models/get_shared_template_url' require 'sib-api-v3-sdk/models/get_sms_campaign' +require 'sib-api-v3-sdk/models/get_sms_campaign_all_of' require 'sib-api-v3-sdk/models/get_sms_campaign_overview' -require 'sib-api-v3-sdk/models/get_sms_campaign_recipients' require 'sib-api-v3-sdk/models/get_sms_campaign_stats' require 'sib-api-v3-sdk/models/get_sms_campaigns' require 'sib-api-v3-sdk/models/get_sms_event_report' @@ -134,9 +137,7 @@ require 'sib-api-v3-sdk/models/get_smtp_template_overview_sender' require 'sib-api-v3-sdk/models/get_smtp_templates' require 'sib-api-v3-sdk/models/get_sso_token' -require 'sib-api-v3-sdk/models/get_stats_by_browser' require 'sib-api-v3-sdk/models/get_stats_by_device' -require 'sib-api-v3-sdk/models/get_stats_by_domain' require 'sib-api-v3-sdk/models/get_transac_aggregated_sms_report' require 'sib-api-v3-sdk/models/get_transac_blocked_contacts' require 'sib-api-v3-sdk/models/get_transac_blocked_contacts_contacts' @@ -175,10 +176,10 @@ require 'sib-api-v3-sdk/models/send_smtp_email_cc' require 'sib-api-v3-sdk/models/send_smtp_email_message_versions' require 'sib-api-v3-sdk/models/send_smtp_email_reply_to' -require 'sib-api-v3-sdk/models/send_smtp_email_reply_to_1' +require 'sib-api-v3-sdk/models/send_smtp_email_reply_to1' require 'sib-api-v3-sdk/models/send_smtp_email_sender' require 'sib-api-v3-sdk/models/send_smtp_email_to' -require 'sib-api-v3-sdk/models/send_smtp_email_to_1' +require 'sib-api-v3-sdk/models/send_smtp_email_to1' require 'sib-api-v3-sdk/models/send_template_email' require 'sib-api-v3-sdk/models/send_test_email' require 'sib-api-v3-sdk/models/send_test_sms' diff --git a/lib/sib-api-v3-sdk/api/account_api.rb b/lib/sib-api-v3-sdk/api/account_api.rb index 59de8f4..04554a5 100644 --- a/lib/sib-api-v3-sdk/api/account_api.rb +++ b/lib/sib-api-v3-sdk/api/account_api.rb @@ -3,14 +3,14 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end -require 'uri' +require 'cgi' module SibApiV3Sdk class AccountApi @@ -19,16 +19,6 @@ class AccountApi def initialize(api_client = ApiClient.default) @api_client = api_client end - - # Set custom user_agent if explicitly passed in api - # default will still remain Swagger-Codegen/#{VERSION}/ruby - def setUserAgent(user_agent) - @user_agent = user_agent - if user_agent.is_a?(String) && user_agent.downcase.start_with?('sendinblue_') - @api_client.default_headers['User-Agent'] = @user_agent - end - end - # Get your account information, plan and credits details # @param [Hash] opts the optional parameters # @return [GetAccount] @@ -39,7 +29,7 @@ def get_account(opts = {}) # Get your account information, plan and credits details # @param [Hash] opts the optional parameters - # @return [Array<(GetAccount, Fixnum, Hash)>] GetAccount data, response status code and response headers + # @return [Array<(GetAccount, Integer, Hash)>] GetAccount data, response status code and response headers def get_account_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountApi.get_account ...' @@ -48,28 +38,36 @@ def get_account_with_http_info(opts = {}) local_var_path = '/account' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetAccount' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"AccountApi.get_account", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetAccount') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountApi#get_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/sib-api-v3-sdk/api/attributes_api.rb b/lib/sib-api-v3-sdk/api/attributes_api.rb index ffa2acf..10a04c9 100644 --- a/lib/sib-api-v3-sdk/api/attributes_api.rb +++ b/lib/sib-api-v3-sdk/api/attributes_api.rb @@ -3,14 +3,14 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end -require 'uri' +require 'cgi' module SibApiV3Sdk class AttributesApi @@ -19,20 +19,10 @@ class AttributesApi def initialize(api_client = ApiClient.default) @api_client = api_client end - - # Set custom user_agent if explicitly passed in api - # default will still remain Swagger-Codegen/#{VERSION}/ruby - def setUserAgent(user_agent) - @user_agent = user_agent - if user_agent.is_a?(String) && user_agent.downcase.start_with?('sendinblue_') - @api_client.default_headers['User-Agent'] = @user_agent - end - end - # Create contact attribute - # @param attribute_category Category of the attribute - # @param attribute_name Name of the attribute - # @param create_attribute Values to create an attribute + # @param attribute_category [String] Category of the attribute + # @param attribute_name [String] Name of the attribute + # @param create_attribute [CreateAttribute] Values to create an attribute # @param [Hash] opts the optional parameters # @return [nil] def create_attribute(attribute_category, attribute_name, create_attribute, opts = {}) @@ -41,11 +31,11 @@ def create_attribute(attribute_category, attribute_name, create_attribute, opts end # Create contact attribute - # @param attribute_category Category of the attribute - # @param attribute_name Name of the attribute - # @param create_attribute Values to create an attribute + # @param attribute_category [String] Category of the attribute + # @param attribute_name [String] Name of the attribute + # @param create_attribute [CreateAttribute] Values to create an attribute # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def create_attribute_with_http_info(attribute_category, attribute_name, create_attribute, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttributesApi.create_attribute ...' @@ -55,8 +45,9 @@ def create_attribute_with_http_info(attribute_category, attribute_name, create_a fail ArgumentError, "Missing the required parameter 'attribute_category' when calling AttributesApi.create_attribute" end # verify enum value - if @api_client.config.client_side_validation && !['normal', 'transactional', 'category', 'calculated', 'global'].include?(attribute_category) - fail ArgumentError, "invalid value for 'attribute_category', must be one of normal, transactional, category, calculated, global" + allowable_values = ["normal", "transactional", "category", "calculated", "global"] + if @api_client.config.client_side_validation && !allowable_values.include?(attribute_category) + fail ArgumentError, "invalid value for \"attribute_category\", must be one of #{allowable_values}" end # verify the required parameter 'attribute_name' is set if @api_client.config.client_side_validation && attribute_name.nil? @@ -67,38 +58,50 @@ def create_attribute_with_http_info(attribute_category, attribute_name, create_a fail ArgumentError, "Missing the required parameter 'create_attribute' when calling AttributesApi.create_attribute" end # resource path - local_var_path = '/contacts/attributes/{attributeCategory}/{attributeName}'.sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s) + local_var_path = '/contacts/attributes/{attributeCategory}/{attributeName}'.sub('{' + 'attributeCategory' + '}', CGI.escape(attribute_category.to_s)).sub('{' + 'attributeName' + '}', CGI.escape(attribute_name.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(create_attribute) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_attribute) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"AttributesApi.create_attribute", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttributesApi#create_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Delete an attribute - # @param attribute_category Category of the attribute - # @param attribute_name Name of the existing attribute + # @param attribute_category [String] Category of the attribute + # @param attribute_name [String] Name of the existing attribute # @param [Hash] opts the optional parameters # @return [nil] def delete_attribute(attribute_category, attribute_name, opts = {}) @@ -107,10 +110,10 @@ def delete_attribute(attribute_category, attribute_name, opts = {}) end # Delete an attribute - # @param attribute_category Category of the attribute - # @param attribute_name Name of the existing attribute + # @param attribute_category [String] Category of the attribute + # @param attribute_name [String] Name of the existing attribute # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_attribute_with_http_info(attribute_category, attribute_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttributesApi.delete_attribute ...' @@ -120,43 +123,54 @@ def delete_attribute_with_http_info(attribute_category, attribute_name, opts = { fail ArgumentError, "Missing the required parameter 'attribute_category' when calling AttributesApi.delete_attribute" end # verify enum value - if @api_client.config.client_side_validation && !['normal', 'transactional', 'category', 'calculated', 'global'].include?(attribute_category) - fail ArgumentError, "invalid value for 'attribute_category', must be one of normal, transactional, category, calculated, global" + allowable_values = ["normal", "transactional", "category", "calculated", "global"] + if @api_client.config.client_side_validation && !allowable_values.include?(attribute_category) + fail ArgumentError, "invalid value for \"attribute_category\", must be one of #{allowable_values}" end # verify the required parameter 'attribute_name' is set if @api_client.config.client_side_validation && attribute_name.nil? fail ArgumentError, "Missing the required parameter 'attribute_name' when calling AttributesApi.delete_attribute" end # resource path - local_var_path = '/contacts/attributes/{attributeCategory}/{attributeName}'.sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s) + local_var_path = '/contacts/attributes/{attributeCategory}/{attributeName}'.sub('{' + 'attributeCategory' + '}', CGI.escape(attribute_category.to_s)).sub('{' + 'attributeName' + '}', CGI.escape(attribute_name.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"AttributesApi.delete_attribute", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttributesApi#delete_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # List all attributes # @param [Hash] opts the optional parameters # @return [GetAttributes] @@ -167,7 +181,7 @@ def get_attributes(opts = {}) # List all attributes # @param [Hash] opts the optional parameters - # @return [Array<(GetAttributes, Fixnum, Hash)>] GetAttributes data, response status code and response headers + # @return [Array<(GetAttributes, Integer, Hash)>] GetAttributes data, response status code and response headers def get_attributes_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttributesApi.get_attributes ...' @@ -176,37 +190,46 @@ def get_attributes_with_http_info(opts = {}) local_var_path = '/contacts/attributes' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetAttributes' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"AttributesApi.get_attributes", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetAttributes') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttributesApi#get_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Update contact attribute - # @param attribute_category Category of the attribute - # @param attribute_name Name of the existing attribute - # @param update_attribute Values to update an attribute + # @param attribute_category [String] Category of the attribute + # @param attribute_name [String] Name of the existing attribute + # @param update_attribute [UpdateAttribute] Values to update an attribute # @param [Hash] opts the optional parameters # @return [nil] def update_attribute(attribute_category, attribute_name, update_attribute, opts = {}) @@ -215,11 +238,11 @@ def update_attribute(attribute_category, attribute_name, update_attribute, opts end # Update contact attribute - # @param attribute_category Category of the attribute - # @param attribute_name Name of the existing attribute - # @param update_attribute Values to update an attribute + # @param attribute_category [String] Category of the attribute + # @param attribute_name [String] Name of the existing attribute + # @param update_attribute [UpdateAttribute] Values to update an attribute # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_attribute_with_http_info(attribute_category, attribute_name, update_attribute, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AttributesApi.update_attribute ...' @@ -229,8 +252,9 @@ def update_attribute_with_http_info(attribute_category, attribute_name, update_a fail ArgumentError, "Missing the required parameter 'attribute_category' when calling AttributesApi.update_attribute" end # verify enum value - if @api_client.config.client_side_validation && !['category', 'calculated', 'global'].include?(attribute_category) - fail ArgumentError, "invalid value for 'attribute_category', must be one of category, calculated, global" + allowable_values = ["category", "calculated", "global"] + if @api_client.config.client_side_validation && !allowable_values.include?(attribute_category) + fail ArgumentError, "invalid value for \"attribute_category\", must be one of #{allowable_values}" end # verify the required parameter 'attribute_name' is set if @api_client.config.client_side_validation && attribute_name.nil? @@ -241,30 +265,41 @@ def update_attribute_with_http_info(attribute_category, attribute_name, update_a fail ArgumentError, "Missing the required parameter 'update_attribute' when calling AttributesApi.update_attribute" end # resource path - local_var_path = '/contacts/attributes/{attributeCategory}/{attributeName}'.sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s) + local_var_path = '/contacts/attributes/{attributeCategory}/{attributeName}'.sub('{' + 'attributeCategory' + '}', CGI.escape(attribute_category.to_s)).sub('{' + 'attributeName' + '}', CGI.escape(attribute_name.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(update_attribute) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(update_attribute) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"AttributesApi.update_attribute", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: AttributesApi#update_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/sib-api-v3-sdk/api/contacts_api.rb b/lib/sib-api-v3-sdk/api/contacts_api.rb index 624756f..f7a9288 100644 --- a/lib/sib-api-v3-sdk/api/contacts_api.rb +++ b/lib/sib-api-v3-sdk/api/contacts_api.rb @@ -3,14 +3,14 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end -require 'uri' +require 'cgi' module SibApiV3Sdk class ContactsApi @@ -19,19 +19,9 @@ class ContactsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - - # Set custom user_agent if explicitly passed in api - # default will still remain Swagger-Codegen/#{VERSION}/ruby - def setUserAgent(user_agent) - @user_agent = user_agent - if user_agent.is_a?(String) && user_agent.downcase.start_with?('sendinblue_') - @api_client.default_headers['User-Agent'] = @user_agent - end - end - # Add existing contacts to a list - # @param list_id Id of the list - # @param contact_emails Emails addresses OR IDs of the contacts + # @param list_id [Integer] Id of the list + # @param contact_emails [AddContactToList] Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters # @return [PostContactInfo] def add_contact_to_list(list_id, contact_emails, opts = {}) @@ -40,10 +30,10 @@ def add_contact_to_list(list_id, contact_emails, opts = {}) end # Add existing contacts to a list - # @param list_id Id of the list - # @param contact_emails Emails addresses OR IDs of the contacts + # @param list_id [Integer] Id of the list + # @param contact_emails [AddContactToList] Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters - # @return [Array<(PostContactInfo, Fixnum, Hash)>] PostContactInfo data, response status code and response headers + # @return [Array<(PostContactInfo, Integer, Hash)>] PostContactInfo data, response status code and response headers def add_contact_to_list_with_http_info(list_id, contact_emails, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.add_contact_to_list ...' @@ -57,40 +47,51 @@ def add_contact_to_list_with_http_info(list_id, contact_emails, opts = {}) fail ArgumentError, "Missing the required parameter 'contact_emails' when calling ContactsApi.add_contact_to_list" end # resource path - local_var_path = '/contacts/lists/{listId}/contacts/add'.sub('{' + 'listId' + '}', list_id.to_s) + local_var_path = '/contacts/lists/{listId}/contacts/add'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(contact_emails) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(contact_emails) + + # return_type + return_type = opts[:debug_return_type] || 'PostContactInfo' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.add_contact_to_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'PostContactInfo') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#add_contact_to_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Create contact attribute - # @param attribute_category Category of the attribute - # @param attribute_name Name of the attribute - # @param create_attribute Values to create an attribute + # @param attribute_category [String] Category of the attribute + # @param attribute_name [String] Name of the attribute + # @param create_attribute [CreateAttribute] Values to create an attribute # @param [Hash] opts the optional parameters # @return [nil] def create_attribute(attribute_category, attribute_name, create_attribute, opts = {}) @@ -99,11 +100,11 @@ def create_attribute(attribute_category, attribute_name, create_attribute, opts end # Create contact attribute - # @param attribute_category Category of the attribute - # @param attribute_name Name of the attribute - # @param create_attribute Values to create an attribute + # @param attribute_category [String] Category of the attribute + # @param attribute_name [String] Name of the attribute + # @param create_attribute [CreateAttribute] Values to create an attribute # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def create_attribute_with_http_info(attribute_category, attribute_name, create_attribute, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.create_attribute ...' @@ -113,8 +114,9 @@ def create_attribute_with_http_info(attribute_category, attribute_name, create_a fail ArgumentError, "Missing the required parameter 'attribute_category' when calling ContactsApi.create_attribute" end # verify enum value - if @api_client.config.client_side_validation && !['normal', 'transactional', 'category', 'calculated', 'global'].include?(attribute_category) - fail ArgumentError, "invalid value for 'attribute_category', must be one of normal, transactional, category, calculated, global" + allowable_values = ["normal", "transactional", "category", "calculated", "global"] + if @api_client.config.client_side_validation && !allowable_values.include?(attribute_category) + fail ArgumentError, "invalid value for \"attribute_category\", must be one of #{allowable_values}" end # verify the required parameter 'attribute_name' is set if @api_client.config.client_side_validation && attribute_name.nil? @@ -125,37 +127,49 @@ def create_attribute_with_http_info(attribute_category, attribute_name, create_a fail ArgumentError, "Missing the required parameter 'create_attribute' when calling ContactsApi.create_attribute" end # resource path - local_var_path = '/contacts/attributes/{attributeCategory}/{attributeName}'.sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s) + local_var_path = '/contacts/attributes/{attributeCategory}/{attributeName}'.sub('{' + 'attributeCategory' + '}', CGI.escape(attribute_category.to_s)).sub('{' + 'attributeName' + '}', CGI.escape(attribute_name.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(create_attribute) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_attribute) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.create_attribute", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#create_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Create a contact - # @param create_contact Values to create a contact + # @param create_contact [CreateContact] Values to create a contact # @param [Hash] opts the optional parameters # @return [CreateUpdateContactModel] def create_contact(create_contact, opts = {}) @@ -164,9 +178,9 @@ def create_contact(create_contact, opts = {}) end # Create a contact - # @param create_contact Values to create a contact + # @param create_contact [CreateContact] Values to create a contact # @param [Hash] opts the optional parameters - # @return [Array<(CreateUpdateContactModel, Fixnum, Hash)>] CreateUpdateContactModel data, response status code and response headers + # @return [Array<(CreateUpdateContactModel, Integer, Hash)>] CreateUpdateContactModel data, response status code and response headers def create_contact_with_http_info(create_contact, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.create_contact ...' @@ -179,35 +193,46 @@ def create_contact_with_http_info(create_contact, opts = {}) local_var_path = '/contacts' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(create_contact) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_contact) + + # return_type + return_type = opts[:debug_return_type] || 'CreateUpdateContactModel' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.create_contact", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'CreateUpdateContactModel') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#create_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Create Contact via DOI (Double-Opt-In) Flow - # @param create_doi_contact Values to create the Double opt-in (DOI) contact + # @param create_doi_contact [CreateDoiContact] Values to create the Double opt-in (DOI) contact # @param [Hash] opts the optional parameters # @return [nil] def create_doi_contact(create_doi_contact, opts = {}) @@ -216,9 +241,9 @@ def create_doi_contact(create_doi_contact, opts = {}) end # Create Contact via DOI (Double-Opt-In) Flow - # @param create_doi_contact Values to create the Double opt-in (DOI) contact + # @param create_doi_contact [CreateDoiContact] Values to create the Double opt-in (DOI) contact # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def create_doi_contact_with_http_info(create_doi_contact, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.create_doi_contact ...' @@ -231,34 +256,46 @@ def create_doi_contact_with_http_info(create_doi_contact, opts = {}) local_var_path = '/contacts/doubleOptinConfirmation' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(create_doi_contact) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_doi_contact) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.create_doi_contact", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#create_doi_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Create a folder - # @param create_folder Name of the folder + # @param create_folder [CreateUpdateFolder] Name of the folder # @param [Hash] opts the optional parameters # @return [CreateModel] def create_folder(create_folder, opts = {}) @@ -267,9 +304,9 @@ def create_folder(create_folder, opts = {}) end # Create a folder - # @param create_folder Name of the folder + # @param create_folder [CreateUpdateFolder] Name of the folder # @param [Hash] opts the optional parameters - # @return [Array<(CreateModel, Fixnum, Hash)>] CreateModel data, response status code and response headers + # @return [Array<(CreateModel, Integer, Hash)>] CreateModel data, response status code and response headers def create_folder_with_http_info(create_folder, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.create_folder ...' @@ -282,35 +319,46 @@ def create_folder_with_http_info(create_folder, opts = {}) local_var_path = '/contacts/folders' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(create_folder) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_folder) + + # return_type + return_type = opts[:debug_return_type] || 'CreateModel' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.create_folder", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'CreateModel') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Create a list - # @param create_list Values to create a list + # @param create_list [CreateList] Values to create a list # @param [Hash] opts the optional parameters # @return [CreateModel] def create_list(create_list, opts = {}) @@ -319,9 +367,9 @@ def create_list(create_list, opts = {}) end # Create a list - # @param create_list Values to create a list + # @param create_list [CreateList] Values to create a list # @param [Hash] opts the optional parameters - # @return [Array<(CreateModel, Fixnum, Hash)>] CreateModel data, response status code and response headers + # @return [Array<(CreateModel, Integer, Hash)>] CreateModel data, response status code and response headers def create_list_with_http_info(create_list, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.create_list ...' @@ -334,36 +382,47 @@ def create_list_with_http_info(create_list, opts = {}) local_var_path = '/contacts/lists' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(create_list) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_list) + + # return_type + return_type = opts[:debug_return_type] || 'CreateModel' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.create_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'CreateModel') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#create_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Delete an attribute - # @param attribute_category Category of the attribute - # @param attribute_name Name of the existing attribute + # @param attribute_category [String] Category of the attribute + # @param attribute_name [String] Name of the existing attribute # @param [Hash] opts the optional parameters # @return [nil] def delete_attribute(attribute_category, attribute_name, opts = {}) @@ -372,10 +431,10 @@ def delete_attribute(attribute_category, attribute_name, opts = {}) end # Delete an attribute - # @param attribute_category Category of the attribute - # @param attribute_name Name of the existing attribute + # @param attribute_category [String] Category of the attribute + # @param attribute_name [String] Name of the existing attribute # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_attribute_with_http_info(attribute_category, attribute_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.delete_attribute ...' @@ -385,45 +444,56 @@ def delete_attribute_with_http_info(attribute_category, attribute_name, opts = { fail ArgumentError, "Missing the required parameter 'attribute_category' when calling ContactsApi.delete_attribute" end # verify enum value - if @api_client.config.client_side_validation && !['normal', 'transactional', 'category', 'calculated', 'global'].include?(attribute_category) - fail ArgumentError, "invalid value for 'attribute_category', must be one of normal, transactional, category, calculated, global" + allowable_values = ["normal", "transactional", "category", "calculated", "global"] + if @api_client.config.client_side_validation && !allowable_values.include?(attribute_category) + fail ArgumentError, "invalid value for \"attribute_category\", must be one of #{allowable_values}" end # verify the required parameter 'attribute_name' is set if @api_client.config.client_side_validation && attribute_name.nil? fail ArgumentError, "Missing the required parameter 'attribute_name' when calling ContactsApi.delete_attribute" end # resource path - local_var_path = '/contacts/attributes/{attributeCategory}/{attributeName}'.sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s) + local_var_path = '/contacts/attributes/{attributeCategory}/{attributeName}'.sub('{' + 'attributeCategory' + '}', CGI.escape(attribute_category.to_s)).sub('{' + 'attributeName' + '}', CGI.escape(attribute_name.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.delete_attribute", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#delete_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Delete a contact - # @param identifier Email (urlencoded) OR ID of the contact + # @param identifier [String] Email (urlencoded) OR ID of the contact # @param [Hash] opts the optional parameters # @return [nil] def delete_contact(identifier, opts = {}) @@ -432,9 +502,9 @@ def delete_contact(identifier, opts = {}) end # Delete a contact - # @param identifier Email (urlencoded) OR ID of the contact + # @param identifier [String] Email (urlencoded) OR ID of the contact # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_contact_with_http_info(identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.delete_contact ...' @@ -444,37 +514,47 @@ def delete_contact_with_http_info(identifier, opts = {}) fail ArgumentError, "Missing the required parameter 'identifier' when calling ContactsApi.delete_contact" end # resource path - local_var_path = '/contacts/{identifier}'.sub('{' + 'identifier' + '}', identifier.to_s) + local_var_path = '/contacts/{identifier}'.sub('{' + 'identifier' + '}', CGI.escape(identifier.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.delete_contact", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#delete_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Delete a folder (and all its lists) - # @param folder_id Id of the folder + # @param folder_id [Integer] Id of the folder # @param [Hash] opts the optional parameters # @return [nil] def delete_folder(folder_id, opts = {}) @@ -483,9 +563,9 @@ def delete_folder(folder_id, opts = {}) end # Delete a folder (and all its lists) - # @param folder_id Id of the folder + # @param folder_id [Integer] Id of the folder # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_folder_with_http_info(folder_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.delete_folder ...' @@ -495,37 +575,47 @@ def delete_folder_with_http_info(folder_id, opts = {}) fail ArgumentError, "Missing the required parameter 'folder_id' when calling ContactsApi.delete_folder" end # resource path - local_var_path = '/contacts/folders/{folderId}'.sub('{' + 'folderId' + '}', folder_id.to_s) + local_var_path = '/contacts/folders/{folderId}'.sub('{' + 'folderId' + '}', CGI.escape(folder_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.delete_folder", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#delete_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Delete a list - # @param list_id Id of the list + # @param list_id [Integer] Id of the list # @param [Hash] opts the optional parameters # @return [nil] def delete_list(list_id, opts = {}) @@ -534,9 +624,9 @@ def delete_list(list_id, opts = {}) end # Delete a list - # @param list_id Id of the list + # @param list_id [Integer] Id of the list # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_list_with_http_info(list_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.delete_list ...' @@ -546,35 +636,45 @@ def delete_list_with_http_info(list_id, opts = {}) fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactsApi.delete_list" end # resource path - local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', list_id.to_s) + local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.delete_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#delete_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # List all attributes # @param [Hash] opts the optional parameters # @return [GetAttributes] @@ -585,7 +685,7 @@ def get_attributes(opts = {}) # List all attributes # @param [Hash] opts the optional parameters - # @return [Array<(GetAttributes, Fixnum, Hash)>] GetAttributes data, response status code and response headers + # @return [Array<(GetAttributes, Integer, Hash)>] GetAttributes data, response status code and response headers def get_attributes_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.get_attributes ...' @@ -594,35 +694,44 @@ def get_attributes_with_http_info(opts = {}) local_var_path = '/contacts/attributes' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetAttributes' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.get_attributes", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetAttributes') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get a contact's details - # @param identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value + # @param identifier [String] Email (urlencoded) OR ID of the contact OR its SMS attribute value # @param [Hash] opts the optional parameters # @return [GetExtendedContactDetails] def get_contact_info(identifier, opts = {}) @@ -631,9 +740,9 @@ def get_contact_info(identifier, opts = {}) end # Get a contact's details - # @param identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value + # @param identifier [String] Email (urlencoded) OR ID of the contact OR its SMS attribute value # @param [Hash] opts the optional parameters - # @return [Array<(GetExtendedContactDetails, Fixnum, Hash)>] GetExtendedContactDetails data, response status code and response headers + # @return [Array<(GetExtendedContactDetails, Integer, Hash)>] GetExtendedContactDetails data, response status code and response headers def get_contact_info_with_http_info(identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.get_contact_info ...' @@ -643,41 +752,50 @@ def get_contact_info_with_http_info(identifier, opts = {}) fail ArgumentError, "Missing the required parameter 'identifier' when calling ContactsApi.get_contact_info" end # resource path - local_var_path = '/contacts/{identifier}'.sub('{' + 'identifier' + '}', identifier.to_s) + local_var_path = '/contacts/{identifier}'.sub('{' + 'identifier' + '}', CGI.escape(identifier.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetExtendedContactDetails' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.get_contact_info", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetExtendedContactDetails') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_contact_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get email campaigns' statistics for a contact - # @param identifier Email (urlencoded) OR ID of the contact + # @param identifier [String] Email (urlencoded) OR ID of the contact # @param [Hash] opts the optional parameters - # @option opts [Date] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate - # @option opts [Date] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate + # @option opts [String] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate + # @option opts [String] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate # @return [GetContactCampaignStats] def get_contact_stats(identifier, opts = {}) data, _status_code, _headers = get_contact_stats_with_http_info(identifier, opts) @@ -685,11 +803,11 @@ def get_contact_stats(identifier, opts = {}) end # Get email campaigns' statistics for a contact - # @param identifier Email (urlencoded) OR ID of the contact + # @param identifier [String] Email (urlencoded) OR ID of the contact # @param [Hash] opts the optional parameters - # @option opts [Date] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate - # @option opts [Date] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate - # @return [Array<(GetContactCampaignStats, Fixnum, Hash)>] GetContactCampaignStats data, response status code and response headers + # @option opts [String] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate + # @option opts [String] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate + # @return [Array<(GetContactCampaignStats, Integer, Hash)>] GetContactCampaignStats data, response status code and response headers def get_contact_stats_with_http_info(identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.get_contact_stats ...' @@ -699,44 +817,53 @@ def get_contact_stats_with_http_info(identifier, opts = {}) fail ArgumentError, "Missing the required parameter 'identifier' when calling ContactsApi.get_contact_stats" end # resource path - local_var_path = '/contacts/{identifier}/campaignStats'.sub('{' + 'identifier' + '}', identifier.to_s) + local_var_path = '/contacts/{identifier}/campaignStats'.sub('{' + 'identifier' + '}', CGI.escape(identifier.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetContactCampaignStats' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.get_contact_stats", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetContactCampaignStats') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_contact_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get all the contacts # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents per page (default to 50) # @option opts [Integer] :offset Index of the first document of the page (default to 0) # @option opts [String] :modified_since Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetContacts] def get_contacts(opts = {}) data, _status_code, _headers = get_contacts_with_http_info(opts) @@ -749,7 +876,7 @@ def get_contacts(opts = {}) # @option opts [Integer] :offset Index of the first document of the page # @option opts [String] :modified_since Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetContacts, Fixnum, Hash)>] GetContacts data, response status code and response headers + # @return [Array<(GetContacts, Integer, Hash)>] GetContacts data, response status code and response headers def get_contacts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.get_contacts ...' @@ -758,51 +885,61 @@ def get_contacts_with_http_info(opts = {}) fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ContactsApi.get_contacts, must be smaller than or equal to 1000.' end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/contacts' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'modifiedSince'] = opts[:'modified_since'] if !opts[:'modified_since'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetContacts' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.get_contacts", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetContacts') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get contacts in a list - # @param list_id Id of the list + # @param list_id [Integer] Id of the list # @param [Hash] opts the optional parameters # @option opts [String] :modified_since Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. # @option opts [Integer] :limit Number of documents per page (default to 50) # @option opts [Integer] :offset Index of the first document of the page (default to 0) - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetContacts] def get_contacts_from_list(list_id, opts = {}) data, _status_code, _headers = get_contacts_from_list_with_http_info(list_id, opts) @@ -810,13 +947,13 @@ def get_contacts_from_list(list_id, opts = {}) end # Get contacts in a list - # @param list_id Id of the list + # @param list_id [Integer] Id of the list # @param [Hash] opts the optional parameters # @option opts [String] :modified_since Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. # @option opts [Integer] :limit Number of documents per page # @option opts [Integer] :offset Index of the first document of the page # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetContacts, Fixnum, Hash)>] GetContacts data, response status code and response headers + # @return [Array<(GetContacts, Integer, Hash)>] GetContacts data, response status code and response headers def get_contacts_from_list_with_http_info(list_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.get_contacts_from_list ...' @@ -829,46 +966,56 @@ def get_contacts_from_list_with_http_info(list_id, opts = {}) fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ContactsApi.get_contacts_from_list, must be smaller than or equal to 500.' end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/contacts/lists/{listId}/contacts'.sub('{' + 'listId' + '}', list_id.to_s) + local_var_path = '/contacts/lists/{listId}/contacts'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'modifiedSince'] = opts[:'modified_since'] if !opts[:'modified_since'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetContacts' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.get_contacts_from_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetContacts') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_contacts_from_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Returns a folder's details - # @param folder_id id of the folder + # @param folder_id [Integer] id of the folder # @param [Hash] opts the optional parameters # @return [GetFolder] def get_folder(folder_id, opts = {}) @@ -877,9 +1024,9 @@ def get_folder(folder_id, opts = {}) end # Returns a folder's details - # @param folder_id id of the folder + # @param folder_id [Integer] id of the folder # @param [Hash] opts the optional parameters - # @return [Array<(GetFolder, Fixnum, Hash)>] GetFolder data, response status code and response headers + # @return [Array<(GetFolder, Integer, Hash)>] GetFolder data, response status code and response headers def get_folder_with_http_info(folder_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.get_folder ...' @@ -889,42 +1036,51 @@ def get_folder_with_http_info(folder_id, opts = {}) fail ArgumentError, "Missing the required parameter 'folder_id' when calling ContactsApi.get_folder" end # resource path - local_var_path = '/contacts/folders/{folderId}'.sub('{' + 'folderId' + '}', folder_id.to_s) + local_var_path = '/contacts/folders/{folderId}'.sub('{' + 'folderId' + '}', CGI.escape(folder_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetFolder' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.get_folder", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetFolder') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get lists in a folder - # @param folder_id Id of the folder + # @param folder_id [Integer] Id of the folder # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents per page (default to 10) # @option opts [Integer] :offset Index of the first document of the page (default to 0) - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetFolderLists] def get_folder_lists(folder_id, opts = {}) data, _status_code, _headers = get_folder_lists_with_http_info(folder_id, opts) @@ -932,12 +1088,12 @@ def get_folder_lists(folder_id, opts = {}) end # Get lists in a folder - # @param folder_id Id of the folder + # @param folder_id [Integer] Id of the folder # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents per page # @option opts [Integer] :offset Index of the first document of the page # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetFolderLists, Fixnum, Hash)>] GetFolderLists data, response status code and response headers + # @return [Array<(GetFolderLists, Integer, Hash)>] GetFolderLists data, response status code and response headers def get_folder_lists_with_http_info(folder_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.get_folder_lists ...' @@ -950,48 +1106,58 @@ def get_folder_lists_with_http_info(folder_id, opts = {}) fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ContactsApi.get_folder_lists, must be smaller than or equal to 50.' end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/contacts/folders/{folderId}/lists'.sub('{' + 'folderId' + '}', folder_id.to_s) + local_var_path = '/contacts/folders/{folderId}/lists'.sub('{' + 'folderId' + '}', CGI.escape(folder_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetFolderLists' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.get_folder_lists", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetFolderLists') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_folder_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get all folders - # @param limit Number of documents per page - # @param offset Index of the first document of the page + # @param limit [Integer] Number of documents per page + # @param offset [Integer] Index of the first document of the page # @param [Hash] opts the optional parameters - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetFolders] def get_folders(limit, offset, opts = {}) data, _status_code, _headers = get_folders_with_http_info(limit, offset, opts) @@ -999,11 +1165,11 @@ def get_folders(limit, offset, opts = {}) end # Get all folders - # @param limit Number of documents per page - # @param offset Index of the first document of the page + # @param limit [Integer] Number of documents per page + # @param offset [Integer] Index of the first document of the page # @param [Hash] opts the optional parameters # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetFolders, Fixnum, Hash)>] GetFolders data, response status code and response headers + # @return [Array<(GetFolders, Integer, Hash)>] GetFolders data, response status code and response headers def get_folders_with_http_info(limit, offset, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.get_folders ...' @@ -1020,45 +1186,55 @@ def get_folders_with_http_info(limit, offset, opts = {}) if @api_client.config.client_side_validation && offset.nil? fail ArgumentError, "Missing the required parameter 'offset' when calling ContactsApi.get_folders" end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/contacts/folders' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'limit'] = limit query_params[:'offset'] = offset query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetFolders' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.get_folders", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetFolders') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_folders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get a list's details - # @param list_id Id of the list + # @param list_id [Integer] Id of the list # @param [Hash] opts the optional parameters # @return [GetExtendedList] def get_list(list_id, opts = {}) @@ -1067,9 +1243,9 @@ def get_list(list_id, opts = {}) end # Get a list's details - # @param list_id Id of the list + # @param list_id [Integer] Id of the list # @param [Hash] opts the optional parameters - # @return [Array<(GetExtendedList, Fixnum, Hash)>] GetExtendedList data, response status code and response headers + # @return [Array<(GetExtendedList, Integer, Hash)>] GetExtendedList data, response status code and response headers def get_list_with_http_info(list_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.get_list ...' @@ -1079,41 +1255,50 @@ def get_list_with_http_info(list_id, opts = {}) fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactsApi.get_list" end # resource path - local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', list_id.to_s) + local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetExtendedList' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.get_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetExtendedList') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get all the lists # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents per page (default to 10) # @option opts [Integer] :offset Index of the first document of the page (default to 0) - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetLists] def get_lists(opts = {}) data, _status_code, _headers = get_lists_with_http_info(opts) @@ -1125,7 +1310,7 @@ def get_lists(opts = {}) # @option opts [Integer] :limit Number of documents per page # @option opts [Integer] :offset Index of the first document of the page # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetLists, Fixnum, Hash)>] GetLists data, response status code and response headers + # @return [Array<(GetLists, Integer, Hash)>] GetLists data, response status code and response headers def get_lists_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.get_lists ...' @@ -1134,46 +1319,56 @@ def get_lists_with_http_info(opts = {}) fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ContactsApi.get_lists, must be smaller than or equal to 50.' end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/contacts/lists' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetLists' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.get_lists", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetLists') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Import contacts # It returns the background process ID which on completion calls the notify URL that you have set in the input. - # @param request_contact_import Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` + # @param request_contact_import [RequestContactImport] Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` # @param [Hash] opts the optional parameters # @return [CreatedProcessId] def import_contacts(request_contact_import, opts = {}) @@ -1183,9 +1378,9 @@ def import_contacts(request_contact_import, opts = {}) # Import contacts # It returns the background process ID which on completion calls the notify URL that you have set in the input. - # @param request_contact_import Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` + # @param request_contact_import [RequestContactImport] Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns`` # @param [Hash] opts the optional parameters - # @return [Array<(CreatedProcessId, Fixnum, Hash)>] CreatedProcessId data, response status code and response headers + # @return [Array<(CreatedProcessId, Integer, Hash)>] CreatedProcessId data, response status code and response headers def import_contacts_with_http_info(request_contact_import, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.import_contacts ...' @@ -1198,36 +1393,47 @@ def import_contacts_with_http_info(request_contact_import, opts = {}) local_var_path = '/contacts/import' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(request_contact_import) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(request_contact_import) + + # return_type + return_type = opts[:debug_return_type] || 'CreatedProcessId' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.import_contacts", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'CreatedProcessId') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#import_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Delete a contact from a list - # @param list_id Id of the list - # @param contact_emails Emails addresses OR IDs of the contacts + # @param list_id [Integer] Id of the list + # @param contact_emails [RemoveContactFromList] Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters # @return [PostContactInfo] def remove_contact_from_list(list_id, contact_emails, opts = {}) @@ -1236,10 +1442,10 @@ def remove_contact_from_list(list_id, contact_emails, opts = {}) end # Delete a contact from a list - # @param list_id Id of the list - # @param contact_emails Emails addresses OR IDs of the contacts + # @param list_id [Integer] Id of the list + # @param contact_emails [RemoveContactFromList] Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters - # @return [Array<(PostContactInfo, Fixnum, Hash)>] PostContactInfo data, response status code and response headers + # @return [Array<(PostContactInfo, Integer, Hash)>] PostContactInfo data, response status code and response headers def remove_contact_from_list_with_http_info(list_id, contact_emails, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.remove_contact_from_list ...' @@ -1253,39 +1459,50 @@ def remove_contact_from_list_with_http_info(list_id, contact_emails, opts = {}) fail ArgumentError, "Missing the required parameter 'contact_emails' when calling ContactsApi.remove_contact_from_list" end # resource path - local_var_path = '/contacts/lists/{listId}/contacts/remove'.sub('{' + 'listId' + '}', list_id.to_s) + local_var_path = '/contacts/lists/{listId}/contacts/remove'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(contact_emails) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(contact_emails) + + # return_type + return_type = opts[:debug_return_type] || 'PostContactInfo' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.remove_contact_from_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'PostContactInfo') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#remove_contact_from_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Export contacts # It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. - # @param request_contact_export Values to request a contact export + # @param request_contact_export [RequestContactExport] Values to request a contact export # @param [Hash] opts the optional parameters # @return [CreatedProcessId] def request_contact_export(request_contact_export, opts = {}) @@ -1295,9 +1512,9 @@ def request_contact_export(request_contact_export, opts = {}) # Export contacts # It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv. - # @param request_contact_export Values to request a contact export + # @param request_contact_export [RequestContactExport] Values to request a contact export # @param [Hash] opts the optional parameters - # @return [Array<(CreatedProcessId, Fixnum, Hash)>] CreatedProcessId data, response status code and response headers + # @return [Array<(CreatedProcessId, Integer, Hash)>] CreatedProcessId data, response status code and response headers def request_contact_export_with_http_info(request_contact_export, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.request_contact_export ...' @@ -1310,37 +1527,48 @@ def request_contact_export_with_http_info(request_contact_export, opts = {}) local_var_path = '/contacts/export' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(request_contact_export) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(request_contact_export) + + # return_type + return_type = opts[:debug_return_type] || 'CreatedProcessId' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.request_contact_export", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'CreatedProcessId') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#request_contact_export\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Update contact attribute - # @param attribute_category Category of the attribute - # @param attribute_name Name of the existing attribute - # @param update_attribute Values to update an attribute + # @param attribute_category [String] Category of the attribute + # @param attribute_name [String] Name of the existing attribute + # @param update_attribute [UpdateAttribute] Values to update an attribute # @param [Hash] opts the optional parameters # @return [nil] def update_attribute(attribute_category, attribute_name, update_attribute, opts = {}) @@ -1349,11 +1577,11 @@ def update_attribute(attribute_category, attribute_name, update_attribute, opts end # Update contact attribute - # @param attribute_category Category of the attribute - # @param attribute_name Name of the existing attribute - # @param update_attribute Values to update an attribute + # @param attribute_category [String] Category of the attribute + # @param attribute_name [String] Name of the existing attribute + # @param update_attribute [UpdateAttribute] Values to update an attribute # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_attribute_with_http_info(attribute_category, attribute_name, update_attribute, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.update_attribute ...' @@ -1363,8 +1591,9 @@ def update_attribute_with_http_info(attribute_category, attribute_name, update_a fail ArgumentError, "Missing the required parameter 'attribute_category' when calling ContactsApi.update_attribute" end # verify enum value - if @api_client.config.client_side_validation && !['category', 'calculated', 'global'].include?(attribute_category) - fail ArgumentError, "invalid value for 'attribute_category', must be one of category, calculated, global" + allowable_values = ["category", "calculated", "global"] + if @api_client.config.client_side_validation && !allowable_values.include?(attribute_category) + fail ArgumentError, "invalid value for \"attribute_category\", must be one of #{allowable_values}" end # verify the required parameter 'attribute_name' is set if @api_client.config.client_side_validation && attribute_name.nil? @@ -1375,38 +1604,50 @@ def update_attribute_with_http_info(attribute_category, attribute_name, update_a fail ArgumentError, "Missing the required parameter 'update_attribute' when calling ContactsApi.update_attribute" end # resource path - local_var_path = '/contacts/attributes/{attributeCategory}/{attributeName}'.sub('{' + 'attributeCategory' + '}', attribute_category.to_s).sub('{' + 'attributeName' + '}', attribute_name.to_s) + local_var_path = '/contacts/attributes/{attributeCategory}/{attributeName}'.sub('{' + 'attributeCategory' + '}', CGI.escape(attribute_category.to_s)).sub('{' + 'attributeName' + '}', CGI.escape(attribute_name.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(update_attribute) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(update_attribute) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.update_attribute", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#update_attribute\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Update a contact - # @param identifier Email (urlencoded) OR ID of the contact - # @param update_contact Values to update a contact + # @param identifier [String] Email (urlencoded) OR ID of the contact + # @param update_contact [UpdateContact] Values to update a contact # @param [Hash] opts the optional parameters # @return [nil] def update_contact(identifier, update_contact, opts = {}) @@ -1415,10 +1656,10 @@ def update_contact(identifier, update_contact, opts = {}) end # Update a contact - # @param identifier Email (urlencoded) OR ID of the contact - # @param update_contact Values to update a contact + # @param identifier [String] Email (urlencoded) OR ID of the contact + # @param update_contact [UpdateContact] Values to update a contact # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_contact_with_http_info(identifier, update_contact, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.update_contact ...' @@ -1432,38 +1673,50 @@ def update_contact_with_http_info(identifier, update_contact, opts = {}) fail ArgumentError, "Missing the required parameter 'update_contact' when calling ContactsApi.update_contact" end # resource path - local_var_path = '/contacts/{identifier}'.sub('{' + 'identifier' + '}', identifier.to_s) + local_var_path = '/contacts/{identifier}'.sub('{' + 'identifier' + '}', CGI.escape(identifier.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(update_contact) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(update_contact) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.update_contact", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#update_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Update a folder - # @param folder_id Id of the folder - # @param update_folder Name of the folder + # @param folder_id [Integer] Id of the folder + # @param update_folder [CreateUpdateFolder] Name of the folder # @param [Hash] opts the optional parameters # @return [nil] def update_folder(folder_id, update_folder, opts = {}) @@ -1472,10 +1725,10 @@ def update_folder(folder_id, update_folder, opts = {}) end # Update a folder - # @param folder_id Id of the folder - # @param update_folder Name of the folder + # @param folder_id [Integer] Id of the folder + # @param update_folder [CreateUpdateFolder] Name of the folder # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_folder_with_http_info(folder_id, update_folder, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.update_folder ...' @@ -1489,38 +1742,50 @@ def update_folder_with_http_info(folder_id, update_folder, opts = {}) fail ArgumentError, "Missing the required parameter 'update_folder' when calling ContactsApi.update_folder" end # resource path - local_var_path = '/contacts/folders/{folderId}'.sub('{' + 'folderId' + '}', folder_id.to_s) + local_var_path = '/contacts/folders/{folderId}'.sub('{' + 'folderId' + '}', CGI.escape(folder_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(update_folder) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(update_folder) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.update_folder", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#update_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Update a list - # @param list_id Id of the list - # @param update_list Values to update a list + # @param list_id [Integer] Id of the list + # @param update_list [UpdateList] Values to update a list # @param [Hash] opts the optional parameters # @return [nil] def update_list(list_id, update_list, opts = {}) @@ -1529,10 +1794,10 @@ def update_list(list_id, update_list, opts = {}) end # Update a list - # @param list_id Id of the list - # @param update_list Values to update a list + # @param list_id [Integer] Id of the list + # @param update_list [UpdateList] Values to update a list # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_list_with_http_info(list_id, update_list, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.update_list ...' @@ -1546,30 +1811,41 @@ def update_list_with_http_info(list_id, update_list, opts = {}) fail ArgumentError, "Missing the required parameter 'update_list' when calling ContactsApi.update_list" end # resource path - local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', list_id.to_s) + local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(update_list) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(update_list) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ContactsApi.update_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#update_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/sib-api-v3-sdk/api/email_campaigns_api.rb b/lib/sib-api-v3-sdk/api/email_campaigns_api.rb index a097330..1436f66 100644 --- a/lib/sib-api-v3-sdk/api/email_campaigns_api.rb +++ b/lib/sib-api-v3-sdk/api/email_campaigns_api.rb @@ -3,14 +3,14 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end -require 'uri' +require 'cgi' module SibApiV3Sdk class EmailCampaignsApi @@ -19,18 +19,8 @@ class EmailCampaignsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - - # Set custom user_agent if explicitly passed in api - # default will still remain Swagger-Codegen/#{VERSION}/ruby - def setUserAgent(user_agent) - @user_agent = user_agent - if user_agent.is_a?(String) && user_agent.downcase.start_with?('sendinblue_') - @api_client.default_headers['User-Agent'] = @user_agent - end - end - # Create an email campaign - # @param email_campaigns Values to create a campaign + # @param email_campaigns [CreateEmailCampaign] Values to create a campaign # @param [Hash] opts the optional parameters # @return [CreateModel] def create_email_campaign(email_campaigns, opts = {}) @@ -39,9 +29,9 @@ def create_email_campaign(email_campaigns, opts = {}) end # Create an email campaign - # @param email_campaigns Values to create a campaign + # @param email_campaigns [CreateEmailCampaign] Values to create a campaign # @param [Hash] opts the optional parameters - # @return [Array<(CreateModel, Fixnum, Hash)>] CreateModel data, response status code and response headers + # @return [Array<(CreateModel, Integer, Hash)>] CreateModel data, response status code and response headers def create_email_campaign_with_http_info(email_campaigns, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EmailCampaignsApi.create_email_campaign ...' @@ -54,35 +44,46 @@ def create_email_campaign_with_http_info(email_campaigns, opts = {}) local_var_path = '/emailCampaigns' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(email_campaigns) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(email_campaigns) + + # return_type + return_type = opts[:debug_return_type] || 'CreateModel' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"EmailCampaignsApi.create_email_campaign", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'CreateModel') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EmailCampaignsApi#create_email_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Delete an email campaign - # @param campaign_id id of the campaign + # @param campaign_id [Integer] id of the campaign # @param [Hash] opts the optional parameters # @return [nil] def delete_email_campaign(campaign_id, opts = {}) @@ -91,9 +92,9 @@ def delete_email_campaign(campaign_id, opts = {}) end # Delete an email campaign - # @param campaign_id id of the campaign + # @param campaign_id [Integer] id of the campaign # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_email_campaign_with_http_info(campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EmailCampaignsApi.delete_email_campaign ...' @@ -103,37 +104,47 @@ def delete_email_campaign_with_http_info(campaign_id, opts = {}) fail ArgumentError, "Missing the required parameter 'campaign_id' when calling EmailCampaignsApi.delete_email_campaign" end # resource path - local_var_path = '/emailCampaigns/{campaignId}'.sub('{' + 'campaignId' + '}', campaign_id.to_s) + local_var_path = '/emailCampaigns/{campaignId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"EmailCampaignsApi.delete_email_campaign", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EmailCampaignsApi#delete_email_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Export the recipients of an email campaign - # @param campaign_id Id of the campaign + # @param campaign_id [Integer] Id of the campaign # @param [Hash] opts the optional parameters # @option opts [EmailExportRecipients] :recipient_export Values to send for a recipient export request # @return [CreatedProcessId] @@ -143,10 +154,10 @@ def email_export_recipients(campaign_id, opts = {}) end # Export the recipients of an email campaign - # @param campaign_id Id of the campaign + # @param campaign_id [Integer] Id of the campaign # @param [Hash] opts the optional parameters # @option opts [EmailExportRecipients] :recipient_export Values to send for a recipient export request - # @return [Array<(CreatedProcessId, Fixnum, Hash)>] CreatedProcessId data, response status code and response headers + # @return [Array<(CreatedProcessId, Integer, Hash)>] CreatedProcessId data, response status code and response headers def email_export_recipients_with_http_info(campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EmailCampaignsApi.email_export_recipients ...' @@ -156,39 +167,50 @@ def email_export_recipients_with_http_info(campaign_id, opts = {}) fail ArgumentError, "Missing the required parameter 'campaign_id' when calling EmailCampaignsApi.email_export_recipients" end # resource path - local_var_path = '/emailCampaigns/{campaignId}/exportRecipients'.sub('{' + 'campaignId' + '}', campaign_id.to_s) + local_var_path = '/emailCampaigns/{campaignId}/exportRecipients'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(opts[:'recipient_export']) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'recipient_export']) + + # return_type + return_type = opts[:debug_return_type] || 'CreatedProcessId' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"EmailCampaignsApi.email_export_recipients", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'CreatedProcessId') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EmailCampaignsApi#email_export_recipients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get an A/B test email campaign results # Obtain winning version of an A/B test email campaign - # @param campaign_id Id of the A/B test campaign + # @param campaign_id [Integer] Id of the A/B test campaign # @param [Hash] opts the optional parameters # @return [AbTestCampaignResult] def get_ab_test_campaign_result(campaign_id, opts = {}) @@ -198,9 +220,9 @@ def get_ab_test_campaign_result(campaign_id, opts = {}) # Get an A/B test email campaign results # Obtain winning version of an A/B test email campaign - # @param campaign_id Id of the A/B test campaign + # @param campaign_id [Integer] Id of the A/B test campaign # @param [Hash] opts the optional parameters - # @return [Array<(AbTestCampaignResult, Fixnum, Hash)>] AbTestCampaignResult data, response status code and response headers + # @return [Array<(AbTestCampaignResult, Integer, Hash)>] AbTestCampaignResult data, response status code and response headers def get_ab_test_campaign_result_with_http_info(campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EmailCampaignsApi.get_ab_test_campaign_result ...' @@ -210,38 +232,47 @@ def get_ab_test_campaign_result_with_http_info(campaign_id, opts = {}) fail ArgumentError, "Missing the required parameter 'campaign_id' when calling EmailCampaignsApi.get_ab_test_campaign_result" end # resource path - local_var_path = '/emailCampaigns/{campaignId}/abTestCampaignResult'.sub('{' + 'campaignId' + '}', campaign_id.to_s) + local_var_path = '/emailCampaigns/{campaignId}/abTestCampaignResult'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AbTestCampaignResult' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"EmailCampaignsApi.get_ab_test_campaign_result", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'AbTestCampaignResult') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EmailCampaignsApi#get_ab_test_campaign_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get an email campaign report - # @param campaign_id Id of the campaign + # @param campaign_id [Integer] Id of the campaign # @param [Hash] opts the optional parameters # @return [GetEmailCampaign] def get_email_campaign(campaign_id, opts = {}) @@ -250,9 +281,9 @@ def get_email_campaign(campaign_id, opts = {}) end # Get an email campaign report - # @param campaign_id Id of the campaign + # @param campaign_id [Integer] Id of the campaign # @param [Hash] opts the optional parameters - # @return [Array<(GetEmailCampaign, Fixnum, Hash)>] GetEmailCampaign data, response status code and response headers + # @return [Array<(GetEmailCampaign, Integer, Hash)>] GetEmailCampaign data, response status code and response headers def get_email_campaign_with_http_info(campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EmailCampaignsApi.get_email_campaign ...' @@ -262,36 +293,45 @@ def get_email_campaign_with_http_info(campaign_id, opts = {}) fail ArgumentError, "Missing the required parameter 'campaign_id' when calling EmailCampaignsApi.get_email_campaign" end # resource path - local_var_path = '/emailCampaigns/{campaignId}'.sub('{' + 'campaignId' + '}', campaign_id.to_s) + local_var_path = '/emailCampaigns/{campaignId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetEmailCampaign' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"EmailCampaignsApi.get_email_campaign", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetEmailCampaign') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EmailCampaignsApi#get_email_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Return all your created email campaigns # @param [Hash] opts the optional parameters # @option opts [String] :type Filter on the type of the campaigns @@ -300,7 +340,7 @@ def get_email_campaign_with_http_info(campaign_id, opts = {}) # @option opts [String] :end_date Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' ) # @option opts [Integer] :limit Number of documents per page (default to 500) # @option opts [Integer] :offset Index of the first document in the page (default to 0) - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetEmailCampaigns] def get_email_campaigns(opts = {}) data, _status_code, _headers = get_email_campaigns_with_http_info(opts) @@ -316,29 +356,32 @@ def get_email_campaigns(opts = {}) # @option opts [Integer] :limit Number of documents per page # @option opts [Integer] :offset Index of the first document in the page # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetEmailCampaigns, Fixnum, Hash)>] GetEmailCampaigns data, response status code and response headers + # @return [Array<(GetEmailCampaigns, Integer, Hash)>] GetEmailCampaigns data, response status code and response headers def get_email_campaigns_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EmailCampaignsApi.get_email_campaigns ...' end - if @api_client.config.client_side_validation && opts[:'type'] && !['classic', 'trigger'].include?(opts[:'type']) - fail ArgumentError, 'invalid value for "type", must be one of classic, trigger' + allowable_values = ["classic", "trigger"] + if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type']) + fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}" end - if @api_client.config.client_side_validation && opts[:'status'] && !['suspended', 'archive', 'sent', 'queued', 'draft', 'inProcess'].include?(opts[:'status']) - fail ArgumentError, 'invalid value for "status", must be one of suspended, archive, sent, queued, draft, inProcess' + allowable_values = ["suspended", "archive", "sent", "queued", "draft", "inProcess"] + if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) + fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling EmailCampaignsApi.get_email_campaigns, must be smaller than or equal to 1000.' end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/emailCampaigns' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? @@ -348,33 +391,42 @@ def get_email_campaigns_with_http_info(opts = {}) query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['application/json', 'applications/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetEmailCampaigns' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"EmailCampaignsApi.get_email_campaigns", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetEmailCampaigns') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EmailCampaignsApi#get_email_campaigns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get a shared template url # Get a unique URL to share & import an email template from one Sendinblue account to another. - # @param campaign_id Id of the campaign or template + # @param campaign_id [Integer] Id of the campaign or template # @param [Hash] opts the optional parameters # @return [GetSharedTemplateUrl] def get_shared_template_url(campaign_id, opts = {}) @@ -384,9 +436,9 @@ def get_shared_template_url(campaign_id, opts = {}) # Get a shared template url # Get a unique URL to share & import an email template from one Sendinblue account to another. - # @param campaign_id Id of the campaign or template + # @param campaign_id [Integer] Id of the campaign or template # @param [Hash] opts the optional parameters - # @return [Array<(GetSharedTemplateUrl, Fixnum, Hash)>] GetSharedTemplateUrl data, response status code and response headers + # @return [Array<(GetSharedTemplateUrl, Integer, Hash)>] GetSharedTemplateUrl data, response status code and response headers def get_shared_template_url_with_http_info(campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EmailCampaignsApi.get_shared_template_url ...' @@ -396,38 +448,47 @@ def get_shared_template_url_with_http_info(campaign_id, opts = {}) fail ArgumentError, "Missing the required parameter 'campaign_id' when calling EmailCampaignsApi.get_shared_template_url" end # resource path - local_var_path = '/emailCampaigns/{campaignId}/sharedUrl'.sub('{' + 'campaignId' + '}', campaign_id.to_s) + local_var_path = '/emailCampaigns/{campaignId}/sharedUrl'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetSharedTemplateUrl' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"EmailCampaignsApi.get_shared_template_url", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetSharedTemplateUrl') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EmailCampaignsApi#get_shared_template_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Send an email campaign immediately, based on campaignId - # @param campaign_id Id of the campaign + # @param campaign_id [Integer] Id of the campaign # @param [Hash] opts the optional parameters # @return [nil] def send_email_campaign_now(campaign_id, opts = {}) @@ -436,9 +497,9 @@ def send_email_campaign_now(campaign_id, opts = {}) end # Send an email campaign immediately, based on campaignId - # @param campaign_id Id of the campaign + # @param campaign_id [Integer] Id of the campaign # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def send_email_campaign_now_with_http_info(campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EmailCampaignsApi.send_email_campaign_now ...' @@ -448,39 +509,49 @@ def send_email_campaign_now_with_http_info(campaign_id, opts = {}) fail ArgumentError, "Missing the required parameter 'campaign_id' when calling EmailCampaignsApi.send_email_campaign_now" end # resource path - local_var_path = '/emailCampaigns/{campaignId}/sendNow'.sub('{' + 'campaignId' + '}', campaign_id.to_s) + local_var_path = '/emailCampaigns/{campaignId}/sendNow'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"EmailCampaignsApi.send_email_campaign_now", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EmailCampaignsApi#send_email_campaign_now\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Send the report of a campaign # A PDF will be sent to the specified email addresses - # @param campaign_id Id of the campaign - # @param send_report Values for send a report + # @param campaign_id [Integer] Id of the campaign + # @param send_report [SendReport] Values for send a report # @param [Hash] opts the optional parameters # @return [nil] def send_report(campaign_id, send_report, opts = {}) @@ -490,10 +561,10 @@ def send_report(campaign_id, send_report, opts = {}) # Send the report of a campaign # A PDF will be sent to the specified email addresses - # @param campaign_id Id of the campaign - # @param send_report Values for send a report + # @param campaign_id [Integer] Id of the campaign + # @param send_report [SendReport] Values for send a report # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def send_report_with_http_info(campaign_id, send_report, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EmailCampaignsApi.send_report ...' @@ -507,38 +578,50 @@ def send_report_with_http_info(campaign_id, send_report, opts = {}) fail ArgumentError, "Missing the required parameter 'send_report' when calling EmailCampaignsApi.send_report" end # resource path - local_var_path = '/emailCampaigns/{campaignId}/sendReport'.sub('{' + 'campaignId' + '}', campaign_id.to_s) + local_var_path = '/emailCampaigns/{campaignId}/sendReport'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(send_report) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(send_report) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"EmailCampaignsApi.send_report", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EmailCampaignsApi#send_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Send an email campaign to your test list - # @param campaign_id Id of the campaign - # @param email_to + # @param campaign_id [Integer] Id of the campaign + # @param email_to [SendTestEmail] # @param [Hash] opts the optional parameters # @return [nil] def send_test_email(campaign_id, email_to, opts = {}) @@ -547,10 +630,10 @@ def send_test_email(campaign_id, email_to, opts = {}) end # Send an email campaign to your test list - # @param campaign_id Id of the campaign - # @param email_to + # @param campaign_id [Integer] Id of the campaign + # @param email_to [SendTestEmail] # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def send_test_email_with_http_info(campaign_id, email_to, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EmailCampaignsApi.send_test_email ...' @@ -564,38 +647,50 @@ def send_test_email_with_http_info(campaign_id, email_to, opts = {}) fail ArgumentError, "Missing the required parameter 'email_to' when calling EmailCampaignsApi.send_test_email" end # resource path - local_var_path = '/emailCampaigns/{campaignId}/sendTest'.sub('{' + 'campaignId' + '}', campaign_id.to_s) + local_var_path = '/emailCampaigns/{campaignId}/sendTest'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(email_to) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(email_to) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"EmailCampaignsApi.send_test_email", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EmailCampaignsApi#send_test_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Update an email campaign status - # @param campaign_id Id of the campaign - # @param status Status of the campaign + # @param campaign_id [Integer] Id of the campaign + # @param status [UpdateCampaignStatus] Status of the campaign # @param [Hash] opts the optional parameters # @return [nil] def update_campaign_status(campaign_id, status, opts = {}) @@ -604,10 +699,10 @@ def update_campaign_status(campaign_id, status, opts = {}) end # Update an email campaign status - # @param campaign_id Id of the campaign - # @param status Status of the campaign + # @param campaign_id [Integer] Id of the campaign + # @param status [UpdateCampaignStatus] Status of the campaign # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_campaign_status_with_http_info(campaign_id, status, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EmailCampaignsApi.update_campaign_status ...' @@ -621,38 +716,50 @@ def update_campaign_status_with_http_info(campaign_id, status, opts = {}) fail ArgumentError, "Missing the required parameter 'status' when calling EmailCampaignsApi.update_campaign_status" end # resource path - local_var_path = '/emailCampaigns/{campaignId}/status'.sub('{' + 'campaignId' + '}', campaign_id.to_s) + local_var_path = '/emailCampaigns/{campaignId}/status'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(status) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(status) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"EmailCampaignsApi.update_campaign_status", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EmailCampaignsApi#update_campaign_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Update an email campaign - # @param campaign_id Id of the campaign - # @param email_campaign Values to update a campaign + # @param campaign_id [Integer] Id of the campaign + # @param email_campaign [UpdateEmailCampaign] Values to update a campaign # @param [Hash] opts the optional parameters # @return [nil] def update_email_campaign(campaign_id, email_campaign, opts = {}) @@ -661,10 +768,10 @@ def update_email_campaign(campaign_id, email_campaign, opts = {}) end # Update an email campaign - # @param campaign_id Id of the campaign - # @param email_campaign Values to update a campaign + # @param campaign_id [Integer] Id of the campaign + # @param email_campaign [UpdateEmailCampaign] Values to update a campaign # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_email_campaign_with_http_info(campaign_id, email_campaign, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EmailCampaignsApi.update_email_campaign ...' @@ -678,37 +785,49 @@ def update_email_campaign_with_http_info(campaign_id, email_campaign, opts = {}) fail ArgumentError, "Missing the required parameter 'email_campaign' when calling EmailCampaignsApi.update_email_campaign" end # resource path - local_var_path = '/emailCampaigns/{campaignId}'.sub('{' + 'campaignId' + '}', campaign_id.to_s) + local_var_path = '/emailCampaigns/{campaignId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(email_campaign) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(email_campaign) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"EmailCampaignsApi.update_email_campaign", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EmailCampaignsApi#update_email_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Upload an image to your account's image gallery - # @param upload_image Parameters to upload an image + # @param upload_image [UploadImageToGallery] Parameters to upload an image # @param [Hash] opts the optional parameters # @return [nil] def upload_image_to_gallery(upload_image, opts = {}) @@ -717,9 +836,9 @@ def upload_image_to_gallery(upload_image, opts = {}) end # Upload an image to your account's image gallery - # @param upload_image Parameters to upload an image + # @param upload_image [UploadImageToGallery] Parameters to upload an image # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def upload_image_to_gallery_with_http_info(upload_image, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EmailCampaignsApi.upload_image_to_gallery ...' @@ -732,27 +851,38 @@ def upload_image_to_gallery_with_http_info(upload_image, opts = {}) local_var_path = '/emailCampaigns/images' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(upload_image) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(upload_image) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"EmailCampaignsApi.upload_image_to_gallery", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: EmailCampaignsApi#upload_image_to_gallery\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/sib-api-v3-sdk/api/folders_api.rb b/lib/sib-api-v3-sdk/api/folders_api.rb index b067cbd..90dd572 100644 --- a/lib/sib-api-v3-sdk/api/folders_api.rb +++ b/lib/sib-api-v3-sdk/api/folders_api.rb @@ -3,14 +3,14 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end -require 'uri' +require 'cgi' module SibApiV3Sdk class FoldersApi @@ -19,18 +19,8 @@ class FoldersApi def initialize(api_client = ApiClient.default) @api_client = api_client end - - # Set custom user_agent if explicitly passed in api - # default will still remain Swagger-Codegen/#{VERSION}/ruby - def setUserAgent(user_agent) - @user_agent = user_agent - if user_agent.is_a?(String) && user_agent.downcase.start_with?('sendinblue_') - @api_client.default_headers['User-Agent'] = @user_agent - end - end - # Create a folder - # @param create_folder Name of the folder + # @param create_folder [CreateUpdateFolder] Name of the folder # @param [Hash] opts the optional parameters # @return [CreateModel] def create_folder(create_folder, opts = {}) @@ -39,9 +29,9 @@ def create_folder(create_folder, opts = {}) end # Create a folder - # @param create_folder Name of the folder + # @param create_folder [CreateUpdateFolder] Name of the folder # @param [Hash] opts the optional parameters - # @return [Array<(CreateModel, Fixnum, Hash)>] CreateModel data, response status code and response headers + # @return [Array<(CreateModel, Integer, Hash)>] CreateModel data, response status code and response headers def create_folder_with_http_info(create_folder, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FoldersApi.create_folder ...' @@ -54,35 +44,46 @@ def create_folder_with_http_info(create_folder, opts = {}) local_var_path = '/contacts/folders' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(create_folder) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_folder) + + # return_type + return_type = opts[:debug_return_type] || 'CreateModel' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"FoldersApi.create_folder", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'CreateModel') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FoldersApi#create_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Delete a folder (and all its lists) - # @param folder_id Id of the folder + # @param folder_id [Integer] Id of the folder # @param [Hash] opts the optional parameters # @return [nil] def delete_folder(folder_id, opts = {}) @@ -91,9 +92,9 @@ def delete_folder(folder_id, opts = {}) end # Delete a folder (and all its lists) - # @param folder_id Id of the folder + # @param folder_id [Integer] Id of the folder # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_folder_with_http_info(folder_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FoldersApi.delete_folder ...' @@ -103,37 +104,47 @@ def delete_folder_with_http_info(folder_id, opts = {}) fail ArgumentError, "Missing the required parameter 'folder_id' when calling FoldersApi.delete_folder" end # resource path - local_var_path = '/contacts/folders/{folderId}'.sub('{' + 'folderId' + '}', folder_id.to_s) + local_var_path = '/contacts/folders/{folderId}'.sub('{' + 'folderId' + '}', CGI.escape(folder_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"FoldersApi.delete_folder", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FoldersApi#delete_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Returns a folder's details - # @param folder_id id of the folder + # @param folder_id [Integer] id of the folder # @param [Hash] opts the optional parameters # @return [GetFolder] def get_folder(folder_id, opts = {}) @@ -142,9 +153,9 @@ def get_folder(folder_id, opts = {}) end # Returns a folder's details - # @param folder_id id of the folder + # @param folder_id [Integer] id of the folder # @param [Hash] opts the optional parameters - # @return [Array<(GetFolder, Fixnum, Hash)>] GetFolder data, response status code and response headers + # @return [Array<(GetFolder, Integer, Hash)>] GetFolder data, response status code and response headers def get_folder_with_http_info(folder_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FoldersApi.get_folder ...' @@ -154,42 +165,51 @@ def get_folder_with_http_info(folder_id, opts = {}) fail ArgumentError, "Missing the required parameter 'folder_id' when calling FoldersApi.get_folder" end # resource path - local_var_path = '/contacts/folders/{folderId}'.sub('{' + 'folderId' + '}', folder_id.to_s) + local_var_path = '/contacts/folders/{folderId}'.sub('{' + 'folderId' + '}', CGI.escape(folder_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetFolder' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"FoldersApi.get_folder", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetFolder') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FoldersApi#get_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get lists in a folder - # @param folder_id Id of the folder + # @param folder_id [Integer] Id of the folder # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents per page (default to 10) # @option opts [Integer] :offset Index of the first document of the page (default to 0) - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetFolderLists] def get_folder_lists(folder_id, opts = {}) data, _status_code, _headers = get_folder_lists_with_http_info(folder_id, opts) @@ -197,12 +217,12 @@ def get_folder_lists(folder_id, opts = {}) end # Get lists in a folder - # @param folder_id Id of the folder + # @param folder_id [Integer] Id of the folder # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents per page # @option opts [Integer] :offset Index of the first document of the page # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetFolderLists, Fixnum, Hash)>] GetFolderLists data, response status code and response headers + # @return [Array<(GetFolderLists, Integer, Hash)>] GetFolderLists data, response status code and response headers def get_folder_lists_with_http_info(folder_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FoldersApi.get_folder_lists ...' @@ -215,48 +235,58 @@ def get_folder_lists_with_http_info(folder_id, opts = {}) fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling FoldersApi.get_folder_lists, must be smaller than or equal to 50.' end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/contacts/folders/{folderId}/lists'.sub('{' + 'folderId' + '}', folder_id.to_s) + local_var_path = '/contacts/folders/{folderId}/lists'.sub('{' + 'folderId' + '}', CGI.escape(folder_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetFolderLists' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"FoldersApi.get_folder_lists", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetFolderLists') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FoldersApi#get_folder_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get all folders - # @param limit Number of documents per page - # @param offset Index of the first document of the page + # @param limit [Integer] Number of documents per page + # @param offset [Integer] Index of the first document of the page # @param [Hash] opts the optional parameters - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetFolders] def get_folders(limit, offset, opts = {}) data, _status_code, _headers = get_folders_with_http_info(limit, offset, opts) @@ -264,11 +294,11 @@ def get_folders(limit, offset, opts = {}) end # Get all folders - # @param limit Number of documents per page - # @param offset Index of the first document of the page + # @param limit [Integer] Number of documents per page + # @param offset [Integer] Index of the first document of the page # @param [Hash] opts the optional parameters # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetFolders, Fixnum, Hash)>] GetFolders data, response status code and response headers + # @return [Array<(GetFolders, Integer, Hash)>] GetFolders data, response status code and response headers def get_folders_with_http_info(limit, offset, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FoldersApi.get_folders ...' @@ -285,46 +315,56 @@ def get_folders_with_http_info(limit, offset, opts = {}) if @api_client.config.client_side_validation && offset.nil? fail ArgumentError, "Missing the required parameter 'offset' when calling FoldersApi.get_folders" end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/contacts/folders' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'limit'] = limit query_params[:'offset'] = offset query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetFolders' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"FoldersApi.get_folders", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetFolders') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FoldersApi#get_folders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Update a folder - # @param folder_id Id of the folder - # @param update_folder Name of the folder + # @param folder_id [Integer] Id of the folder + # @param update_folder [CreateUpdateFolder] Name of the folder # @param [Hash] opts the optional parameters # @return [nil] def update_folder(folder_id, update_folder, opts = {}) @@ -333,10 +373,10 @@ def update_folder(folder_id, update_folder, opts = {}) end # Update a folder - # @param folder_id Id of the folder - # @param update_folder Name of the folder + # @param folder_id [Integer] Id of the folder + # @param update_folder [CreateUpdateFolder] Name of the folder # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_folder_with_http_info(folder_id, update_folder, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: FoldersApi.update_folder ...' @@ -350,30 +390,41 @@ def update_folder_with_http_info(folder_id, update_folder, opts = {}) fail ArgumentError, "Missing the required parameter 'update_folder' when calling FoldersApi.update_folder" end # resource path - local_var_path = '/contacts/folders/{folderId}'.sub('{' + 'folderId' + '}', folder_id.to_s) + local_var_path = '/contacts/folders/{folderId}'.sub('{' + 'folderId' + '}', CGI.escape(folder_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(update_folder) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(update_folder) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"FoldersApi.update_folder", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: FoldersApi#update_folder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/sib-api-v3-sdk/api/lists_api.rb b/lib/sib-api-v3-sdk/api/lists_api.rb index f116553..ceaaebc 100644 --- a/lib/sib-api-v3-sdk/api/lists_api.rb +++ b/lib/sib-api-v3-sdk/api/lists_api.rb @@ -3,14 +3,14 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end -require 'uri' +require 'cgi' module SibApiV3Sdk class ListsApi @@ -19,19 +19,9 @@ class ListsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - - # Set custom user_agent if explicitly passed in api - # default will still remain Swagger-Codegen/#{VERSION}/ruby - def setUserAgent(user_agent) - @user_agent = user_agent - if user_agent.is_a?(String) && user_agent.downcase.start_with?('sendinblue_') - @api_client.default_headers['User-Agent'] = @user_agent - end - end - # Add existing contacts to a list - # @param list_id Id of the list - # @param contact_emails Emails addresses OR IDs of the contacts + # @param list_id [Integer] Id of the list + # @param contact_emails [AddContactToList] Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters # @return [PostContactInfo] def add_contact_to_list(list_id, contact_emails, opts = {}) @@ -40,10 +30,10 @@ def add_contact_to_list(list_id, contact_emails, opts = {}) end # Add existing contacts to a list - # @param list_id Id of the list - # @param contact_emails Emails addresses OR IDs of the contacts + # @param list_id [Integer] Id of the list + # @param contact_emails [AddContactToList] Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters - # @return [Array<(PostContactInfo, Fixnum, Hash)>] PostContactInfo data, response status code and response headers + # @return [Array<(PostContactInfo, Integer, Hash)>] PostContactInfo data, response status code and response headers def add_contact_to_list_with_http_info(list_id, contact_emails, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ListsApi.add_contact_to_list ...' @@ -57,38 +47,49 @@ def add_contact_to_list_with_http_info(list_id, contact_emails, opts = {}) fail ArgumentError, "Missing the required parameter 'contact_emails' when calling ListsApi.add_contact_to_list" end # resource path - local_var_path = '/contacts/lists/{listId}/contacts/add'.sub('{' + 'listId' + '}', list_id.to_s) + local_var_path = '/contacts/lists/{listId}/contacts/add'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(contact_emails) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(contact_emails) + + # return_type + return_type = opts[:debug_return_type] || 'PostContactInfo' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ListsApi.add_contact_to_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'PostContactInfo') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ListsApi#add_contact_to_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Create a list - # @param create_list Values to create a list + # @param create_list [CreateList] Values to create a list # @param [Hash] opts the optional parameters # @return [CreateModel] def create_list(create_list, opts = {}) @@ -97,9 +98,9 @@ def create_list(create_list, opts = {}) end # Create a list - # @param create_list Values to create a list + # @param create_list [CreateList] Values to create a list # @param [Hash] opts the optional parameters - # @return [Array<(CreateModel, Fixnum, Hash)>] CreateModel data, response status code and response headers + # @return [Array<(CreateModel, Integer, Hash)>] CreateModel data, response status code and response headers def create_list_with_http_info(create_list, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ListsApi.create_list ...' @@ -112,35 +113,46 @@ def create_list_with_http_info(create_list, opts = {}) local_var_path = '/contacts/lists' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(create_list) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_list) + + # return_type + return_type = opts[:debug_return_type] || 'CreateModel' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ListsApi.create_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'CreateModel') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ListsApi#create_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Delete a list - # @param list_id Id of the list + # @param list_id [Integer] Id of the list # @param [Hash] opts the optional parameters # @return [nil] def delete_list(list_id, opts = {}) @@ -149,9 +161,9 @@ def delete_list(list_id, opts = {}) end # Delete a list - # @param list_id Id of the list + # @param list_id [Integer] Id of the list # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_list_with_http_info(list_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ListsApi.delete_list ...' @@ -161,42 +173,52 @@ def delete_list_with_http_info(list_id, opts = {}) fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsApi.delete_list" end # resource path - local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', list_id.to_s) + local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ListsApi.delete_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ListsApi#delete_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get contacts in a list - # @param list_id Id of the list + # @param list_id [Integer] Id of the list # @param [Hash] opts the optional parameters # @option opts [String] :modified_since Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. # @option opts [Integer] :limit Number of documents per page (default to 50) # @option opts [Integer] :offset Index of the first document of the page (default to 0) - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetContacts] def get_contacts_from_list(list_id, opts = {}) data, _status_code, _headers = get_contacts_from_list_with_http_info(list_id, opts) @@ -204,13 +226,13 @@ def get_contacts_from_list(list_id, opts = {}) end # Get contacts in a list - # @param list_id Id of the list + # @param list_id [Integer] Id of the list # @param [Hash] opts the optional parameters # @option opts [String] :modified_since Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. # @option opts [Integer] :limit Number of documents per page # @option opts [Integer] :offset Index of the first document of the page # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetContacts, Fixnum, Hash)>] GetContacts data, response status code and response headers + # @return [Array<(GetContacts, Integer, Hash)>] GetContacts data, response status code and response headers def get_contacts_from_list_with_http_info(list_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ListsApi.get_contacts_from_list ...' @@ -223,50 +245,60 @@ def get_contacts_from_list_with_http_info(list_id, opts = {}) fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ListsApi.get_contacts_from_list, must be smaller than or equal to 500.' end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/contacts/lists/{listId}/contacts'.sub('{' + 'listId' + '}', list_id.to_s) + local_var_path = '/contacts/lists/{listId}/contacts'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'modifiedSince'] = opts[:'modified_since'] if !opts[:'modified_since'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetContacts' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ListsApi.get_contacts_from_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetContacts') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ListsApi#get_contacts_from_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get lists in a folder - # @param folder_id Id of the folder + # @param folder_id [Integer] Id of the folder # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents per page (default to 10) # @option opts [Integer] :offset Index of the first document of the page (default to 0) - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetFolderLists] def get_folder_lists(folder_id, opts = {}) data, _status_code, _headers = get_folder_lists_with_http_info(folder_id, opts) @@ -274,12 +306,12 @@ def get_folder_lists(folder_id, opts = {}) end # Get lists in a folder - # @param folder_id Id of the folder + # @param folder_id [Integer] Id of the folder # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents per page # @option opts [Integer] :offset Index of the first document of the page # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetFolderLists, Fixnum, Hash)>] GetFolderLists data, response status code and response headers + # @return [Array<(GetFolderLists, Integer, Hash)>] GetFolderLists data, response status code and response headers def get_folder_lists_with_http_info(folder_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ListsApi.get_folder_lists ...' @@ -292,45 +324,55 @@ def get_folder_lists_with_http_info(folder_id, opts = {}) fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ListsApi.get_folder_lists, must be smaller than or equal to 50.' end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path - local_var_path = '/contacts/folders/{folderId}/lists'.sub('{' + 'folderId' + '}', folder_id.to_s) + local_var_path = '/contacts/folders/{folderId}/lists'.sub('{' + 'folderId' + '}', CGI.escape(folder_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetFolderLists' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ListsApi.get_folder_lists", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetFolderLists') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ListsApi#get_folder_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get a list's details - # @param list_id Id of the list + # @param list_id [Integer] Id of the list # @param [Hash] opts the optional parameters # @return [GetExtendedList] def get_list(list_id, opts = {}) @@ -339,9 +381,9 @@ def get_list(list_id, opts = {}) end # Get a list's details - # @param list_id Id of the list + # @param list_id [Integer] Id of the list # @param [Hash] opts the optional parameters - # @return [Array<(GetExtendedList, Fixnum, Hash)>] GetExtendedList data, response status code and response headers + # @return [Array<(GetExtendedList, Integer, Hash)>] GetExtendedList data, response status code and response headers def get_list_with_http_info(list_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ListsApi.get_list ...' @@ -351,41 +393,50 @@ def get_list_with_http_info(list_id, opts = {}) fail ArgumentError, "Missing the required parameter 'list_id' when calling ListsApi.get_list" end # resource path - local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', list_id.to_s) + local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetExtendedList' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ListsApi.get_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetExtendedList') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ListsApi#get_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get all the lists # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents per page (default to 10) # @option opts [Integer] :offset Index of the first document of the page (default to 0) - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetLists] def get_lists(opts = {}) data, _status_code, _headers = get_lists_with_http_info(opts) @@ -397,7 +448,7 @@ def get_lists(opts = {}) # @option opts [Integer] :limit Number of documents per page # @option opts [Integer] :offset Index of the first document of the page # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetLists, Fixnum, Hash)>] GetLists data, response status code and response headers + # @return [Array<(GetLists, Integer, Hash)>] GetLists data, response status code and response headers def get_lists_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ListsApi.get_lists ...' @@ -406,46 +457,56 @@ def get_lists_with_http_info(opts = {}) fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ListsApi.get_lists, must be smaller than or equal to 50.' end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/contacts/lists' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetLists' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ListsApi.get_lists", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetLists') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ListsApi#get_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Delete a contact from a list - # @param list_id Id of the list - # @param contact_emails Emails addresses OR IDs of the contacts + # @param list_id [Integer] Id of the list + # @param contact_emails [RemoveContactFromList] Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters # @return [PostContactInfo] def remove_contact_from_list(list_id, contact_emails, opts = {}) @@ -454,10 +515,10 @@ def remove_contact_from_list(list_id, contact_emails, opts = {}) end # Delete a contact from a list - # @param list_id Id of the list - # @param contact_emails Emails addresses OR IDs of the contacts + # @param list_id [Integer] Id of the list + # @param contact_emails [RemoveContactFromList] Emails addresses OR IDs of the contacts # @param [Hash] opts the optional parameters - # @return [Array<(PostContactInfo, Fixnum, Hash)>] PostContactInfo data, response status code and response headers + # @return [Array<(PostContactInfo, Integer, Hash)>] PostContactInfo data, response status code and response headers def remove_contact_from_list_with_http_info(list_id, contact_emails, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ListsApi.remove_contact_from_list ...' @@ -471,39 +532,50 @@ def remove_contact_from_list_with_http_info(list_id, contact_emails, opts = {}) fail ArgumentError, "Missing the required parameter 'contact_emails' when calling ListsApi.remove_contact_from_list" end # resource path - local_var_path = '/contacts/lists/{listId}/contacts/remove'.sub('{' + 'listId' + '}', list_id.to_s) + local_var_path = '/contacts/lists/{listId}/contacts/remove'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(contact_emails) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(contact_emails) + + # return_type + return_type = opts[:debug_return_type] || 'PostContactInfo' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ListsApi.remove_contact_from_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'PostContactInfo') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ListsApi#remove_contact_from_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Update a list - # @param list_id Id of the list - # @param update_list Values to update a list + # @param list_id [Integer] Id of the list + # @param update_list [UpdateList] Values to update a list # @param [Hash] opts the optional parameters # @return [nil] def update_list(list_id, update_list, opts = {}) @@ -512,10 +584,10 @@ def update_list(list_id, update_list, opts = {}) end # Update a list - # @param list_id Id of the list - # @param update_list Values to update a list + # @param list_id [Integer] Id of the list + # @param update_list [UpdateList] Values to update a list # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_list_with_http_info(list_id, update_list, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ListsApi.update_list ...' @@ -529,30 +601,41 @@ def update_list_with_http_info(list_id, update_list, opts = {}) fail ArgumentError, "Missing the required parameter 'update_list' when calling ListsApi.update_list" end # resource path - local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', list_id.to_s) + local_var_path = '/contacts/lists/{listId}'.sub('{' + 'listId' + '}', CGI.escape(list_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(update_list) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(update_list) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ListsApi.update_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ListsApi#update_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/sib-api-v3-sdk/api/process_api.rb b/lib/sib-api-v3-sdk/api/process_api.rb index fa0c137..54ffb6d 100644 --- a/lib/sib-api-v3-sdk/api/process_api.rb +++ b/lib/sib-api-v3-sdk/api/process_api.rb @@ -3,14 +3,14 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end -require 'uri' +require 'cgi' module SibApiV3Sdk class ProcessApi @@ -19,18 +19,8 @@ class ProcessApi def initialize(api_client = ApiClient.default) @api_client = api_client end - - # Set custom user_agent if explicitly passed in api - # default will still remain Swagger-Codegen/#{VERSION}/ruby - def setUserAgent(user_agent) - @user_agent = user_agent - if user_agent.is_a?(String) && user_agent.downcase.start_with?('sendinblue_') - @api_client.default_headers['User-Agent'] = @user_agent - end - end - # Return the informations for a process - # @param process_id Id of the process + # @param process_id [Integer] Id of the process # @param [Hash] opts the optional parameters # @return [GetProcess] def get_process(process_id, opts = {}) @@ -39,9 +29,9 @@ def get_process(process_id, opts = {}) end # Return the informations for a process - # @param process_id Id of the process + # @param process_id [Integer] Id of the process # @param [Hash] opts the optional parameters - # @return [Array<(GetProcess, Fixnum, Hash)>] GetProcess data, response status code and response headers + # @return [Array<(GetProcess, Integer, Hash)>] GetProcess data, response status code and response headers def get_process_with_http_info(process_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProcessApi.get_process ...' @@ -51,41 +41,50 @@ def get_process_with_http_info(process_id, opts = {}) fail ArgumentError, "Missing the required parameter 'process_id' when calling ProcessApi.get_process" end # resource path - local_var_path = '/processes/{processId}'.sub('{' + 'processId' + '}', process_id.to_s) + local_var_path = '/processes/{processId}'.sub('{' + 'processId' + '}', CGI.escape(process_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetProcess' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ProcessApi.get_process", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetProcess') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProcessApi#get_process\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Return all the processes for your account # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number limitation for the result returned (default to 10) # @option opts [Integer] :offset Beginning point in the list to retrieve from. (default to 0) - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetProcesses] def get_processes(opts = {}) data, _status_code, _headers = get_processes_with_http_info(opts) @@ -97,7 +96,7 @@ def get_processes(opts = {}) # @option opts [Integer] :limit Number limitation for the result returned # @option opts [Integer] :offset Beginning point in the list to retrieve from. # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetProcesses, Fixnum, Hash)>] GetProcesses data, response status code and response headers + # @return [Array<(GetProcesses, Integer, Hash)>] GetProcesses data, response status code and response headers def get_processes_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProcessApi.get_processes ...' @@ -106,38 +105,47 @@ def get_processes_with_http_info(opts = {}) fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ProcessApi.get_processes, must be smaller than or equal to 50.' end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/processes' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetProcesses' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ProcessApi.get_processes", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetProcesses') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProcessApi#get_processes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/sib-api-v3-sdk/api/reseller_api.rb b/lib/sib-api-v3-sdk/api/reseller_api.rb index e17b5ba..9e8398d 100644 --- a/lib/sib-api-v3-sdk/api/reseller_api.rb +++ b/lib/sib-api-v3-sdk/api/reseller_api.rb @@ -3,14 +3,14 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end -require 'uri' +require 'cgi' module SibApiV3Sdk class ResellerApi @@ -19,19 +19,9 @@ class ResellerApi def initialize(api_client = ApiClient.default) @api_client = api_client end - - # Set custom user_agent if explicitly passed in api - # default will still remain Swagger-Codegen/#{VERSION}/ruby - def setUserAgent(user_agent) - @user_agent = user_agent - if user_agent.is_a?(String) && user_agent.downcase.start_with?('sendinblue_') - @api_client.default_headers['User-Agent'] = @user_agent - end - end - # Add Email and/or SMS credits to a specific child account - # @param child_identifier Either auth key or id of reseller's child - # @param add_credits Values to post to add credit to a specific child account + # @param child_identifier [String] Either auth key or id of reseller's child + # @param add_credits [AddCredits] Values to post to add credit to a specific child account # @param [Hash] opts the optional parameters # @return [RemainingCreditModel] def add_credits(child_identifier, add_credits, opts = {}) @@ -40,10 +30,10 @@ def add_credits(child_identifier, add_credits, opts = {}) end # Add Email and/or SMS credits to a specific child account - # @param child_identifier Either auth key or id of reseller's child - # @param add_credits Values to post to add credit to a specific child account + # @param child_identifier [String] Either auth key or id of reseller's child + # @param add_credits [AddCredits] Values to post to add credit to a specific child account # @param [Hash] opts the optional parameters - # @return [Array<(RemainingCreditModel, Fixnum, Hash)>] RemainingCreditModel data, response status code and response headers + # @return [Array<(RemainingCreditModel, Integer, Hash)>] RemainingCreditModel data, response status code and response headers def add_credits_with_http_info(child_identifier, add_credits, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ResellerApi.add_credits ...' @@ -57,39 +47,50 @@ def add_credits_with_http_info(child_identifier, add_credits, opts = {}) fail ArgumentError, "Missing the required parameter 'add_credits' when calling ResellerApi.add_credits" end # resource path - local_var_path = '/reseller/children/{childIdentifier}/credits/add'.sub('{' + 'childIdentifier' + '}', child_identifier.to_s) + local_var_path = '/reseller/children/{childIdentifier}/credits/add'.sub('{' + 'childIdentifier' + '}', CGI.escape(child_identifier.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(add_credits) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(add_credits) + + # return_type + return_type = opts[:debug_return_type] || 'RemainingCreditModel' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ResellerApi.add_credits", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'RemainingCreditModel') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#add_credits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Associate a dedicated IP to the child - # @param child_identifier Either auth key or id of reseller's child - # @param ip IP to associate + # @param child_identifier [String] Either auth key or id of reseller's child + # @param ip [ManageIp] IP to associate # @param [Hash] opts the optional parameters # @return [nil] def associate_ip_to_child(child_identifier, ip, opts = {}) @@ -98,10 +99,10 @@ def associate_ip_to_child(child_identifier, ip, opts = {}) end # Associate a dedicated IP to the child - # @param child_identifier Either auth key or id of reseller's child - # @param ip IP to associate + # @param child_identifier [String] Either auth key or id of reseller's child + # @param ip [ManageIp] IP to associate # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def associate_ip_to_child_with_http_info(child_identifier, ip, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ResellerApi.associate_ip_to_child ...' @@ -115,38 +116,50 @@ def associate_ip_to_child_with_http_info(child_identifier, ip, opts = {}) fail ArgumentError, "Missing the required parameter 'ip' when calling ResellerApi.associate_ip_to_child" end # resource path - local_var_path = '/reseller/children/{childIdentifier}/ips/associate'.sub('{' + 'childIdentifier' + '}', child_identifier.to_s) + local_var_path = '/reseller/children/{childIdentifier}/ips/associate'.sub('{' + 'childIdentifier' + '}', CGI.escape(child_identifier.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(ip) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(ip) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ResellerApi.associate_ip_to_child", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#associate_ip_to_child\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Create a domain for a child account - # @param child_identifier Either auth key or id of reseller's child - # @param add_child_domain Sender domain to add for a specific child account. This will not be displayed to the parent account. + # @param child_identifier [String] Either auth key or id of reseller's child + # @param add_child_domain [AddChildDomain] Sender domain to add for a specific child account. This will not be displayed to the parent account. # @param [Hash] opts the optional parameters # @return [nil] def create_child_domain(child_identifier, add_child_domain, opts = {}) @@ -155,10 +168,10 @@ def create_child_domain(child_identifier, add_child_domain, opts = {}) end # Create a domain for a child account - # @param child_identifier Either auth key or id of reseller's child - # @param add_child_domain Sender domain to add for a specific child account. This will not be displayed to the parent account. + # @param child_identifier [String] Either auth key or id of reseller's child + # @param add_child_domain [AddChildDomain] Sender domain to add for a specific child account. This will not be displayed to the parent account. # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def create_child_domain_with_http_info(child_identifier, add_child_domain, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ResellerApi.create_child_domain ...' @@ -172,35 +185,47 @@ def create_child_domain_with_http_info(child_identifier, add_child_domain, opts fail ArgumentError, "Missing the required parameter 'add_child_domain' when calling ResellerApi.create_child_domain" end # resource path - local_var_path = '/reseller/children/{childIdentifier}/domains'.sub('{' + 'childIdentifier' + '}', child_identifier.to_s) + local_var_path = '/reseller/children/{childIdentifier}/domains'.sub('{' + 'childIdentifier' + '}', CGI.escape(child_identifier.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(add_child_domain) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(add_child_domain) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ResellerApi.create_child_domain", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#create_child_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Creates a reseller child # @param [Hash] opts the optional parameters # @option opts [CreateChild] :reseller_child reseller child to add @@ -213,7 +238,7 @@ def create_reseller_child(opts = {}) # Creates a reseller child # @param [Hash] opts the optional parameters # @option opts [CreateChild] :reseller_child reseller child to add - # @return [Array<(CreateReseller, Fixnum, Hash)>] CreateReseller data, response status code and response headers + # @return [Array<(CreateReseller, Integer, Hash)>] CreateReseller data, response status code and response headers def create_reseller_child_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ResellerApi.create_reseller_child ...' @@ -222,36 +247,47 @@ def create_reseller_child_with_http_info(opts = {}) local_var_path = '/reseller/children' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(opts[:'reseller_child']) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'reseller_child']) + + # return_type + return_type = opts[:debug_return_type] || 'CreateReseller' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ResellerApi.create_reseller_child", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'CreateReseller') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#create_reseller_child\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Delete the sender domain of the reseller child based on the childIdentifier and domainName passed - # @param child_identifier Either auth key or id of reseller's child - # @param domain_name Pass the existing domain that needs to be deleted + # @param child_identifier [String] Either auth key or id of reseller's child + # @param domain_name [String] Pass the existing domain that needs to be deleted # @param [Hash] opts the optional parameters # @return [nil] def delete_child_domain(child_identifier, domain_name, opts = {}) @@ -260,10 +296,10 @@ def delete_child_domain(child_identifier, domain_name, opts = {}) end # Delete the sender domain of the reseller child based on the childIdentifier and domainName passed - # @param child_identifier Either auth key or id of reseller's child - # @param domain_name Pass the existing domain that needs to be deleted + # @param child_identifier [String] Either auth key or id of reseller's child + # @param domain_name [String] Pass the existing domain that needs to be deleted # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_child_domain_with_http_info(child_identifier, domain_name, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ResellerApi.delete_child_domain ...' @@ -277,37 +313,47 @@ def delete_child_domain_with_http_info(child_identifier, domain_name, opts = {}) fail ArgumentError, "Missing the required parameter 'domain_name' when calling ResellerApi.delete_child_domain" end # resource path - local_var_path = '/reseller/children/{childIdentifier}/domains/{domainName}'.sub('{' + 'childIdentifier' + '}', child_identifier.to_s).sub('{' + 'domainName' + '}', domain_name.to_s) + local_var_path = '/reseller/children/{childIdentifier}/domains/{domainName}'.sub('{' + 'childIdentifier' + '}', CGI.escape(child_identifier.to_s)).sub('{' + 'domainName' + '}', CGI.escape(domain_name.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ResellerApi.delete_child_domain", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#delete_child_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Delete a single reseller child based on the child identifier supplied - # @param child_identifier Either auth key or child id of reseller's child + # @param child_identifier [String] Either auth key or child id of reseller's child # @param [Hash] opts the optional parameters # @return [nil] def delete_reseller_child(child_identifier, opts = {}) @@ -316,9 +362,9 @@ def delete_reseller_child(child_identifier, opts = {}) end # Delete a single reseller child based on the child identifier supplied - # @param child_identifier Either auth key or child id of reseller's child + # @param child_identifier [String] Either auth key or child id of reseller's child # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_reseller_child_with_http_info(child_identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ResellerApi.delete_reseller_child ...' @@ -328,38 +374,48 @@ def delete_reseller_child_with_http_info(child_identifier, opts = {}) fail ArgumentError, "Missing the required parameter 'child_identifier' when calling ResellerApi.delete_reseller_child" end # resource path - local_var_path = '/reseller/children/{childIdentifier}'.sub('{' + 'childIdentifier' + '}', child_identifier.to_s) + local_var_path = '/reseller/children/{childIdentifier}'.sub('{' + 'childIdentifier' + '}', CGI.escape(child_identifier.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ResellerApi.delete_reseller_child", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#delete_reseller_child\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Dissociate a dedicated IP to the child - # @param child_identifier Either auth key or id of reseller's child - # @param ip IP to dissociate + # @param child_identifier [String] Either auth key or id of reseller's child + # @param ip [ManageIp] IP to dissociate # @param [Hash] opts the optional parameters # @return [nil] def dissociate_ip_from_child(child_identifier, ip, opts = {}) @@ -368,10 +424,10 @@ def dissociate_ip_from_child(child_identifier, ip, opts = {}) end # Dissociate a dedicated IP to the child - # @param child_identifier Either auth key or id of reseller's child - # @param ip IP to dissociate + # @param child_identifier [String] Either auth key or id of reseller's child + # @param ip [ManageIp] IP to dissociate # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def dissociate_ip_from_child_with_http_info(child_identifier, ip, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ResellerApi.dissociate_ip_from_child ...' @@ -385,37 +441,49 @@ def dissociate_ip_from_child_with_http_info(child_identifier, ip, opts = {}) fail ArgumentError, "Missing the required parameter 'ip' when calling ResellerApi.dissociate_ip_from_child" end # resource path - local_var_path = '/reseller/children/{childIdentifier}/ips/dissociate'.sub('{' + 'childIdentifier' + '}', child_identifier.to_s) + local_var_path = '/reseller/children/{childIdentifier}/ips/dissociate'.sub('{' + 'childIdentifier' + '}', CGI.escape(child_identifier.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(ip) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(ip) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ResellerApi.dissociate_ip_from_child", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#dissociate_ip_from_child\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied - # @param child_identifier Either auth key or id of reseller's child + # @param child_identifier [String] Either auth key or id of reseller's child # @param [Hash] opts the optional parameters # @return [GetChildAccountCreationStatus] def get_child_account_creation_status(child_identifier, opts = {}) @@ -424,9 +492,9 @@ def get_child_account_creation_status(child_identifier, opts = {}) end # Get the status of a reseller's child account creation, whether it is successfully created (exists) or not based on the identifier supplied - # @param child_identifier Either auth key or id of reseller's child + # @param child_identifier [String] Either auth key or id of reseller's child # @param [Hash] opts the optional parameters - # @return [Array<(GetChildAccountCreationStatus, Fixnum, Hash)>] GetChildAccountCreationStatus data, response status code and response headers + # @return [Array<(GetChildAccountCreationStatus, Integer, Hash)>] GetChildAccountCreationStatus data, response status code and response headers def get_child_account_creation_status_with_http_info(child_identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ResellerApi.get_child_account_creation_status ...' @@ -436,49 +504,58 @@ def get_child_account_creation_status_with_http_info(child_identifier, opts = {} fail ArgumentError, "Missing the required parameter 'child_identifier' when calling ResellerApi.get_child_account_creation_status" end # resource path - local_var_path = '/reseller/children/{childIdentifier}/accountCreationStatus'.sub('{' + 'childIdentifier' + '}', child_identifier.to_s) + local_var_path = '/reseller/children/{childIdentifier}/accountCreationStatus'.sub('{' + 'childIdentifier' + '}', CGI.escape(child_identifier.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetChildAccountCreationStatus' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ResellerApi.get_child_account_creation_status", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetChildAccountCreationStatus') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#get_child_account_creation_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get all sender domains for a specific child account - # @param child_identifier Either auth key or id of reseller's child + # @param child_identifier [String] Either auth key or id of reseller's child # @param [Hash] opts the optional parameters - # @return [GetChildDomains] + # @return [Array] def get_child_domains(child_identifier, opts = {}) data, _status_code, _headers = get_child_domains_with_http_info(child_identifier, opts) data end # Get all sender domains for a specific child account - # @param child_identifier Either auth key or id of reseller's child + # @param child_identifier [String] Either auth key or id of reseller's child # @param [Hash] opts the optional parameters - # @return [Array<(GetChildDomains, Fixnum, Hash)>] GetChildDomains data, response status code and response headers + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers def get_child_domains_with_http_info(child_identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ResellerApi.get_child_domains ...' @@ -488,38 +565,47 @@ def get_child_domains_with_http_info(child_identifier, opts = {}) fail ArgumentError, "Missing the required parameter 'child_identifier' when calling ResellerApi.get_child_domains" end # resource path - local_var_path = '/reseller/children/{childIdentifier}/domains'.sub('{' + 'childIdentifier' + '}', child_identifier.to_s) + local_var_path = '/reseller/children/{childIdentifier}/domains'.sub('{' + 'childIdentifier' + '}', CGI.escape(child_identifier.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ResellerApi.get_child_domains", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetChildDomains') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#get_child_domains\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get a child account's details - # @param child_identifier Either auth key or id of reseller's child + # @param child_identifier [String] Either auth key or id of reseller's child # @param [Hash] opts the optional parameters # @return [GetChildInfo] def get_child_info(child_identifier, opts = {}) @@ -528,9 +614,9 @@ def get_child_info(child_identifier, opts = {}) end # Get a child account's details - # @param child_identifier Either auth key or id of reseller's child + # @param child_identifier [String] Either auth key or id of reseller's child # @param [Hash] opts the optional parameters - # @return [Array<(GetChildInfo, Fixnum, Hash)>] GetChildInfo data, response status code and response headers + # @return [Array<(GetChildInfo, Integer, Hash)>] GetChildInfo data, response status code and response headers def get_child_info_with_http_info(child_identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ResellerApi.get_child_info ...' @@ -540,36 +626,45 @@ def get_child_info_with_http_info(child_identifier, opts = {}) fail ArgumentError, "Missing the required parameter 'child_identifier' when calling ResellerApi.get_child_info" end # resource path - local_var_path = '/reseller/children/{childIdentifier}'.sub('{' + 'childIdentifier' + '}', child_identifier.to_s) + local_var_path = '/reseller/children/{childIdentifier}'.sub('{' + 'childIdentifier' + '}', CGI.escape(child_identifier.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetChildInfo' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ResellerApi.get_child_info", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetChildInfo') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#get_child_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get the list of all children accounts # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents for child accounts information per page (default to 10) @@ -584,7 +679,7 @@ def get_reseller_childs(opts = {}) # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents for child accounts information per page # @option opts [Integer] :offset Index of the first document in the page - # @return [Array<(GetChildrenList, Fixnum, Hash)>] GetChildrenList data, response status code and response headers + # @return [Array<(GetChildrenList, Integer, Hash)>] GetChildrenList data, response status code and response headers def get_reseller_childs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ResellerApi.get_reseller_childs ...' @@ -597,38 +692,47 @@ def get_reseller_childs_with_http_info(opts = {}) local_var_path = '/reseller/children' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetChildrenList' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ResellerApi.get_reseller_childs", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetChildrenList') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#get_reseller_childs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get session token to access Sendinblue (SSO) # It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token] - # @param child_identifier Either auth key or id of reseller's child + # @param child_identifier [String] Either auth key or id of reseller's child # @param [Hash] opts the optional parameters # @return [GetSsoToken] def get_sso_token(child_identifier, opts = {}) @@ -638,9 +742,9 @@ def get_sso_token(child_identifier, opts = {}) # Get session token to access Sendinblue (SSO) # It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token] - # @param child_identifier Either auth key or id of reseller's child + # @param child_identifier [String] Either auth key or id of reseller's child # @param [Hash] opts the optional parameters - # @return [Array<(GetSsoToken, Fixnum, Hash)>] GetSsoToken data, response status code and response headers + # @return [Array<(GetSsoToken, Integer, Hash)>] GetSsoToken data, response status code and response headers def get_sso_token_with_http_info(child_identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ResellerApi.get_sso_token ...' @@ -650,39 +754,48 @@ def get_sso_token_with_http_info(child_identifier, opts = {}) fail ArgumentError, "Missing the required parameter 'child_identifier' when calling ResellerApi.get_sso_token" end # resource path - local_var_path = '/reseller/children/{childIdentifier}/auth'.sub('{' + 'childIdentifier' + '}', child_identifier.to_s) + local_var_path = '/reseller/children/{childIdentifier}/auth'.sub('{' + 'childIdentifier' + '}', CGI.escape(child_identifier.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetSsoToken' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ResellerApi.get_sso_token", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetSsoToken') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#get_sso_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Remove Email and/or SMS credits from a specific child account - # @param child_identifier Either auth key or id of reseller's child - # @param remove_credits Values to post to remove email or SMS credits from a specific child account + # @param child_identifier [String] Either auth key or id of reseller's child + # @param remove_credits [RemoveCredits] Values to post to remove email or SMS credits from a specific child account # @param [Hash] opts the optional parameters # @return [RemainingCreditModel] def remove_credits(child_identifier, remove_credits, opts = {}) @@ -691,10 +804,10 @@ def remove_credits(child_identifier, remove_credits, opts = {}) end # Remove Email and/or SMS credits from a specific child account - # @param child_identifier Either auth key or id of reseller's child - # @param remove_credits Values to post to remove email or SMS credits from a specific child account + # @param child_identifier [String] Either auth key or id of reseller's child + # @param remove_credits [RemoveCredits] Values to post to remove email or SMS credits from a specific child account # @param [Hash] opts the optional parameters - # @return [Array<(RemainingCreditModel, Fixnum, Hash)>] RemainingCreditModel data, response status code and response headers + # @return [Array<(RemainingCreditModel, Integer, Hash)>] RemainingCreditModel data, response status code and response headers def remove_credits_with_http_info(child_identifier, remove_credits, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ResellerApi.remove_credits ...' @@ -708,39 +821,50 @@ def remove_credits_with_http_info(child_identifier, remove_credits, opts = {}) fail ArgumentError, "Missing the required parameter 'remove_credits' when calling ResellerApi.remove_credits" end # resource path - local_var_path = '/reseller/children/{childIdentifier}/credits/remove'.sub('{' + 'childIdentifier' + '}', child_identifier.to_s) + local_var_path = '/reseller/children/{childIdentifier}/credits/remove'.sub('{' + 'childIdentifier' + '}', CGI.escape(child_identifier.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(remove_credits) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(remove_credits) + + # return_type + return_type = opts[:debug_return_type] || 'RemainingCreditModel' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ResellerApi.remove_credits", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'RemainingCreditModel') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#remove_credits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Update info of reseller's child account status based on the childIdentifier supplied - # @param child_identifier Either auth key or id of reseller's child - # @param update_child_account_status values to update in child account status + # @param child_identifier [String] Either auth key or id of reseller's child + # @param update_child_account_status [UpdateChildAccountStatus] values to update in child account status # @param [Hash] opts the optional parameters # @return [nil] def update_child_account_status(child_identifier, update_child_account_status, opts = {}) @@ -749,10 +873,10 @@ def update_child_account_status(child_identifier, update_child_account_status, o end # Update info of reseller's child account status based on the childIdentifier supplied - # @param child_identifier Either auth key or id of reseller's child - # @param update_child_account_status values to update in child account status + # @param child_identifier [String] Either auth key or id of reseller's child + # @param update_child_account_status [UpdateChildAccountStatus] values to update in child account status # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_child_account_status_with_http_info(child_identifier, update_child_account_status, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ResellerApi.update_child_account_status ...' @@ -766,39 +890,51 @@ def update_child_account_status_with_http_info(child_identifier, update_child_ac fail ArgumentError, "Missing the required parameter 'update_child_account_status' when calling ResellerApi.update_child_account_status" end # resource path - local_var_path = '/reseller/children/{childIdentifier}/accountStatus'.sub('{' + 'childIdentifier' + '}', child_identifier.to_s) + local_var_path = '/reseller/children/{childIdentifier}/accountStatus'.sub('{' + 'childIdentifier' + '}', CGI.escape(child_identifier.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(update_child_account_status) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(update_child_account_status) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ResellerApi.update_child_account_status", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#update_child_account_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Update the sender domain of reseller's child based on the childIdentifier and domainName passed - # @param child_identifier Either auth key or id of reseller's child - # @param domain_name Pass the existing domain that needs to be updated - # @param update_child_domain value to update for sender domain + # @param child_identifier [String] Either auth key or id of reseller's child + # @param domain_name [String] Pass the existing domain that needs to be updated + # @param update_child_domain [UpdateChildDomain] value to update for sender domain # @param [Hash] opts the optional parameters # @return [nil] def update_child_domain(child_identifier, domain_name, update_child_domain, opts = {}) @@ -807,11 +943,11 @@ def update_child_domain(child_identifier, domain_name, update_child_domain, opts end # Update the sender domain of reseller's child based on the childIdentifier and domainName passed - # @param child_identifier Either auth key or id of reseller's child - # @param domain_name Pass the existing domain that needs to be updated - # @param update_child_domain value to update for sender domain + # @param child_identifier [String] Either auth key or id of reseller's child + # @param domain_name [String] Pass the existing domain that needs to be updated + # @param update_child_domain [UpdateChildDomain] value to update for sender domain # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_child_domain_with_http_info(child_identifier, domain_name, update_child_domain, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ResellerApi.update_child_domain ...' @@ -829,38 +965,50 @@ def update_child_domain_with_http_info(child_identifier, domain_name, update_chi fail ArgumentError, "Missing the required parameter 'update_child_domain' when calling ResellerApi.update_child_domain" end # resource path - local_var_path = '/reseller/children/{childIdentifier}/domains/{domainName}'.sub('{' + 'childIdentifier' + '}', child_identifier.to_s).sub('{' + 'domainName' + '}', domain_name.to_s) + local_var_path = '/reseller/children/{childIdentifier}/domains/{domainName}'.sub('{' + 'childIdentifier' + '}', CGI.escape(child_identifier.to_s)).sub('{' + 'domainName' + '}', CGI.escape(domain_name.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(update_child_domain) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(update_child_domain) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ResellerApi.update_child_domain", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#update_child_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Update info of reseller's child based on the child identifier supplied - # @param child_identifier Either auth key or id of reseller's child - # @param reseller_child values to update in child profile + # @param child_identifier [String] Either auth key or id of reseller's child + # @param reseller_child [UpdateChild] values to update in child profile # @param [Hash] opts the optional parameters # @return [nil] def update_reseller_child(child_identifier, reseller_child, opts = {}) @@ -869,10 +1017,10 @@ def update_reseller_child(child_identifier, reseller_child, opts = {}) end # Update info of reseller's child based on the child identifier supplied - # @param child_identifier Either auth key or id of reseller's child - # @param reseller_child values to update in child profile + # @param child_identifier [String] Either auth key or id of reseller's child + # @param reseller_child [UpdateChild] values to update in child profile # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_reseller_child_with_http_info(child_identifier, reseller_child, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ResellerApi.update_reseller_child ...' @@ -886,30 +1034,41 @@ def update_reseller_child_with_http_info(child_identifier, reseller_child, opts fail ArgumentError, "Missing the required parameter 'reseller_child' when calling ResellerApi.update_reseller_child" end # resource path - local_var_path = '/reseller/children/{childIdentifier}'.sub('{' + 'childIdentifier' + '}', child_identifier.to_s) + local_var_path = '/reseller/children/{childIdentifier}'.sub('{' + 'childIdentifier' + '}', CGI.escape(child_identifier.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(reseller_child) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(reseller_child) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"ResellerApi.update_reseller_child", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ResellerApi#update_reseller_child\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/sib-api-v3-sdk/api/senders_api.rb b/lib/sib-api-v3-sdk/api/senders_api.rb index fb87a3d..13b31f9 100644 --- a/lib/sib-api-v3-sdk/api/senders_api.rb +++ b/lib/sib-api-v3-sdk/api/senders_api.rb @@ -3,14 +3,14 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end -require 'uri' +require 'cgi' module SibApiV3Sdk class SendersApi @@ -19,16 +19,6 @@ class SendersApi def initialize(api_client = ApiClient.default) @api_client = api_client end - - # Set custom user_agent if explicitly passed in api - # default will still remain Swagger-Codegen/#{VERSION}/ruby - def setUserAgent(user_agent) - @user_agent = user_agent - if user_agent.is_a?(String) && user_agent.downcase.start_with?('sendinblue_') - @api_client.default_headers['User-Agent'] = @user_agent - end - end - # Create a new sender # @param [Hash] opts the optional parameters # @option opts [CreateSender] :sender sender's name @@ -41,7 +31,7 @@ def create_sender(opts = {}) # Create a new sender # @param [Hash] opts the optional parameters # @option opts [CreateSender] :sender sender's name - # @return [Array<(CreateSenderModel, Fixnum, Hash)>] CreateSenderModel data, response status code and response headers + # @return [Array<(CreateSenderModel, Integer, Hash)>] CreateSenderModel data, response status code and response headers def create_sender_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SendersApi.create_sender ...' @@ -50,35 +40,46 @@ def create_sender_with_http_info(opts = {}) local_var_path = '/senders' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(opts[:'sender']) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'sender']) + + # return_type + return_type = opts[:debug_return_type] || 'CreateSenderModel' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"SendersApi.create_sender", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'CreateSenderModel') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SendersApi#create_sender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Delete a sender - # @param sender_id Id of the sender + # @param sender_id [Integer] Id of the sender # @param [Hash] opts the optional parameters # @return [nil] def delete_sender(sender_id, opts = {}) @@ -87,9 +88,9 @@ def delete_sender(sender_id, opts = {}) end # Delete a sender - # @param sender_id Id of the sender + # @param sender_id [Integer] Id of the sender # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_sender_with_http_info(sender_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SendersApi.delete_sender ...' @@ -99,35 +100,45 @@ def delete_sender_with_http_info(sender_id, opts = {}) fail ArgumentError, "Missing the required parameter 'sender_id' when calling SendersApi.delete_sender" end # resource path - local_var_path = '/senders/{senderId}'.sub('{' + 'senderId' + '}', sender_id.to_s) + local_var_path = '/senders/{senderId}'.sub('{' + 'senderId' + '}', CGI.escape(sender_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"SendersApi.delete_sender", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SendersApi#delete_sender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get all the dedicated IPs for your account # @param [Hash] opts the optional parameters # @return [GetIps] @@ -138,7 +149,7 @@ def get_ips(opts = {}) # Get all the dedicated IPs for your account # @param [Hash] opts the optional parameters - # @return [Array<(GetIps, Fixnum, Hash)>] GetIps data, response status code and response headers + # @return [Array<(GetIps, Integer, Hash)>] GetIps data, response status code and response headers def get_ips_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SendersApi.get_ips ...' @@ -147,35 +158,44 @@ def get_ips_with_http_info(opts = {}) local_var_path = '/senders/ips' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetIps' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"SendersApi.get_ips", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetIps') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SendersApi#get_ips\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get all the dedicated IPs for a sender - # @param sender_id Id of the sender + # @param sender_id [Integer] Id of the sender # @param [Hash] opts the optional parameters # @return [GetIpsFromSender] def get_ips_from_sender(sender_id, opts = {}) @@ -184,9 +204,9 @@ def get_ips_from_sender(sender_id, opts = {}) end # Get all the dedicated IPs for a sender - # @param sender_id Id of the sender + # @param sender_id [Integer] Id of the sender # @param [Hash] opts the optional parameters - # @return [Array<(GetIpsFromSender, Fixnum, Hash)>] GetIpsFromSender data, response status code and response headers + # @return [Array<(GetIpsFromSender, Integer, Hash)>] GetIpsFromSender data, response status code and response headers def get_ips_from_sender_with_http_info(sender_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SendersApi.get_ips_from_sender ...' @@ -196,36 +216,45 @@ def get_ips_from_sender_with_http_info(sender_id, opts = {}) fail ArgumentError, "Missing the required parameter 'sender_id' when calling SendersApi.get_ips_from_sender" end # resource path - local_var_path = '/senders/{senderId}/ips'.sub('{' + 'senderId' + '}', sender_id.to_s) + local_var_path = '/senders/{senderId}/ips'.sub('{' + 'senderId' + '}', CGI.escape(sender_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetIpsFromSender' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"SendersApi.get_ips_from_sender", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetIpsFromSender') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SendersApi#get_ips_from_sender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get the list of all your senders # @param [Hash] opts the optional parameters # @option opts [String] :ip Filter your senders for a specific ip (available for dedicated IP usage only) @@ -240,7 +269,7 @@ def get_senders(opts = {}) # @param [Hash] opts the optional parameters # @option opts [String] :ip Filter your senders for a specific ip (available for dedicated IP usage only) # @option opts [String] :domain Filter your senders for a specific domain - # @return [Array<(GetSendersList, Fixnum, Hash)>] GetSendersList data, response status code and response headers + # @return [Array<(GetSendersList, Integer, Hash)>] GetSendersList data, response status code and response headers def get_senders_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SendersApi.get_senders ...' @@ -249,37 +278,46 @@ def get_senders_with_http_info(opts = {}) local_var_path = '/senders' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'ip'] = opts[:'ip'] if !opts[:'ip'].nil? query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetSendersList' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"SendersApi.get_senders", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetSendersList') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SendersApi#get_senders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Update a sender - # @param sender_id Id of the sender + # @param sender_id [Integer] Id of the sender # @param [Hash] opts the optional parameters # @option opts [UpdateSender] :sender sender's name # @return [nil] @@ -289,10 +327,10 @@ def update_sender(sender_id, opts = {}) end # Update a sender - # @param sender_id Id of the sender + # @param sender_id [Integer] Id of the sender # @param [Hash] opts the optional parameters # @option opts [UpdateSender] :sender sender's name - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_sender_with_http_info(sender_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SendersApi.update_sender ...' @@ -302,30 +340,41 @@ def update_sender_with_http_info(sender_id, opts = {}) fail ArgumentError, "Missing the required parameter 'sender_id' when calling SendersApi.update_sender" end # resource path - local_var_path = '/senders/{senderId}'.sub('{' + 'senderId' + '}', sender_id.to_s) + local_var_path = '/senders/{senderId}'.sub('{' + 'senderId' + '}', CGI.escape(sender_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(opts[:'sender']) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'sender']) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"SendersApi.update_sender", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SendersApi#update_sender\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/sib-api-v3-sdk/api/sms_campaigns_api.rb b/lib/sib-api-v3-sdk/api/sms_campaigns_api.rb index 726e57c..57bd7b9 100644 --- a/lib/sib-api-v3-sdk/api/sms_campaigns_api.rb +++ b/lib/sib-api-v3-sdk/api/sms_campaigns_api.rb @@ -3,14 +3,14 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end -require 'uri' +require 'cgi' module SibApiV3Sdk class SMSCampaignsApi @@ -19,18 +19,8 @@ class SMSCampaignsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - - # Set custom user_agent if explicitly passed in api - # default will still remain Swagger-Codegen/#{VERSION}/ruby - def setUserAgent(user_agent) - @user_agent = user_agent - if user_agent.is_a?(String) && user_agent.downcase.start_with?('sendinblue_') - @api_client.default_headers['User-Agent'] = @user_agent - end - end - # Creates an SMS campaign - # @param create_sms_campaign Values to create an SMS Campaign + # @param create_sms_campaign [CreateSmsCampaign] Values to create an SMS Campaign # @param [Hash] opts the optional parameters # @return [CreateModel] def create_sms_campaign(create_sms_campaign, opts = {}) @@ -39,9 +29,9 @@ def create_sms_campaign(create_sms_campaign, opts = {}) end # Creates an SMS campaign - # @param create_sms_campaign Values to create an SMS Campaign + # @param create_sms_campaign [CreateSmsCampaign] Values to create an SMS Campaign # @param [Hash] opts the optional parameters - # @return [Array<(CreateModel, Fixnum, Hash)>] CreateModel data, response status code and response headers + # @return [Array<(CreateModel, Integer, Hash)>] CreateModel data, response status code and response headers def create_sms_campaign_with_http_info(create_sms_campaign, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SMSCampaignsApi.create_sms_campaign ...' @@ -54,35 +44,46 @@ def create_sms_campaign_with_http_info(create_sms_campaign, opts = {}) local_var_path = '/smsCampaigns' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(create_sms_campaign) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_sms_campaign) + + # return_type + return_type = opts[:debug_return_type] || 'CreateModel' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"SMSCampaignsApi.create_sms_campaign", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'CreateModel') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SMSCampaignsApi#create_sms_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Delete an SMS campaign - # @param campaign_id id of the SMS campaign + # @param campaign_id [Integer] id of the SMS campaign # @param [Hash] opts the optional parameters # @return [nil] def delete_sms_campaign(campaign_id, opts = {}) @@ -91,9 +92,9 @@ def delete_sms_campaign(campaign_id, opts = {}) end # Delete an SMS campaign - # @param campaign_id id of the SMS campaign + # @param campaign_id [Integer] id of the SMS campaign # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_sms_campaign_with_http_info(campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SMSCampaignsApi.delete_sms_campaign ...' @@ -103,37 +104,47 @@ def delete_sms_campaign_with_http_info(campaign_id, opts = {}) fail ArgumentError, "Missing the required parameter 'campaign_id' when calling SMSCampaignsApi.delete_sms_campaign" end # resource path - local_var_path = '/smsCampaigns/{campaignId}'.sub('{' + 'campaignId' + '}', campaign_id.to_s) + local_var_path = '/smsCampaigns/{campaignId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"SMSCampaignsApi.delete_sms_campaign", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SMSCampaignsApi#delete_sms_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get an SMS campaign - # @param campaign_id id of the SMS campaign + # @param campaign_id [Integer] id of the SMS campaign # @param [Hash] opts the optional parameters # @return [GetSmsCampaign] def get_sms_campaign(campaign_id, opts = {}) @@ -142,9 +153,9 @@ def get_sms_campaign(campaign_id, opts = {}) end # Get an SMS campaign - # @param campaign_id id of the SMS campaign + # @param campaign_id [Integer] id of the SMS campaign # @param [Hash] opts the optional parameters - # @return [Array<(GetSmsCampaign, Fixnum, Hash)>] GetSmsCampaign data, response status code and response headers + # @return [Array<(GetSmsCampaign, Integer, Hash)>] GetSmsCampaign data, response status code and response headers def get_sms_campaign_with_http_info(campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SMSCampaignsApi.get_sms_campaign ...' @@ -154,36 +165,45 @@ def get_sms_campaign_with_http_info(campaign_id, opts = {}) fail ArgumentError, "Missing the required parameter 'campaign_id' when calling SMSCampaignsApi.get_sms_campaign" end # resource path - local_var_path = '/smsCampaigns/{campaignId}'.sub('{' + 'campaignId' + '}', campaign_id.to_s) + local_var_path = '/smsCampaigns/{campaignId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetSmsCampaign' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"SMSCampaignsApi.get_sms_campaign", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetSmsCampaign') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SMSCampaignsApi#get_sms_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Returns the information for all your created SMS campaigns # @param [Hash] opts the optional parameters # @option opts [String] :status Status of campaign. @@ -191,7 +211,7 @@ def get_sms_campaign_with_http_info(campaign_id, opts = {}) # @option opts [String] :end_date Mandatory if startDate is used. Ending (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 'status' not passed and if passed is set to 'sent' ) # @option opts [Integer] :limit Number limitation for the result returned (default to 500) # @option opts [Integer] :offset Beginning point in the list to retrieve from. (default to 0) - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetSmsCampaigns] def get_sms_campaigns(opts = {}) data, _status_code, _headers = get_sms_campaigns_with_http_info(opts) @@ -206,26 +226,28 @@ def get_sms_campaigns(opts = {}) # @option opts [Integer] :limit Number limitation for the result returned # @option opts [Integer] :offset Beginning point in the list to retrieve from. # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetSmsCampaigns, Fixnum, Hash)>] GetSmsCampaigns data, response status code and response headers + # @return [Array<(GetSmsCampaigns, Integer, Hash)>] GetSmsCampaigns data, response status code and response headers def get_sms_campaigns_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SMSCampaignsApi.get_sms_campaigns ...' end - if @api_client.config.client_side_validation && opts[:'status'] && !['suspended', 'archive', 'sent', 'queued', 'draft', 'inProcess'].include?(opts[:'status']) - fail ArgumentError, 'invalid value for "status", must be one of suspended, archive, sent, queued, draft, inProcess' + allowable_values = ["suspended", "archive", "sent", "queued", "draft", "inProcess"] + if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) + fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SMSCampaignsApi.get_sms_campaigns, must be smaller than or equal to 1000.' end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/smsCampaigns' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? @@ -234,33 +256,42 @@ def get_sms_campaigns_with_http_info(opts = {}) query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetSmsCampaigns' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"SMSCampaignsApi.get_sms_campaigns", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetSmsCampaigns') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SMSCampaignsApi#get_sms_campaigns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Export an SMS campaign's recipients # It returns the background process ID which on completion calls the notify URL that you have set in the input. - # @param campaign_id id of the campaign + # @param campaign_id [Integer] id of the campaign # @param [Hash] opts the optional parameters # @option opts [RequestSmsRecipientExport] :recipient_export Values to send for a recipient export request # @return [CreatedProcessId] @@ -271,10 +302,10 @@ def request_sms_recipient_export(campaign_id, opts = {}) # Export an SMS campaign's recipients # It returns the background process ID which on completion calls the notify URL that you have set in the input. - # @param campaign_id id of the campaign + # @param campaign_id [Integer] id of the campaign # @param [Hash] opts the optional parameters # @option opts [RequestSmsRecipientExport] :recipient_export Values to send for a recipient export request - # @return [Array<(CreatedProcessId, Fixnum, Hash)>] CreatedProcessId data, response status code and response headers + # @return [Array<(CreatedProcessId, Integer, Hash)>] CreatedProcessId data, response status code and response headers def request_sms_recipient_export_with_http_info(campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SMSCampaignsApi.request_sms_recipient_export ...' @@ -284,38 +315,49 @@ def request_sms_recipient_export_with_http_info(campaign_id, opts = {}) fail ArgumentError, "Missing the required parameter 'campaign_id' when calling SMSCampaignsApi.request_sms_recipient_export" end # resource path - local_var_path = '/smsCampaigns/{campaignId}/exportRecipients'.sub('{' + 'campaignId' + '}', campaign_id.to_s) + local_var_path = '/smsCampaigns/{campaignId}/exportRecipients'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(opts[:'recipient_export']) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'recipient_export']) + + # return_type + return_type = opts[:debug_return_type] || 'CreatedProcessId' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"SMSCampaignsApi.request_sms_recipient_export", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'CreatedProcessId') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SMSCampaignsApi#request_sms_recipient_export\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Send your SMS campaign immediately - # @param campaign_id id of the campaign + # @param campaign_id [Integer] id of the campaign # @param [Hash] opts the optional parameters # @return [nil] def send_sms_campaign_now(campaign_id, opts = {}) @@ -324,9 +366,9 @@ def send_sms_campaign_now(campaign_id, opts = {}) end # Send your SMS campaign immediately - # @param campaign_id id of the campaign + # @param campaign_id [Integer] id of the campaign # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def send_sms_campaign_now_with_http_info(campaign_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SMSCampaignsApi.send_sms_campaign_now ...' @@ -336,39 +378,49 @@ def send_sms_campaign_now_with_http_info(campaign_id, opts = {}) fail ArgumentError, "Missing the required parameter 'campaign_id' when calling SMSCampaignsApi.send_sms_campaign_now" end # resource path - local_var_path = '/smsCampaigns/{campaignId}/sendNow'.sub('{' + 'campaignId' + '}', campaign_id.to_s) + local_var_path = '/smsCampaigns/{campaignId}/sendNow'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"SMSCampaignsApi.send_sms_campaign_now", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SMSCampaignsApi#send_sms_campaign_now\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Send an SMS campaign's report # Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail. - # @param campaign_id id of the campaign - # @param send_report Values for send a report + # @param campaign_id [Integer] id of the campaign + # @param send_report [SendReport] Values for send a report # @param [Hash] opts the optional parameters # @return [nil] def send_sms_report(campaign_id, send_report, opts = {}) @@ -378,10 +430,10 @@ def send_sms_report(campaign_id, send_report, opts = {}) # Send an SMS campaign's report # Send report of Sent and Archived campaign, to the specified email addresses, with respective data and a pdf attachment in detail. - # @param campaign_id id of the campaign - # @param send_report Values for send a report + # @param campaign_id [Integer] id of the campaign + # @param send_report [SendReport] Values for send a report # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def send_sms_report_with_http_info(campaign_id, send_report, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SMSCampaignsApi.send_sms_report ...' @@ -395,38 +447,50 @@ def send_sms_report_with_http_info(campaign_id, send_report, opts = {}) fail ArgumentError, "Missing the required parameter 'send_report' when calling SMSCampaignsApi.send_sms_report" end # resource path - local_var_path = '/smsCampaigns/{campaignId}/sendReport'.sub('{' + 'campaignId' + '}', campaign_id.to_s) + local_var_path = '/smsCampaigns/{campaignId}/sendReport'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(send_report) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(send_report) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"SMSCampaignsApi.send_sms_report", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SMSCampaignsApi#send_sms_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Send a test SMS campaign - # @param campaign_id Id of the SMS campaign - # @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 + # @param campaign_id [Integer] Id of the SMS campaign + # @param phone_number [SendTestSms] 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 # @param [Hash] opts the optional parameters # @return [nil] def send_test_sms(campaign_id, phone_number, opts = {}) @@ -435,10 +499,10 @@ def send_test_sms(campaign_id, phone_number, opts = {}) end # Send a test SMS campaign - # @param campaign_id Id of the SMS campaign - # @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 + # @param campaign_id [Integer] Id of the SMS campaign + # @param phone_number [SendTestSms] 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 # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def send_test_sms_with_http_info(campaign_id, phone_number, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SMSCampaignsApi.send_test_sms ...' @@ -452,38 +516,50 @@ def send_test_sms_with_http_info(campaign_id, phone_number, opts = {}) fail ArgumentError, "Missing the required parameter 'phone_number' when calling SMSCampaignsApi.send_test_sms" end # resource path - local_var_path = '/smsCampaigns/{campaignId}/sendTest'.sub('{' + 'campaignId' + '}', campaign_id.to_s) + local_var_path = '/smsCampaigns/{campaignId}/sendTest'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(phone_number) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(phone_number) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"SMSCampaignsApi.send_test_sms", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SMSCampaignsApi#send_test_sms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Update an SMS campaign - # @param campaign_id id of the SMS campaign - # @param update_sms_campaign Values to update an SMS Campaign + # @param campaign_id [Integer] id of the SMS campaign + # @param update_sms_campaign [UpdateSmsCampaign] Values to update an SMS Campaign # @param [Hash] opts the optional parameters # @return [nil] def update_sms_campaign(campaign_id, update_sms_campaign, opts = {}) @@ -492,10 +568,10 @@ def update_sms_campaign(campaign_id, update_sms_campaign, opts = {}) end # Update an SMS campaign - # @param campaign_id id of the SMS campaign - # @param update_sms_campaign Values to update an SMS Campaign + # @param campaign_id [Integer] id of the SMS campaign + # @param update_sms_campaign [UpdateSmsCampaign] Values to update an SMS Campaign # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_sms_campaign_with_http_info(campaign_id, update_sms_campaign, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SMSCampaignsApi.update_sms_campaign ...' @@ -509,38 +585,50 @@ def update_sms_campaign_with_http_info(campaign_id, update_sms_campaign, opts = fail ArgumentError, "Missing the required parameter 'update_sms_campaign' when calling SMSCampaignsApi.update_sms_campaign" end # resource path - local_var_path = '/smsCampaigns/{campaignId}'.sub('{' + 'campaignId' + '}', campaign_id.to_s) + local_var_path = '/smsCampaigns/{campaignId}'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(update_sms_campaign) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(update_sms_campaign) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"SMSCampaignsApi.update_sms_campaign", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SMSCampaignsApi#update_sms_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Update a campaign's status - # @param campaign_id id of the campaign - # @param status Status of the campaign. + # @param campaign_id [Integer] id of the campaign + # @param status [UpdateCampaignStatus] Status of the campaign. # @param [Hash] opts the optional parameters # @return [nil] def update_sms_campaign_status(campaign_id, status, opts = {}) @@ -549,10 +637,10 @@ def update_sms_campaign_status(campaign_id, status, opts = {}) end # Update a campaign's status - # @param campaign_id id of the campaign - # @param status Status of the campaign. + # @param campaign_id [Integer] id of the campaign + # @param status [UpdateCampaignStatus] Status of the campaign. # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_sms_campaign_status_with_http_info(campaign_id, status, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SMSCampaignsApi.update_sms_campaign_status ...' @@ -566,30 +654,41 @@ def update_sms_campaign_status_with_http_info(campaign_id, status, opts = {}) fail ArgumentError, "Missing the required parameter 'status' when calling SMSCampaignsApi.update_sms_campaign_status" end # resource path - local_var_path = '/smsCampaigns/{campaignId}/status'.sub('{' + 'campaignId' + '}', campaign_id.to_s) + local_var_path = '/smsCampaigns/{campaignId}/status'.sub('{' + 'campaignId' + '}', CGI.escape(campaign_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(status) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(status) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"SMSCampaignsApi.update_sms_campaign_status", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: SMSCampaignsApi#update_sms_campaign_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/sib-api-v3-sdk/api/transactional_emails_api.rb b/lib/sib-api-v3-sdk/api/transactional_emails_api.rb index 295e7cc..a51716c 100644 --- a/lib/sib-api-v3-sdk/api/transactional_emails_api.rb +++ b/lib/sib-api-v3-sdk/api/transactional_emails_api.rb @@ -3,14 +3,14 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end -require 'uri' +require 'cgi' module SibApiV3Sdk class TransactionalEmailsApi @@ -19,19 +19,9 @@ class TransactionalEmailsApi def initialize(api_client = ApiClient.default) @api_client = api_client end - - # Set custom user_agent if explicitly passed in api - # default will still remain Swagger-Codegen/#{VERSION}/ruby - def setUserAgent(user_agent) - @user_agent = user_agent - if user_agent.is_a?(String) && user_agent.downcase.start_with?('sendinblue_') - @api_client.default_headers['User-Agent'] = @user_agent - end - end - # Add a new domain to the list of blocked domains # Blocks a new domain in order to avoid messages being sent to the same - # @param block_domain + # @param block_domain [BlockDomain] # @param [Hash] opts the optional parameters # @return [nil] def block_new_domain(block_domain, opts = {}) @@ -41,9 +31,9 @@ def block_new_domain(block_domain, opts = {}) # Add a new domain to the list of blocked domains # Blocks a new domain in order to avoid messages being sent to the same - # @param block_domain + # @param block_domain [BlockDomain] # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def block_new_domain_with_http_info(block_domain, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.block_new_domain ...' @@ -56,34 +46,46 @@ def block_new_domain_with_http_info(block_domain, opts = {}) local_var_path = '/smtp/blockedDomains' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(block_domain) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(block_domain) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.block_new_domain", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#block_new_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Create an email template - # @param smtp_template values to update in transactional email template + # @param smtp_template [CreateSmtpTemplate] values to update in transactional email template # @param [Hash] opts the optional parameters # @return [CreateModel] def create_smtp_template(smtp_template, opts = {}) @@ -92,9 +94,9 @@ def create_smtp_template(smtp_template, opts = {}) end # Create an email template - # @param smtp_template values to update in transactional email template + # @param smtp_template [CreateSmtpTemplate] values to update in transactional email template # @param [Hash] opts the optional parameters - # @return [Array<(CreateModel, Fixnum, Hash)>] CreateModel data, response status code and response headers + # @return [Array<(CreateModel, Integer, Hash)>] CreateModel data, response status code and response headers def create_smtp_template_with_http_info(smtp_template, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.create_smtp_template ...' @@ -107,36 +109,47 @@ def create_smtp_template_with_http_info(smtp_template, opts = {}) local_var_path = '/smtp/templates' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(smtp_template) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(smtp_template) + + # return_type + return_type = opts[:debug_return_type] || 'CreateModel' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.create_smtp_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'CreateModel') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#create_smtp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Unblock an existing domain from the list of blocked domains # Unblocks an existing domain from the list of blocked domains - # @param domain The name of the domain to be deleted + # @param domain [String] The name of the domain to be deleted # @param [Hash] opts the optional parameters # @return [nil] def delete_blocked_domain(domain, opts = {}) @@ -146,9 +159,9 @@ def delete_blocked_domain(domain, opts = {}) # Unblock an existing domain from the list of blocked domains # Unblocks an existing domain from the list of blocked domains - # @param domain The name of the domain to be deleted + # @param domain [String] The name of the domain to be deleted # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_blocked_domain_with_http_info(domain, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.delete_blocked_domain ...' @@ -158,35 +171,45 @@ def delete_blocked_domain_with_http_info(domain, opts = {}) fail ArgumentError, "Missing the required parameter 'domain' when calling TransactionalEmailsApi.delete_blocked_domain" end # resource path - local_var_path = '/smtp/blockedDomains/{domain}'.sub('{' + 'domain' + '}', domain.to_s) + local_var_path = '/smtp/blockedDomains/{domain}'.sub('{' + 'domain' + '}', CGI.escape(domain.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.delete_blocked_domain", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#delete_blocked_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Delete hardbounces # Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) # @param [Hash] opts the optional parameters @@ -201,7 +224,7 @@ def delete_hardbounces(opts = {}) # Delete hardbounces. To use carefully (e.g. in case of temporary ISP failures) # @param [Hash] opts the optional parameters # @option opts [DeleteHardbounces] :delete_hardbounces values to delete hardbounces - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_hardbounces_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.delete_hardbounces ...' @@ -210,34 +233,46 @@ def delete_hardbounces_with_http_info(opts = {}) local_var_path = '/smtp/deleteHardbounces' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(opts[:'delete_hardbounces']) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'delete_hardbounces']) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.delete_hardbounces", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#delete_hardbounces\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Delete an inactive email template - # @param template_id id of the template + # @param template_id [Integer] id of the template # @param [Hash] opts the optional parameters # @return [nil] def delete_smtp_template(template_id, opts = {}) @@ -246,9 +281,9 @@ def delete_smtp_template(template_id, opts = {}) end # Delete an inactive email template - # @param template_id id of the template + # @param template_id [Integer] id of the template # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_smtp_template_with_http_info(template_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.delete_smtp_template ...' @@ -258,35 +293,45 @@ def delete_smtp_template_with_http_info(template_id, opts = {}) fail ArgumentError, "Missing the required parameter 'template_id' when calling TransactionalEmailsApi.delete_smtp_template" end # resource path - local_var_path = '/smtp/templates/{templateId}'.sub('{' + 'templateId' + '}', template_id.to_s) + local_var_path = '/smtp/templates/{templateId}'.sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.delete_smtp_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#delete_smtp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get your transactional email activity aggregated over a period of time # @param [Hash] opts the optional parameters # @option opts [String] :start_date Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate @@ -305,7 +350,7 @@ def get_aggregated_smtp_report(opts = {}) # @option opts [String] :end_date Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate # @option opts [Integer] :days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' # @option opts [String] :tag Tag of the emails - # @return [Array<(GetAggregatedReport, Fixnum, Hash)>] GetAggregatedReport data, response status code and response headers + # @return [Array<(GetAggregatedReport, Integer, Hash)>] GetAggregatedReport data, response status code and response headers def get_aggregated_smtp_report_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.get_aggregated_smtp_report ...' @@ -314,37 +359,46 @@ def get_aggregated_smtp_report_with_http_info(opts = {}) local_var_path = '/smtp/statistics/aggregatedReport' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil? query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetAggregatedReport' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.get_aggregated_smtp_report", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetAggregatedReport') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#get_aggregated_smtp_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get the list of blocked domains # Get the list of blocked domains # @param [Hash] opts the optional parameters @@ -357,7 +411,7 @@ def get_blocked_domains(opts = {}) # Get the list of blocked domains # Get the list of blocked domains # @param [Hash] opts the optional parameters - # @return [Array<(GetBlockedDomains, Fixnum, Hash)>] GetBlockedDomains data, response status code and response headers + # @return [Array<(GetBlockedDomains, Integer, Hash)>] GetBlockedDomains data, response status code and response headers def get_blocked_domains_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.get_blocked_domains ...' @@ -366,33 +420,42 @@ def get_blocked_domains_with_http_info(opts = {}) local_var_path = '/smtp/blockedDomains' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetBlockedDomains' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.get_blocked_domains", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetBlockedDomains') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#get_blocked_domains\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get all your transactional email activity (unaggregated events) # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number limitation for the result returned (default to 50) @@ -405,7 +468,7 @@ def get_blocked_domains_with_http_info(opts = {}) # @option opts [String] :tags Filter the report for tags (serialized and urlencoded array) # @option opts [String] :message_id Filter on a specific message id # @option opts [Integer] :template_id Filter on a specific template id - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetEmailEventReport] def get_email_event_report(opts = {}) data, _status_code, _headers = get_email_event_report_with_http_info(opts) @@ -425,7 +488,7 @@ def get_email_event_report(opts = {}) # @option opts [String] :message_id Filter on a specific message id # @option opts [Integer] :template_id Filter on a specific template id # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetEmailEventReport, Fixnum, Hash)>] GetEmailEventReport data, response status code and response headers + # @return [Array<(GetEmailEventReport, Integer, Hash)>] GetEmailEventReport data, response status code and response headers def get_email_event_report_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.get_email_event_report ...' @@ -434,17 +497,19 @@ def get_email_event_report_with_http_info(opts = {}) fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionalEmailsApi.get_email_event_report, must be smaller than or equal to 100.' end - if @api_client.config.client_side_validation && opts[:'event'] && !['bounces', 'hardBounces', 'softBounces', 'delivered', 'spam', 'requests', 'opened', 'clicks', 'invalid', 'deferred', 'blocked', 'unsubscribed', 'error'].include?(opts[:'event']) - fail ArgumentError, 'invalid value for "event", must be one of bounces, hardBounces, softBounces, delivered, spam, requests, opened, clicks, invalid, deferred, blocked, unsubscribed, error' + allowable_values = ["bounces", "hardBounces", "softBounces", "delivered", "spam", "requests", "opened", "clicks", "invalid", "deferred", "blocked", "unsubscribed", "error"] + if @api_client.config.client_side_validation && opts[:'event'] && !allowable_values.include?(opts[:'event']) + fail ArgumentError, "invalid value for \"event\", must be one of #{allowable_values}" end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/smtp/statistics/events' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? @@ -458,30 +523,39 @@ def get_email_event_report_with_http_info(opts = {}) query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetEmailEventReport' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.get_email_event_report", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetEmailEventReport') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#get_email_event_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get your transactional email activity aggregated per day # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents returned per page (default to 10) @@ -490,7 +564,7 @@ def get_email_event_report_with_http_info(opts = {}) # @option opts [String] :end_date Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD) # @option opts [Integer] :days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' # @option opts [String] :tag Tag of the emails - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetReports] def get_smtp_report(opts = {}) data, _status_code, _headers = get_smtp_report_with_http_info(opts) @@ -506,7 +580,7 @@ def get_smtp_report(opts = {}) # @option opts [Integer] :days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' # @option opts [String] :tag Tag of the emails # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetReports, Fixnum, Hash)>] GetReports data, response status code and response headers + # @return [Array<(GetReports, Integer, Hash)>] GetReports data, response status code and response headers def get_smtp_report_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.get_smtp_report ...' @@ -515,14 +589,15 @@ def get_smtp_report_with_http_info(opts = {}) fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionalEmailsApi.get_smtp_report, must be smaller than or equal to 30.' end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/smtp/statistics/reports' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? @@ -532,32 +607,41 @@ def get_smtp_report_with_http_info(opts = {}) query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetReports' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.get_smtp_report", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetReports') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#get_smtp_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Returns the template information - # @param template_id id of the template + # @param template_id [Integer] id of the template # @param [Hash] opts the optional parameters # @return [GetSmtpTemplateOverview] def get_smtp_template(template_id, opts = {}) @@ -566,9 +650,9 @@ def get_smtp_template(template_id, opts = {}) end # Returns the template information - # @param template_id id of the template + # @param template_id [Integer] id of the template # @param [Hash] opts the optional parameters - # @return [Array<(GetSmtpTemplateOverview, Fixnum, Hash)>] GetSmtpTemplateOverview data, response status code and response headers + # @return [Array<(GetSmtpTemplateOverview, Integer, Hash)>] GetSmtpTemplateOverview data, response status code and response headers def get_smtp_template_with_http_info(template_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.get_smtp_template ...' @@ -578,42 +662,51 @@ def get_smtp_template_with_http_info(template_id, opts = {}) fail ArgumentError, "Missing the required parameter 'template_id' when calling TransactionalEmailsApi.get_smtp_template" end # resource path - local_var_path = '/smtp/templates/{templateId}'.sub('{' + 'templateId' + '}', template_id.to_s) + local_var_path = '/smtp/templates/{templateId}'.sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetSmtpTemplateOverview' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.get_smtp_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetSmtpTemplateOverview') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#get_smtp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get the list of email templates # @param [Hash] opts the optional parameters - # @option opts [BOOLEAN] :template_status Filter on the status of the template. Active = true, inactive = false + # @option opts [Boolean] :template_status Filter on the status of the template. Active = true, inactive = false # @option opts [Integer] :limit Number of documents returned per page (default to 50) # @option opts [Integer] :offset Index of the first document in the page (default to 0) - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetSmtpTemplates] def get_smtp_templates(opts = {}) data, _status_code, _headers = get_smtp_templates_with_http_info(opts) @@ -622,11 +715,11 @@ def get_smtp_templates(opts = {}) # Get the list of email templates # @param [Hash] opts the optional parameters - # @option opts [BOOLEAN] :template_status Filter on the status of the template. Active = true, inactive = false + # @option opts [Boolean] :template_status Filter on the status of the template. Active = true, inactive = false # @option opts [Integer] :limit Number of documents returned per page # @option opts [Integer] :offset Index of the first document in the page # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetSmtpTemplates, Fixnum, Hash)>] GetSmtpTemplates data, response status code and response headers + # @return [Array<(GetSmtpTemplates, Integer, Hash)>] GetSmtpTemplates data, response status code and response headers def get_smtp_templates_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.get_smtp_templates ...' @@ -635,44 +728,54 @@ def get_smtp_templates_with_http_info(opts = {}) fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionalEmailsApi.get_smtp_templates, must be smaller than or equal to 1000.' end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/smtp/templates' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'templateStatus'] = opts[:'template_status'] if !opts[:'template_status'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetSmtpTemplates' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.get_smtp_templates", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetSmtpTemplates') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#get_smtp_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get the list of blocked or unsubscribed transactional contacts # @param [Hash] opts the optional parameters # @option opts [String] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts @@ -680,7 +783,7 @@ def get_smtp_templates_with_http_info(opts = {}) # @option opts [Integer] :limit Number of documents returned per page (default to 50) # @option opts [Integer] :offset Index of the first document on the page (default to 0) # @option opts [Array] :senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetTransacBlockedContacts] def get_transac_blocked_contacts(opts = {}) data, _status_code, _headers = get_transac_blocked_contacts_with_http_info(opts) @@ -695,7 +798,7 @@ def get_transac_blocked_contacts(opts = {}) # @option opts [Integer] :offset Index of the first document on the page # @option opts [Array] :senders Comma separated list of emails of the senders from which contacts are blocked or unsubscribed # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetTransacBlockedContacts, Fixnum, Hash)>] GetTransacBlockedContacts data, response status code and response headers + # @return [Array<(GetTransacBlockedContacts, Integer, Hash)>] GetTransacBlockedContacts data, response status code and response headers def get_transac_blocked_contacts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.get_transac_blocked_contacts ...' @@ -704,14 +807,15 @@ def get_transac_blocked_contacts_with_http_info(opts = {}) fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionalEmailsApi.get_transac_blocked_contacts, must be smaller than or equal to 100.' end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/smtp/blockedContacts' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? @@ -720,32 +824,41 @@ def get_transac_blocked_contacts_with_http_info(opts = {}) query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetTransacBlockedContacts' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.get_transac_blocked_contacts", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetTransacBlockedContacts') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#get_transac_blocked_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get the personalized content of a sent transactional email - # @param uuid Unique id of the transactional email that has been sent to a particular contact + # @param uuid [String] Unique id of the transactional email that has been sent to a particular contact # @param [Hash] opts the optional parameters # @return [GetTransacEmailContent] def get_transac_email_content(uuid, opts = {}) @@ -754,9 +867,9 @@ def get_transac_email_content(uuid, opts = {}) end # Get the personalized content of a sent transactional email - # @param uuid Unique id of the transactional email that has been sent to a particular contact + # @param uuid [String] Unique id of the transactional email that has been sent to a particular contact # @param [Hash] opts the optional parameters - # @return [Array<(GetTransacEmailContent, Fixnum, Hash)>] GetTransacEmailContent data, response status code and response headers + # @return [Array<(GetTransacEmailContent, Integer, Hash)>] GetTransacEmailContent data, response status code and response headers def get_transac_email_content_with_http_info(uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.get_transac_email_content ...' @@ -766,45 +879,56 @@ def get_transac_email_content_with_http_info(uuid, opts = {}) fail ArgumentError, "Missing the required parameter 'uuid' when calling TransactionalEmailsApi.get_transac_email_content" end # resource path - local_var_path = '/smtp/emails/{uuid}'.sub('{' + 'uuid' + '}', uuid.to_s) + local_var_path = '/smtp/emails/{uuid}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetTransacEmailContent' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.get_transac_email_content", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetTransacEmailContent') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#get_transac_email_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get the list of transactional emails on the basis of allowed filters # This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters. # @param [Hash] opts the optional parameters # @option opts [String] :email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. # @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. # @option opts [String] :message_id Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. - # @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. - # @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. - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @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. + # @option opts [String] :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. + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') + # @option opts [Integer] :limit Number of documents returned per page (default to 500) + # @option opts [Integer] :offset Index of the first document in the page (default to 0) # @return [GetTransacEmailsList] def get_transac_emails_list(opts = {}) data, _status_code, _headers = get_transac_emails_list_with_http_info(opts) @@ -817,58 +941,76 @@ def get_transac_emails_list(opts = {}) # @option opts [String] :email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. # @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. # @option opts [String] :message_id Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. - # @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. - # @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. + # @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. + # @option opts [String] :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. # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetTransacEmailsList, Fixnum, Hash)>] GetTransacEmailsList data, response status code and response headers + # @option opts [Integer] :limit Number of documents returned per page + # @option opts [Integer] :offset Index of the first document in the page + # @return [Array<(GetTransacEmailsList, Integer, Hash)>] GetTransacEmailsList data, response status code and response headers def get_transac_emails_list_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.get_transac_emails_list ...' end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionalEmailsApi.get_transac_emails_list, must be smaller than or equal to 1000.' + end + # resource path local_var_path = '/smtp/emails' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil? query_params[:'templateId'] = opts[:'template_id'] if !opts[:'template_id'].nil? query_params[:'messageId'] = opts[:'message_id'] if !opts[:'message_id'].nil? query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetTransacEmailsList' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.get_transac_emails_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetTransacEmailsList') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#get_transac_emails_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Send a template # This endpoint is deprecated. Prefer v3/smtp/email instead. - # @param template_id Id of the template - # @param send_email + # @param template_id [Integer] Id of the template + # @param send_email [SendEmail] # @param [Hash] opts the optional parameters # @return [SendTemplateEmail] def send_template(template_id, send_email, opts = {}) @@ -878,10 +1020,10 @@ def send_template(template_id, send_email, opts = {}) # Send a template # This endpoint is deprecated. Prefer v3/smtp/email instead. - # @param template_id Id of the template - # @param send_email + # @param template_id [Integer] Id of the template + # @param send_email [SendEmail] # @param [Hash] opts the optional parameters - # @return [Array<(SendTemplateEmail, Fixnum, Hash)>] SendTemplateEmail data, response status code and response headers + # @return [Array<(SendTemplateEmail, Integer, Hash)>] SendTemplateEmail data, response status code and response headers def send_template_with_http_info(template_id, send_email, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.send_template ...' @@ -895,39 +1037,50 @@ def send_template_with_http_info(template_id, send_email, opts = {}) fail ArgumentError, "Missing the required parameter 'send_email' when calling TransactionalEmailsApi.send_template" end # resource path - local_var_path = '/smtp/templates/{templateId}/send'.sub('{' + 'templateId' + '}', template_id.to_s) + local_var_path = '/smtp/templates/{templateId}/send'.sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(send_email) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(send_email) + + # return_type + return_type = opts[:debug_return_type] || 'SendTemplateEmail' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.send_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'SendTemplateEmail') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#send_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Send a template to your test list - # @param template_id Id of the template - # @param send_test_email + # @param template_id [Integer] Id of the template + # @param send_test_email [SendTestEmail] # @param [Hash] opts the optional parameters # @return [nil] def send_test_template(template_id, send_test_email, opts = {}) @@ -936,10 +1089,10 @@ def send_test_template(template_id, send_test_email, opts = {}) end # Send a template to your test list - # @param template_id Id of the template - # @param send_test_email + # @param template_id [Integer] Id of the template + # @param send_test_email [SendTestEmail] # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def send_test_template_with_http_info(template_id, send_test_email, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.send_test_template ...' @@ -953,37 +1106,49 @@ def send_test_template_with_http_info(template_id, send_test_email, opts = {}) fail ArgumentError, "Missing the required parameter 'send_test_email' when calling TransactionalEmailsApi.send_test_template" end # resource path - local_var_path = '/smtp/templates/{templateId}/sendTest'.sub('{' + 'templateId' + '}', template_id.to_s) + local_var_path = '/smtp/templates/{templateId}/sendTest'.sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(send_test_email) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(send_test_email) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.send_test_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#send_test_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Send a transactional email - # @param send_smtp_email Values to send a transactional email + # @param send_smtp_email [SendSmtpEmail] Values to send a transactional email # @param [Hash] opts the optional parameters # @return [CreateSmtpEmail] def send_transac_email(send_smtp_email, opts = {}) @@ -992,9 +1157,9 @@ def send_transac_email(send_smtp_email, opts = {}) end # Send a transactional email - # @param send_smtp_email Values to send a transactional email + # @param send_smtp_email [SendSmtpEmail] Values to send a transactional email # @param [Hash] opts the optional parameters - # @return [Array<(CreateSmtpEmail, Fixnum, Hash)>] CreateSmtpEmail data, response status code and response headers + # @return [Array<(CreateSmtpEmail, Integer, Hash)>] CreateSmtpEmail data, response status code and response headers def send_transac_email_with_http_info(send_smtp_email, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.send_transac_email ...' @@ -1007,35 +1172,46 @@ def send_transac_email_with_http_info(send_smtp_email, opts = {}) local_var_path = '/smtp/email' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(send_smtp_email) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(send_smtp_email) + + # return_type + return_type = opts[:debug_return_type] || 'CreateSmtpEmail' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.send_transac_email", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'CreateSmtpEmail') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#send_transac_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Unblock or resubscribe a transactional contact - # @param email contact email (urlencoded) to unblock. + # @param email [String] contact email (urlencoded) to unblock. # @param [Hash] opts the optional parameters # @return [nil] def smtp_blocked_contacts_email_delete(email, opts = {}) @@ -1044,9 +1220,9 @@ def smtp_blocked_contacts_email_delete(email, opts = {}) end # Unblock or resubscribe a transactional contact - # @param email contact email (urlencoded) to unblock. + # @param email [String] contact email (urlencoded) to unblock. # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def smtp_blocked_contacts_email_delete_with_http_info(email, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.smtp_blocked_contacts_email_delete ...' @@ -1056,37 +1232,47 @@ def smtp_blocked_contacts_email_delete_with_http_info(email, opts = {}) fail ArgumentError, "Missing the required parameter 'email' when calling TransactionalEmailsApi.smtp_blocked_contacts_email_delete" end # resource path - local_var_path = '/smtp/blockedContacts/{email}'.sub('{' + 'email' + '}', email.to_s) + local_var_path = '/smtp/blockedContacts/{email}'.sub('{' + 'email' + '}', CGI.escape(email.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.smtp_blocked_contacts_email_delete", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#smtp_blocked_contacts_email_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Delete an SMTP transactional log - # @param message_id MessageId of the transactional log to delete + # @param message_id [String] MessageId of the transactional log to delete # @param [Hash] opts the optional parameters # @return [nil] def smtp_log_message_id_delete(message_id, opts = {}) @@ -1095,9 +1281,9 @@ def smtp_log_message_id_delete(message_id, opts = {}) end # Delete an SMTP transactional log - # @param message_id MessageId of the transactional log to delete + # @param message_id [String] MessageId of the transactional log to delete # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def smtp_log_message_id_delete_with_http_info(message_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.smtp_log_message_id_delete ...' @@ -1107,38 +1293,48 @@ def smtp_log_message_id_delete_with_http_info(message_id, opts = {}) fail ArgumentError, "Missing the required parameter 'message_id' when calling TransactionalEmailsApi.smtp_log_message_id_delete" end # resource path - local_var_path = '/smtp/log/{messageId}'.sub('{' + 'messageId' + '}', message_id.to_s) + local_var_path = '/smtp/log/{messageId}'.sub('{' + 'messageId' + '}', CGI.escape(message_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.smtp_log_message_id_delete", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#smtp_log_message_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Update an email template - # @param template_id id of the template - # @param smtp_template values to update in transactional email template + # @param template_id [Integer] id of the template + # @param smtp_template [UpdateSmtpTemplate] values to update in transactional email template # @param [Hash] opts the optional parameters # @return [nil] def update_smtp_template(template_id, smtp_template, opts = {}) @@ -1147,10 +1343,10 @@ def update_smtp_template(template_id, smtp_template, opts = {}) end # Update an email template - # @param template_id id of the template - # @param smtp_template values to update in transactional email template + # @param template_id [Integer] id of the template + # @param smtp_template [UpdateSmtpTemplate] values to update in transactional email template # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_smtp_template_with_http_info(template_id, smtp_template, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalEmailsApi.update_smtp_template ...' @@ -1164,30 +1360,41 @@ def update_smtp_template_with_http_info(template_id, smtp_template, opts = {}) fail ArgumentError, "Missing the required parameter 'smtp_template' when calling TransactionalEmailsApi.update_smtp_template" end # resource path - local_var_path = '/smtp/templates/{templateId}'.sub('{' + 'templateId' + '}', template_id.to_s) + local_var_path = '/smtp/templates/{templateId}'.sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(smtp_template) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(smtp_template) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalEmailsApi.update_smtp_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalEmailsApi#update_smtp_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/sib-api-v3-sdk/api/transactional_sms_api.rb b/lib/sib-api-v3-sdk/api/transactional_sms_api.rb index 00c93e7..61cecac 100644 --- a/lib/sib-api-v3-sdk/api/transactional_sms_api.rb +++ b/lib/sib-api-v3-sdk/api/transactional_sms_api.rb @@ -3,14 +3,14 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end -require 'uri' +require 'cgi' module SibApiV3Sdk class TransactionalSMSApi @@ -19,16 +19,6 @@ class TransactionalSMSApi def initialize(api_client = ApiClient.default) @api_client = api_client end - - # Set custom user_agent if explicitly passed in api - # default will still remain Swagger-Codegen/#{VERSION}/ruby - def setUserAgent(user_agent) - @user_agent = user_agent - if user_agent.is_a?(String) && user_agent.downcase.start_with?('sendinblue_') - @api_client.default_headers['User-Agent'] = @user_agent - end - end - # Get all your SMS activity (unaggregated events) # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of documents per page (default to 50) @@ -39,7 +29,7 @@ def setUserAgent(user_agent) # @option opts [String] :phone_number Filter the report for a specific phone number # @option opts [String] :event Filter the report for specific events # @option opts [String] :tags Filter the report for specific tags passed as a serialized urlencoded array - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetSmsEventReport] def get_sms_events(opts = {}) data, _status_code, _headers = get_sms_events_with_http_info(opts) @@ -57,7 +47,7 @@ def get_sms_events(opts = {}) # @option opts [String] :event Filter the report for specific events # @option opts [String] :tags Filter the report for specific tags passed as a serialized urlencoded array # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetSmsEventReport, Fixnum, Hash)>] GetSmsEventReport data, response status code and response headers + # @return [Array<(GetSmsEventReport, Integer, Hash)>] GetSmsEventReport data, response status code and response headers def get_sms_events_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalSMSApi.get_sms_events ...' @@ -66,17 +56,19 @@ def get_sms_events_with_http_info(opts = {}) fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TransactionalSMSApi.get_sms_events, must be smaller than or equal to 100.' end - if @api_client.config.client_side_validation && opts[:'event'] && !['bounces', 'hardBounces', 'softBounces', 'delivered', 'sent', 'accepted', 'unsubscription', 'replies', 'blocked'].include?(opts[:'event']) - fail ArgumentError, 'invalid value for "event", must be one of bounces, hardBounces, softBounces, delivered, sent, accepted, unsubscription, replies, blocked' + allowable_values = ["bounces", "hardBounces", "softBounces", "delivered", "sent", "accepted", "unsubscription", "replies", "blocked"] + if @api_client.config.client_side_validation && opts[:'event'] && !allowable_values.include?(opts[:'event']) + fail ArgumentError, "invalid value for \"event\", must be one of #{allowable_values}" end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/transactionalSMS/statistics/events' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? @@ -88,30 +80,39 @@ def get_sms_events_with_http_info(opts = {}) query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetSmsEventReport' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalSMSApi.get_sms_events", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetSmsEventReport') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalSMSApi#get_sms_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get your SMS activity aggregated over a period of time # @param [Hash] opts the optional parameters # @option opts [String] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report @@ -130,7 +131,7 @@ def get_transac_aggregated_sms_report(opts = {}) # @option opts [String] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report # @option opts [Integer] :days Number of days in the past including today (positive integer). Not compatible with startDate and endDate # @option opts [String] :tag Filter on a tag - # @return [Array<(GetTransacAggregatedSmsReport, Fixnum, Hash)>] GetTransacAggregatedSmsReport data, response status code and response headers + # @return [Array<(GetTransacAggregatedSmsReport, Integer, Hash)>] GetTransacAggregatedSmsReport data, response status code and response headers def get_transac_aggregated_sms_report_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalSMSApi.get_transac_aggregated_sms_report ...' @@ -139,44 +140,53 @@ def get_transac_aggregated_sms_report_with_http_info(opts = {}) local_var_path = '/transactionalSMS/statistics/aggregatedReport' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil? query_params[:'tag'] = opts[:'tag'] if !opts[:'tag'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetTransacAggregatedSmsReport' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalSMSApi.get_transac_aggregated_sms_report", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetTransacAggregatedSmsReport') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalSMSApi#get_transac_aggregated_sms_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get your SMS activity aggregated per day # @param [Hash] opts the optional parameters # @option opts [String] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the report # @option opts [String] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the report # @option opts [Integer] :days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' # @option opts [String] :tag Filter on a tag - # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to desc) + # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed (default to 'desc') # @return [GetTransacSmsReport] def get_transac_sms_report(opts = {}) data, _status_code, _headers = get_transac_sms_report_with_http_info(opts) @@ -190,19 +200,20 @@ def get_transac_sms_report(opts = {}) # @option opts [Integer] :days Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate' # @option opts [String] :tag Filter on a tag # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed - # @return [Array<(GetTransacSmsReport, Fixnum, Hash)>] GetTransacSmsReport data, response status code and response headers + # @return [Array<(GetTransacSmsReport, Integer, Hash)>] GetTransacSmsReport data, response status code and response headers def get_transac_sms_report_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalSMSApi.get_transac_sms_report ...' end - if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort']) - fail ArgumentError, 'invalid value for "sort", must be one of asc, desc' + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/transactionalSMS/statistics/reports' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil? query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil? @@ -210,32 +221,41 @@ def get_transac_sms_report_with_http_info(opts = {}) query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetTransacSmsReport' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalSMSApi.get_transac_sms_report", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetTransacSmsReport') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalSMSApi#get_transac_sms_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Send SMS message to a mobile number - # @param send_transac_sms Values to send a transactional SMS + # @param send_transac_sms [SendTransacSms] Values to send a transactional SMS # @param [Hash] opts the optional parameters # @return [SendSms] def send_transac_sms(send_transac_sms, opts = {}) @@ -244,9 +264,9 @@ def send_transac_sms(send_transac_sms, opts = {}) end # Send SMS message to a mobile number - # @param send_transac_sms Values to send a transactional SMS + # @param send_transac_sms [SendTransacSms] Values to send a transactional SMS # @param [Hash] opts the optional parameters - # @return [Array<(SendSms, Fixnum, Hash)>] SendSms data, response status code and response headers + # @return [Array<(SendSms, Integer, Hash)>] SendSms data, response status code and response headers def send_transac_sms_with_http_info(send_transac_sms, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionalSMSApi.send_transac_sms ...' @@ -259,28 +279,38 @@ def send_transac_sms_with_http_info(send_transac_sms, opts = {}) local_var_path = '/transactionalSMS/sms' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(send_transac_sms) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(send_transac_sms) + + # return_type + return_type = opts[:debug_return_type] || 'SendSms' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"TransactionalSMSApi.send_transac_sms", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'SendSms') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransactionalSMSApi#send_transac_sms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/sib-api-v3-sdk/api/webhooks_api.rb b/lib/sib-api-v3-sdk/api/webhooks_api.rb index 4b7af5c..228fc2f 100644 --- a/lib/sib-api-v3-sdk/api/webhooks_api.rb +++ b/lib/sib-api-v3-sdk/api/webhooks_api.rb @@ -3,14 +3,14 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end -require 'uri' +require 'cgi' module SibApiV3Sdk class WebhooksApi @@ -19,18 +19,8 @@ class WebhooksApi def initialize(api_client = ApiClient.default) @api_client = api_client end - - # Set custom user_agent if explicitly passed in api - # default will still remain Swagger-Codegen/#{VERSION}/ruby - def setUserAgent(user_agent) - @user_agent = user_agent - if user_agent.is_a?(String) && user_agent.downcase.start_with?('sendinblue_') - @api_client.default_headers['User-Agent'] = @user_agent - end - end - # Create a webhook - # @param create_webhook Values to create a webhook + # @param create_webhook [CreateWebhook] Values to create a webhook # @param [Hash] opts the optional parameters # @return [CreateModel] def create_webhook(create_webhook, opts = {}) @@ -39,9 +29,9 @@ def create_webhook(create_webhook, opts = {}) end # Create a webhook - # @param create_webhook Values to create a webhook + # @param create_webhook [CreateWebhook] Values to create a webhook # @param [Hash] opts the optional parameters - # @return [Array<(CreateModel, Fixnum, Hash)>] CreateModel data, response status code and response headers + # @return [Array<(CreateModel, Integer, Hash)>] CreateModel data, response status code and response headers def create_webhook_with_http_info(create_webhook, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebhooksApi.create_webhook ...' @@ -54,35 +44,46 @@ def create_webhook_with_http_info(create_webhook, opts = {}) local_var_path = '/webhooks' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(create_webhook) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:POST, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_webhook) + + # return_type + return_type = opts[:debug_return_type] || 'CreateModel' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"WebhooksApi.create_webhook", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'CreateModel') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebhooksApi#create_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Delete a webhook - # @param webhook_id Id of the webhook + # @param webhook_id [Integer] Id of the webhook # @param [Hash] opts the optional parameters # @return [nil] def delete_webhook(webhook_id, opts = {}) @@ -91,9 +92,9 @@ def delete_webhook(webhook_id, opts = {}) end # Delete a webhook - # @param webhook_id Id of the webhook + # @param webhook_id [Integer] Id of the webhook # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_webhook_with_http_info(webhook_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebhooksApi.delete_webhook ...' @@ -103,37 +104,47 @@ def delete_webhook_with_http_info(webhook_id, opts = {}) fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhooksApi.delete_webhook" end # resource path - local_var_path = '/webhooks/{webhookId}'.sub('{' + 'webhookId' + '}', webhook_id.to_s) + local_var_path = '/webhooks/{webhookId}'.sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"WebhooksApi.delete_webhook", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebhooksApi#delete_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get a webhook details - # @param webhook_id Id of the webhook + # @param webhook_id [Integer] Id of the webhook # @param [Hash] opts the optional parameters # @return [GetWebhook] def get_webhook(webhook_id, opts = {}) @@ -142,9 +153,9 @@ def get_webhook(webhook_id, opts = {}) end # Get a webhook details - # @param webhook_id Id of the webhook + # @param webhook_id [Integer] Id of the webhook # @param [Hash] opts the optional parameters - # @return [Array<(GetWebhook, Fixnum, Hash)>] GetWebhook data, response status code and response headers + # @return [Array<(GetWebhook, Integer, Hash)>] GetWebhook data, response status code and response headers def get_webhook_with_http_info(webhook_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebhooksApi.get_webhook ...' @@ -154,39 +165,49 @@ def get_webhook_with_http_info(webhook_id, opts = {}) fail ArgumentError, "Missing the required parameter 'webhook_id' when calling WebhooksApi.get_webhook" end # resource path - local_var_path = '/webhooks/{webhookId}'.sub('{' + 'webhookId' + '}', webhook_id.to_s) + local_var_path = '/webhooks/{webhookId}'.sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetWebhook' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"WebhooksApi.get_webhook", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetWebhook') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebhooksApi#get_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Get all webhooks # @param [Hash] opts the optional parameters - # @option opts [String] :type Filter on webhook type (default to transactional) + # @option opts [String] :type Filter on webhook type (default to 'transactional') + # @option opts [String] :sort Sort the results in the ascending/descending order of webhook creation (default to 'desc') # @return [GetWebhooks] def get_webhooks(opts = {}) data, _status_code, _headers = get_webhooks_with_http_info(opts) @@ -196,49 +217,65 @@ def get_webhooks(opts = {}) # Get all webhooks # @param [Hash] opts the optional parameters # @option opts [String] :type Filter on webhook type - # @return [Array<(GetWebhooks, Fixnum, Hash)>] GetWebhooks data, response status code and response headers + # @option opts [String] :sort Sort the results in the ascending/descending order of webhook creation + # @return [Array<(GetWebhooks, Integer, Hash)>] GetWebhooks data, response status code and response headers def get_webhooks_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebhooksApi.get_webhooks ...' end - if @api_client.config.client_side_validation && opts[:'type'] && !['marketing', 'transactional'].include?(opts[:'type']) - fail ArgumentError, 'invalid value for "type", must be one of marketing, transactional' + allowable_values = ["marketing", "transactional"] + if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type']) + fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}" + end + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/webhooks' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:GET, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'GetWebhooks' + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"WebhooksApi.get_webhooks", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'GetWebhooks') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebhooksApi#get_webhooks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # Update a webhook - # @param webhook_id Id of the webhook - # @param update_webhook Values to update a webhook + # @param webhook_id [Integer] Id of the webhook + # @param update_webhook [UpdateWebhook] Values to update a webhook # @param [Hash] opts the optional parameters # @return [nil] def update_webhook(webhook_id, update_webhook, opts = {}) @@ -247,10 +284,10 @@ def update_webhook(webhook_id, update_webhook, opts = {}) end # Update a webhook - # @param webhook_id Id of the webhook - # @param update_webhook Values to update a webhook + # @param webhook_id [Integer] Id of the webhook + # @param update_webhook [UpdateWebhook] Values to update a webhook # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def update_webhook_with_http_info(webhook_id, update_webhook, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebhooksApi.update_webhook ...' @@ -264,30 +301,41 @@ def update_webhook_with_http_info(webhook_id, update_webhook, opts = {}) fail ArgumentError, "Missing the required parameter 'update_webhook' when calling WebhooksApi.update_webhook" end # resource path - local_var_path = '/webhooks/{webhookId}'.sub('{' + 'webhookId' + '}', webhook_id.to_s) + local_var_path = '/webhooks/{webhookId}'.sub('{' + 'webhookId' + '}', CGI.escape(webhook_id.to_s)) # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(update_webhook) - auth_names = ['api-key', 'partner-key'] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(update_webhook) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['api-key', 'partner-key'] + + new_options = opts.merge( + :operation => :"WebhooksApi.update_webhook", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebhooksApi#update_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/sib-api-v3-sdk/api_client.rb b/lib/sib-api-v3-sdk/api_client.rb index 7f31e32..0018f53 100644 --- a/lib/sib-api-v3-sdk/api_client.rb +++ b/lib/sib-api-v3-sdk/api_client.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,8 +14,8 @@ require 'json' require 'logger' require 'tempfile' +require 'time' require 'typhoeus' -require 'addressable/uri' module SibApiV3Sdk class ApiClient @@ -31,7 +31,7 @@ class ApiClient # @option config [Configuration] Configuration for initializing the object, default to Configuration.default def initialize(config = Configuration.default) @config = config - @user_agent = "Swagger-Codegen/#{VERSION}/ruby" + @user_agent = "OpenAPI-Generator/#{VERSION}/ruby" @default_headers = { 'Content-Type' => 'application/json', 'User-Agent' => @user_agent @@ -44,7 +44,7 @@ def self.default # Call an API with given options. # - # @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements: + # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: # the data deserialized from response body (could be nil), response status code and response headers. def call_api(http_method, path, opts = {}) request = build_request(http_method, path, opts) @@ -63,7 +63,7 @@ def call_api(http_method, path, opts = {}) :message => response.return_message) else fail ApiError.new(:code => response.code, - :response_headers => response.headers.to_h, + :response_headers => response.headers, :response_body => response.body), response.status_message end @@ -87,7 +87,7 @@ def call_api(http_method, path, opts = {}) # @option opts [Object] :body HTTP body (JSON/XML) # @return [Typhoeus::Request] A Typhoeus Request def build_request(http_method, path, opts = {}) - url = build_request_url(path) + url = build_request_url(path, opts) http_method = http_method.to_sym.downcase header_params = @default_headers.merge(opts[:header_params] || {}) @@ -112,8 +112,6 @@ def build_request(http_method, path, opts = {}) :verbose => @config.debugging } - req_opts.merge!(multipart: true) if header_params['Content-Type'].start_with? "multipart/" - # set custom cert, if provided req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert @@ -130,6 +128,72 @@ def build_request(http_method, path, opts = {}) request end + # Builds the HTTP request body + # + # @param [Hash] header_params Header parameters + # @param [Hash] form_params Query parameters + # @param [Object] body HTTP body (JSON/XML) + # @return [String] HTTP body data in the form of string + def build_request_body(header_params, form_params, body) + # http form + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || + header_params['Content-Type'] == 'multipart/form-data' + data = {} + form_params.each do |key, value| + case value + when ::File, ::Array, nil + # let typhoeus handle File, Array and nil parameters + data[key] = value + else + data[key] = value.to_s + end + end + elsif body + data = body.is_a?(String) ? body : body.to_json + else + data = nil + end + data + end + + # Save response body into a file in (the defined) temporary folder, using the filename + # from the "Content-Disposition" header if provided, otherwise a random filename. + # The response body is written to the file in chunks in order to handle files which + # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby + # process can use. + # + # @see Configuration#temp_folder_path + def download_file(request) + tempfile = nil + encoding = nil + request.on_headers do |response| + content_disposition = response.headers['Content-Disposition'] + if content_disposition && content_disposition =~ /filename=/i + filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] + prefix = sanitize_filename(filename) + else + prefix = 'download-' + end + prefix = prefix + '-' unless prefix.end_with?('-') + encoding = response.body.encoding + tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) + @tempfile = tempfile + end + request.on_body do |chunk| + chunk.force_encoding(encoding) + tempfile.write(chunk) + end + request.on_complete do |response| + if tempfile + tempfile.close + @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + end + end + end + # Check if the given MIME is a JSON MIME. # JSON MIME examples: # application/json @@ -145,7 +209,7 @@ def json_mime?(mime) # Deserialize the response to the given return type. # # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]" + # @param [String] return_type some examples: "User", "Array", "Hash" def deserialize(response, return_type) body = response.body @@ -166,7 +230,7 @@ def deserialize(response, return_type) begin data = JSON.parse("[#{body}]", :symbolize_names => true)[0] rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) + if %w(String Date Time).include?(return_type) data = body else raise e @@ -189,11 +253,11 @@ def convert_to_type(data, return_type) data.to_i when 'Float' data.to_f - when 'BOOLEAN' + when 'Boolean' data == true - when 'DateTime' + when 'Time' # parse date time (expecting ISO 8601 format) - DateTime.parse data + Time.parse data when 'Date' # parse date time (expecting ISO 8601 format) Date.parse data @@ -211,46 +275,9 @@ def convert_to_type(data, return_type) data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } end else - # models, e.g. Pet - SibApiV3Sdk.const_get(return_type).new.tap do |model| - model.build_from_hash data - end - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - tempfile.close - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(return_type) + klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data) end end @@ -263,38 +290,10 @@ def sanitize_filename(filename) filename.gsub(/.*[\/\\]/, '') end - def build_request_url(path) + def build_request_url(path, opts = {}) # Add leading and trailing slashes to path path = "/#{path}".gsub(/\/+/, '/') - Addressable::URI.encode(@config.base_url + path) - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data + @config.base_url(opts[:operation]) + path end # Update hearder and query params based on authentication settings. @@ -309,14 +308,14 @@ def update_params_for_auth!(header_params, query_params, auth_names) case auth_setting[:in] when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' + else fail ArgumentError, 'Authentication token must be in `query` or `header`' end end end # Sets user agent in HTTP header # - # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0) + # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0) def user_agent=(user_agent) @user_agent = user_agent @default_headers['User-Agent'] = @user_agent diff --git a/lib/sib-api-v3-sdk/api_error.rb b/lib/sib-api-v3-sdk/api_error.rb index 4812fb0..ab963da 100644 --- a/lib/sib-api-v3-sdk/api_error.rb +++ b/lib/sib-api-v3-sdk/api_error.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -34,5 +34,24 @@ def initialize(arg = nil) super arg end end + + # Override to_s to display a friendly error message + def to_s + message + end + + def message + if @message.nil? + msg = "Error message: the server returns an error" + else + msg = @message + end + + msg += "\nHTTP status code: #{code}" if code + msg += "\nResponse headers: #{response_headers}" if response_headers + msg += "\nResponse body: #{response_body}" if response_body + + msg + end end end diff --git a/lib/sib-api-v3-sdk/configuration.rb b/lib/sib-api-v3-sdk/configuration.rb index daaf900..93026e3 100644 --- a/lib/sib-api-v3-sdk/configuration.rb +++ b/lib/sib-api-v3-sdk/configuration.rb @@ -3,15 +3,13 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end -require 'addressable/uri' - module SibApiV3Sdk class Configuration # Defines url scheme @@ -23,6 +21,18 @@ class Configuration # Defines url base path attr_accessor :base_path + # Define server configuration index + attr_accessor :server_index + + # Define server operation configuration index + attr_accessor :server_operation_index + + # Default server variables + attr_accessor :server_variables + + # Default server operation variables + attr_accessor :server_operation_variables + # Defines API keys used with API Key authentications. # # @return [Hash] key: parameter name, value: parameter value (API key) @@ -131,6 +141,10 @@ def initialize @scheme = 'https' @host = 'api.sendinblue.com' @base_path = '/v3' + @server_index = 0 + @server_operation_index = {} + @server_variables = {} + @server_operation_variables = {} @api_key = {} @api_key_prefix = {} @timeout = 0 @@ -173,18 +187,23 @@ def base_path=(base_path) @base_path = '' if @base_path == '/' end - def base_url - url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - Addressable::URI.encode(url) + # Returns base URL for specified operation based on server settings + def base_url(operation = nil) + index = server_operation_index.fetch(operation, server_index) + return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil + + server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) end # Gets API key (with prefix if set). # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) + def api_key_with_prefix(param_name, param_alias = nil) + key = @api_key[param_name] + key = @api_key.fetch(param_alias, key) unless param_alias.nil? if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" + "#{@api_key_prefix[param_name]} #{key}" else - @api_key[param_name] + key end end @@ -212,5 +231,54 @@ def auth_settings }, } end + + # Returns an array of Server setting + def server_settings + [ + { + url: "https://api.sendinblue.com/v3", + description: "No description provided", + } + ] + end + + def operation_server_settings + { + } + end + + # Returns URL based on server settings + # + # @param index array index of the server settings + # @param variables hash of variable and the corresponding value + def server_url(index, variables = {}, servers = nil) + servers = server_settings if servers == nil + + # check array index out of bound + if (index < 0 || index >= servers.size) + fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}" + end + + server = servers[index] + url = server[:url] + + return url unless server.key? :variables + + # go through variable and assign a value + server[:variables].each do |name, variable| + if variables.key?(name) + if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name])) + url.gsub! "{" + name.to_s + "}", variables[name] + else + fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}." + end + else + # use default value + url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value] + end + end + + url + end end end diff --git a/lib/sib-api-v3-sdk/models/ab_test_campaign_result.rb b/lib/sib-api-v3-sdk/models/ab_test_campaign_result.rb index b876a16..24f4dda 100644 --- a/lib/sib-api-v3-sdk/models/ab_test_campaign_result.rb +++ b/lib/sib-api-v3-sdk/models/ab_test_campaign_result.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class AbTestCampaignResult @@ -72,8 +73,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'winning_version' => :'String', :'winning_criteria' => :'String', @@ -86,44 +92,57 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::AbTestCampaignResult` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::AbTestCampaignResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'winningVersion') - self.winning_version = attributes[:'winningVersion'] + if attributes.key?(:'winning_version') + self.winning_version = attributes[:'winning_version'] end - if attributes.has_key?(:'winningCriteria') - self.winning_criteria = attributes[:'winningCriteria'] + if attributes.key?(:'winning_criteria') + self.winning_criteria = attributes[:'winning_criteria'] end - if attributes.has_key?(:'winningSubjectLine') - self.winning_subject_line = attributes[:'winningSubjectLine'] + if attributes.key?(:'winning_subject_line') + self.winning_subject_line = attributes[:'winning_subject_line'] end - if attributes.has_key?(:'openRate') - self.open_rate = attributes[:'openRate'] + if attributes.key?(:'open_rate') + self.open_rate = attributes[:'open_rate'] end - if attributes.has_key?(:'clickRate') - self.click_rate = attributes[:'clickRate'] + if attributes.key?(:'click_rate') + self.click_rate = attributes[:'click_rate'] end - if attributes.has_key?(:'winningVersionRate') - self.winning_version_rate = attributes[:'winningVersionRate'] + if attributes.key?(:'winning_version_rate') + self.winning_version_rate = attributes[:'winning_version_rate'] end - if attributes.has_key?(:'statistics') + if attributes.key?(:'statistics') self.statistics = attributes[:'statistics'] end - if attributes.has_key?(:'clickedLinks') - self.clicked_links = attributes[:'clickedLinks'] + if attributes.key?(:'clicked_links') + self.clicked_links = attributes[:'clicked_links'] end end @@ -137,9 +156,9 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - winning_version_validator = EnumAttributeValidator.new('String', ['notAvailable', 'pending', 'tie', 'A', 'B']) + winning_version_validator = EnumAttributeValidator.new('String', ["notAvailable", "pending", "tie", "A", "B"]) return false unless winning_version_validator.valid?(@winning_version) - winning_criteria_validator = EnumAttributeValidator.new('String', ['Open', 'Click']) + winning_criteria_validator = EnumAttributeValidator.new('String', ["Open", "Click"]) return false unless winning_criteria_validator.valid?(@winning_criteria) true end @@ -147,9 +166,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] winning_version Object to be assigned def winning_version=(winning_version) - validator = EnumAttributeValidator.new('String', ['notAvailable', 'pending', 'tie', 'A', 'B']) + validator = EnumAttributeValidator.new('String', ["notAvailable", "pending", "tie", "A", "B"]) unless validator.valid?(winning_version) - fail ArgumentError, 'invalid value for "winning_version", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"winning_version\", must be one of #{validator.allowable_values}." end @winning_version = winning_version end @@ -157,9 +176,9 @@ def winning_version=(winning_version) # Custom attribute writer method checking allowed values (enum). # @param [Object] winning_criteria Object to be assigned def winning_criteria=(winning_criteria) - validator = EnumAttributeValidator.new('String', ['Open', 'Click']) + validator = EnumAttributeValidator.new('String', ["Open", "Click"]) unless validator.valid?(winning_criteria) - fail ArgumentError, 'invalid value for "winning_criteria", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"winning_criteria\", must be one of #{validator.allowable_values}." end @winning_criteria = winning_criteria end @@ -186,18 +205,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [winning_version, winning_criteria, winning_subject_line, open_rate, click_rate, winning_version_rate, statistics, clicked_links].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -205,7 +233,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -217,8 +245,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -227,7 +255,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -248,8 +276,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -271,7 +300,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -296,4 +329,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/ab_test_campaign_result_clicked_links.rb b/lib/sib-api-v3-sdk/models/ab_test_campaign_result_clicked_links.rb index aaadcea..3da51a1 100644 --- a/lib/sib-api-v3-sdk/models/ab_test_campaign_result_clicked_links.rb +++ b/lib/sib-api-v3-sdk/models/ab_test_campaign_result_clicked_links.rb @@ -3,19 +3,22 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class AbTestCampaignResultClickedLinks + # Information on clicked links for a particular version attr_accessor :version_a + # Information on clicked links for a particular version attr_accessor :version_b # Attribute mapping from ruby-style variable name to JSON key. @@ -26,28 +29,50 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'version_a' => :'AbTestVersionClicks', - :'version_b' => :'AbTestVersionClicks' + :'version_a' => :'Array', + :'version_b' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::AbTestCampaignResultClickedLinks` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::AbTestCampaignResultClickedLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'Version A') - self.version_a = attributes[:'Version A'] + if attributes.key?(:'version_a') + if (value = attributes[:'version_a']).is_a?(Array) + self.version_a = value + end end - if attributes.has_key?(:'Version B') - self.version_b = attributes[:'Version B'] + if attributes.key?(:'version_b') + if (value = attributes[:'version_b']).is_a?(Array) + self.version_b = value + end end end @@ -90,18 +115,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [version_a, version_b].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -109,7 +143,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -121,8 +155,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -131,7 +165,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -152,8 +186,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -175,7 +210,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -200,4 +239,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/ab_test_campaign_result_statistics.rb b/lib/sib-api-v3-sdk/models/ab_test_campaign_result_statistics.rb index 0cb9ff0..fffd849 100644 --- a/lib/sib-api-v3-sdk/models/ab_test_campaign_result_statistics.rb +++ b/lib/sib-api-v3-sdk/models/ab_test_campaign_result_statistics.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class AbTestCampaignResultStatistics @@ -38,8 +39,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'openers' => :'AbTestVersionStats', :'clicks' => :'AbTestVersionStats', @@ -50,35 +56,48 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::AbTestCampaignResultStatistics` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::AbTestCampaignResultStatistics`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'openers') + if attributes.key?(:'openers') self.openers = attributes[:'openers'] end - if attributes.has_key?(:'clicks') + if attributes.key?(:'clicks') self.clicks = attributes[:'clicks'] end - if attributes.has_key?(:'unsubscribed') + if attributes.key?(:'unsubscribed') self.unsubscribed = attributes[:'unsubscribed'] end - if attributes.has_key?(:'hardBounces') - self.hard_bounces = attributes[:'hardBounces'] + if attributes.key?(:'hard_bounces') + self.hard_bounces = attributes[:'hard_bounces'] end - if attributes.has_key?(:'softBounces') - self.soft_bounces = attributes[:'softBounces'] + if attributes.key?(:'soft_bounces') + self.soft_bounces = attributes[:'soft_bounces'] end - if attributes.has_key?(:'complaints') + if attributes.key?(:'complaints') self.complaints = attributes[:'complaints'] end end @@ -146,18 +165,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [openers, clicks, unsubscribed, hard_bounces, soft_bounces, complaints].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -165,7 +193,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -177,8 +205,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -187,7 +215,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -208,8 +236,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -231,7 +260,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -256,4 +289,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/ab_test_version_clicks.rb b/lib/sib-api-v3-sdk/models/ab_test_version_clicks.rb deleted file mode 100644 index 644346b..0000000 --- a/lib/sib-api-v3-sdk/models/ab_test_version_clicks.rb +++ /dev/null @@ -1,176 +0,0 @@ -=begin -#SendinBlue API - -#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 | - -OpenAPI spec version: 3.0.0 -Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 - -=end - -require 'date' - -module SibApiV3Sdk - # Information on clicked links for a particular version - class AbTestVersionClicks - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.swagger_types - { - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end -end diff --git a/lib/sib-api-v3-sdk/models/ab_test_version_stats.rb b/lib/sib-api-v3-sdk/models/ab_test_version_stats.rb index f567e7a..02f2c31 100644 --- a/lib/sib-api-v3-sdk/models/ab_test_version_stats.rb +++ b/lib/sib-api-v3-sdk/models/ab_test_version_stats.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Percentage of a particular event for both versions @@ -29,28 +30,46 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'version_a' => :'String', :'version_b' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::AbTestVersionStats` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::AbTestVersionStats`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'Version A') - self.version_a = attributes[:'Version A'] + if attributes.key?(:'version_a') + self.version_a = attributes[:'version_a'] end - if attributes.has_key?(:'Version B') - self.version_b = attributes[:'Version B'] + if attributes.key?(:'version_b') + self.version_b = attributes[:'version_b'] end end @@ -93,18 +112,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [version_a, version_b].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -112,7 +140,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -124,8 +152,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -134,7 +162,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -155,8 +183,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -178,7 +207,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -203,4 +236,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/add_child_domain.rb b/lib/sib-api-v3-sdk/models/add_child_domain.rb index d300be4..421aa37 100644 --- a/lib/sib-api-v3-sdk/models/add_child_domain.rb +++ b/lib/sib-api-v3-sdk/models/add_child_domain.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class AddChildDomain @@ -24,22 +25,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'domain' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::AddChildDomain` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::AddChildDomain`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'domain') + if attributes.key?(:'domain') self.domain = attributes[:'domain'] end end @@ -72,18 +91,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [domain].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -91,7 +119,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -103,8 +131,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -113,7 +141,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -134,8 +162,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -157,7 +186,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -182,4 +215,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/add_contact_to_list.rb b/lib/sib-api-v3-sdk/models/add_contact_to_list.rb index cb65c04..cc4fbe2 100644 --- a/lib/sib-api-v3-sdk/models/add_contact_to_list.rb +++ b/lib/sib-api-v3-sdk/models/add_contact_to_list.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class AddContactToList @@ -28,29 +29,47 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'emails' => :'Array', :'ids' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::AddContactToList` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::AddContactToList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'emails') + if attributes.key?(:'emails') if (value = attributes[:'emails']).is_a?(Array) self.emails = value end end - if attributes.has_key?(:'ids') + if attributes.key?(:'ids') if (value = attributes[:'ids']).is_a?(Array) self.ids = value end @@ -61,15 +80,63 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if !@emails.nil? && @emails.length > 150 + invalid_properties.push('invalid value for "emails", number of items must be less than or equal to 150.') + end + + if !@emails.nil? && @emails.length < 1 + invalid_properties.push('invalid value for "emails", number of items must be greater than or equal to 1.') + end + + if !@ids.nil? && @ids.length > 150 + invalid_properties.push('invalid value for "ids", number of items must be less than or equal to 150.') + end + + if !@ids.nil? && @ids.length < 1 + invalid_properties.push('invalid value for "ids", number of items must be greater than or equal to 1.') + end + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + return false if !@emails.nil? && @emails.length > 150 + return false if !@emails.nil? && @emails.length < 1 + return false if !@ids.nil? && @ids.length > 150 + return false if !@ids.nil? && @ids.length < 1 true end + # Custom attribute writer method with validation + # @param [Object] emails Value to be assigned + def emails=(emails) + if !emails.nil? && emails.length > 150 + fail ArgumentError, 'invalid value for "emails", number of items must be less than or equal to 150.' + end + + if !emails.nil? && emails.length < 1 + fail ArgumentError, 'invalid value for "emails", number of items must be greater than or equal to 1.' + end + + @emails = emails + end + + # Custom attribute writer method with validation + # @param [Object] ids Value to be assigned + def ids=(ids) + if !ids.nil? && ids.length > 150 + fail ArgumentError, 'invalid value for "ids", number of items must be less than or equal to 150.' + end + + if !ids.nil? && ids.length < 1 + fail ArgumentError, 'invalid value for "ids", number of items must be greater than or equal to 1.' + end + + @ids = ids + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -86,18 +153,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [emails, ids].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -105,7 +181,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -117,8 +193,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -127,7 +203,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -148,8 +224,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -171,7 +248,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -196,4 +277,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/add_credits.rb b/lib/sib-api-v3-sdk/models/add_credits.rb index 5d09a7a..268d6bb 100644 --- a/lib/sib-api-v3-sdk/models/add_credits.rb +++ b/lib/sib-api-v3-sdk/models/add_credits.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class AddCredits @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'sms' => :'Integer', :'email' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::AddCredits` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::AddCredits`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'sms') + if attributes.key?(:'sms') self.sms = attributes[:'sms'] end - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end end @@ -82,18 +101,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [sms, email].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -101,7 +129,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -113,8 +141,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -123,7 +151,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -144,8 +172,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -167,7 +196,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -192,4 +225,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/block_domain.rb b/lib/sib-api-v3-sdk/models/block_domain.rb index c95614c..d9f8bd1 100644 --- a/lib/sib-api-v3-sdk/models/block_domain.rb +++ b/lib/sib-api-v3-sdk/models/block_domain.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class BlockDomain @@ -24,22 +25,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'domain' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::BlockDomain` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::BlockDomain`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'domain') + if attributes.key?(:'domain') self.domain = attributes[:'domain'] end end @@ -77,18 +96,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [domain].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -96,7 +124,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -108,8 +136,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -118,7 +146,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -139,8 +167,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -162,7 +191,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -187,4 +220,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_attribute.rb b/lib/sib-api-v3-sdk/models/create_attribute.rb index e50d61a..bc17840 100644 --- a/lib/sib-api-v3-sdk/models/create_attribute.rb +++ b/lib/sib-api-v3-sdk/models/create_attribute.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateAttribute @@ -54,8 +55,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'value' => :'String', :'enumeration' => :'Array', @@ -63,25 +69,38 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateAttribute` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateAttribute`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'value') + if attributes.key?(:'value') self.value = attributes[:'value'] end - if attributes.has_key?(:'enumeration') + if attributes.key?(:'enumeration') if (value = attributes[:'enumeration']).is_a?(Array) self.enumeration = value end end - if attributes.has_key?(:'type') + if attributes.key?(:'type') self.type = attributes[:'type'] end end @@ -96,7 +115,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - type_validator = EnumAttributeValidator.new('String', ['text', 'date', 'float', 'boolean', 'id', 'category']) + type_validator = EnumAttributeValidator.new('String', ["text", "date", "float", "boolean", "id", "category"]) return false unless type_validator.valid?(@type) true end @@ -104,9 +123,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ['text', 'date', 'float', 'boolean', 'id', 'category']) + validator = EnumAttributeValidator.new('String', ["text", "date", "float", "boolean", "id", "category"]) unless validator.valid?(type) - fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @type = type end @@ -128,18 +147,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [value, enumeration, type].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -147,7 +175,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -159,8 +187,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -169,7 +197,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -190,8 +218,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -213,7 +242,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -238,4 +271,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_attribute_enumeration.rb b/lib/sib-api-v3-sdk/models/create_attribute_enumeration.rb index 3bda6d1..d6cbfdc 100644 --- a/lib/sib-api-v3-sdk/models/create_attribute_enumeration.rb +++ b/lib/sib-api-v3-sdk/models/create_attribute_enumeration.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateAttributeEnumeration @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'value' => :'Integer', :'label' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateAttributeEnumeration` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateAttributeEnumeration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'value') + if attributes.key?(:'value') self.value = attributes[:'value'] end - if attributes.has_key?(:'label') + if attributes.key?(:'label') self.label = attributes[:'label'] end end @@ -92,18 +111,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [value, label].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -111,7 +139,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -123,8 +151,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -133,7 +161,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,8 +182,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -177,7 +206,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -202,4 +235,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_child.rb b/lib/sib-api-v3-sdk/models/create_child.rb index 7235c05..9d6cc67 100644 --- a/lib/sib-api-v3-sdk/models/create_child.rb +++ b/lib/sib-api-v3-sdk/models/create_child.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateChild @@ -66,8 +67,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'first_name' => :'String', @@ -78,35 +84,48 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateChild` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateChild`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'firstName') - self.first_name = attributes[:'firstName'] + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] end - if attributes.has_key?(:'lastName') - self.last_name = attributes[:'lastName'] + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] end - if attributes.has_key?(:'companyName') - self.company_name = attributes[:'companyName'] + if attributes.key?(:'company_name') + self.company_name = attributes[:'company_name'] end - if attributes.has_key?(:'password') + if attributes.key?(:'password') self.password = attributes[:'password'] end - if attributes.has_key?(:'language') + if attributes.key?(:'language') self.language = attributes[:'language'] end end @@ -146,7 +165,7 @@ def valid? return false if @last_name.nil? return false if @company_name.nil? return false if @password.nil? - language_validator = EnumAttributeValidator.new('String', ['fr', 'es', 'pt', 'it', 'de', 'en']) + language_validator = EnumAttributeValidator.new('String', ["fr", "es", "pt", "it", "de", "en"]) return false unless language_validator.valid?(@language) true end @@ -154,9 +173,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] language Object to be assigned def language=(language) - validator = EnumAttributeValidator.new('String', ['fr', 'es', 'pt', 'it', 'de', 'en']) + validator = EnumAttributeValidator.new('String', ["fr", "es", "pt", "it", "de", "en"]) unless validator.valid?(language) - fail ArgumentError, 'invalid value for "language", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"language\", must be one of #{validator.allowable_values}." end @language = language end @@ -181,18 +200,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, first_name, last_name, company_name, password, language].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -200,7 +228,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -212,8 +240,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -222,7 +250,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -243,8 +271,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -266,7 +295,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -291,4 +324,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_contact.rb b/lib/sib-api-v3-sdk/models/create_contact.rb index d1edd3c..b030df0 100644 --- a/lib/sib-api-v3-sdk/models/create_contact.rb +++ b/lib/sib-api-v3-sdk/models/create_contact.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateContact @@ -48,57 +49,75 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'attributes' => :'Object', - :'email_blacklisted' => :'BOOLEAN', - :'sms_blacklisted' => :'BOOLEAN', + :'email_blacklisted' => :'Boolean', + :'sms_blacklisted' => :'Boolean', :'list_ids' => :'Array', - :'update_enabled' => :'BOOLEAN', + :'update_enabled' => :'Boolean', :'smtp_blacklist_sender' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateContact` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateContact`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'attributes') + if attributes.key?(:'attributes') self.attributes = attributes[:'attributes'] end - if attributes.has_key?(:'emailBlacklisted') - self.email_blacklisted = attributes[:'emailBlacklisted'] + if attributes.key?(:'email_blacklisted') + self.email_blacklisted = attributes[:'email_blacklisted'] end - if attributes.has_key?(:'smsBlacklisted') - self.sms_blacklisted = attributes[:'smsBlacklisted'] + if attributes.key?(:'sms_blacklisted') + self.sms_blacklisted = attributes[:'sms_blacklisted'] end - if attributes.has_key?(:'listIds') - if (value = attributes[:'listIds']).is_a?(Array) + if attributes.key?(:'list_ids') + if (value = attributes[:'list_ids']).is_a?(Array) self.list_ids = value end end - if attributes.has_key?(:'updateEnabled') - self.update_enabled = attributes[:'updateEnabled'] + if attributes.key?(:'update_enabled') + self.update_enabled = attributes[:'update_enabled'] else self.update_enabled = false end - if attributes.has_key?(:'smtpBlacklistSender') - if (value = attributes[:'smtpBlacklistSender']).is_a?(Array) + if attributes.key?(:'smtp_blacklist_sender') + if (value = attributes[:'smtp_blacklist_sender']).is_a?(Array) self.smtp_blacklist_sender = value end end @@ -138,18 +157,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, attributes, email_blacklisted, sms_blacklisted, list_ids, update_enabled, smtp_blacklist_sender].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -157,7 +185,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -169,8 +197,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -179,7 +207,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -200,8 +228,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -223,7 +252,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -248,4 +281,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_doi_contact.rb b/lib/sib-api-v3-sdk/models/create_doi_contact.rb index a282b69..bf7f296 100644 --- a/lib/sib-api-v3-sdk/models/create_doi_contact.rb +++ b/lib/sib-api-v3-sdk/models/create_doi_contact.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateDoiContact @@ -44,8 +45,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'attributes' => :'Object', @@ -56,40 +62,53 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateDoiContact` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateDoiContact`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'attributes') + if attributes.key?(:'attributes') self.attributes = attributes[:'attributes'] end - if attributes.has_key?(:'includeListIds') - if (value = attributes[:'includeListIds']).is_a?(Array) + if attributes.key?(:'include_list_ids') + if (value = attributes[:'include_list_ids']).is_a?(Array) self.include_list_ids = value end end - if attributes.has_key?(:'excludeListIds') - if (value = attributes[:'excludeListIds']).is_a?(Array) + if attributes.key?(:'exclude_list_ids') + if (value = attributes[:'exclude_list_ids']).is_a?(Array) self.exclude_list_ids = value end end - if attributes.has_key?(:'templateId') - self.template_id = attributes[:'templateId'] + if attributes.key?(:'template_id') + self.template_id = attributes[:'template_id'] end - if attributes.has_key?(:'redirectionUrl') - self.redirection_url = attributes[:'redirectionUrl'] + if attributes.key?(:'redirection_url') + self.redirection_url = attributes[:'redirection_url'] end end @@ -146,18 +165,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, attributes, include_list_ids, exclude_list_ids, template_id, redirection_url].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -165,7 +193,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -177,8 +205,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -187,7 +215,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -208,8 +236,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -231,7 +260,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -256,4 +289,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_email_campaign.rb b/lib/sib-api-v3-sdk/models/create_email_campaign.rb index 079f06e..eaafe5b 100644 --- a/lib/sib-api-v3-sdk/models/create_email_campaign.rb +++ b/lib/sib-api-v3-sdk/models/create_email_campaign.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateEmailCampaign @@ -152,8 +153,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'tag' => :'String', :'sender' => :'CreateEmailCampaignSender', @@ -167,151 +173,164 @@ def self.swagger_types :'to_field' => :'String', :'recipients' => :'CreateEmailCampaignRecipients', :'attachment_url' => :'String', - :'inline_image_activation' => :'BOOLEAN', - :'mirror_active' => :'BOOLEAN', + :'inline_image_activation' => :'Boolean', + :'mirror_active' => :'Boolean', :'footer' => :'String', :'header' => :'String', :'utm_campaign' => :'String', :'params' => :'Object', - :'send_at_best_time' => :'BOOLEAN', - :'ab_testing' => :'BOOLEAN', + :'send_at_best_time' => :'Boolean', + :'ab_testing' => :'Boolean', :'subject_a' => :'String', :'subject_b' => :'String', :'split_rule' => :'Integer', :'winner_criteria' => :'String', :'winner_delay' => :'Integer', - :'ip_warmup_enable' => :'BOOLEAN', + :'ip_warmup_enable' => :'Boolean', :'initial_quota' => :'Integer', :'increase_rate' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateEmailCampaign` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateEmailCampaign`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'tag') + if attributes.key?(:'tag') self.tag = attributes[:'tag'] end - if attributes.has_key?(:'sender') + if attributes.key?(:'sender') self.sender = attributes[:'sender'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'htmlContent') - self.html_content = attributes[:'htmlContent'] + if attributes.key?(:'html_content') + self.html_content = attributes[:'html_content'] end - if attributes.has_key?(:'htmlUrl') - self.html_url = attributes[:'htmlUrl'] + if attributes.key?(:'html_url') + self.html_url = attributes[:'html_url'] end - if attributes.has_key?(:'templateId') - self.template_id = attributes[:'templateId'] + if attributes.key?(:'template_id') + self.template_id = attributes[:'template_id'] end - if attributes.has_key?(:'scheduledAt') - self.scheduled_at = attributes[:'scheduledAt'] + if attributes.key?(:'scheduled_at') + self.scheduled_at = attributes[:'scheduled_at'] end - if attributes.has_key?(:'subject') + if attributes.key?(:'subject') self.subject = attributes[:'subject'] end - if attributes.has_key?(:'replyTo') - self.reply_to = attributes[:'replyTo'] + if attributes.key?(:'reply_to') + self.reply_to = attributes[:'reply_to'] end - if attributes.has_key?(:'toField') - self.to_field = attributes[:'toField'] + if attributes.key?(:'to_field') + self.to_field = attributes[:'to_field'] end - if attributes.has_key?(:'recipients') + if attributes.key?(:'recipients') self.recipients = attributes[:'recipients'] end - if attributes.has_key?(:'attachmentUrl') - self.attachment_url = attributes[:'attachmentUrl'] + if attributes.key?(:'attachment_url') + self.attachment_url = attributes[:'attachment_url'] end - if attributes.has_key?(:'inlineImageActivation') - self.inline_image_activation = attributes[:'inlineImageActivation'] + if attributes.key?(:'inline_image_activation') + self.inline_image_activation = attributes[:'inline_image_activation'] else self.inline_image_activation = false end - if attributes.has_key?(:'mirrorActive') - self.mirror_active = attributes[:'mirrorActive'] + if attributes.key?(:'mirror_active') + self.mirror_active = attributes[:'mirror_active'] end - if attributes.has_key?(:'footer') + if attributes.key?(:'footer') self.footer = attributes[:'footer'] end - if attributes.has_key?(:'header') + if attributes.key?(:'header') self.header = attributes[:'header'] end - if attributes.has_key?(:'utmCampaign') - self.utm_campaign = attributes[:'utmCampaign'] + if attributes.key?(:'utm_campaign') + self.utm_campaign = attributes[:'utm_campaign'] end - if attributes.has_key?(:'params') + if attributes.key?(:'params') self.params = attributes[:'params'] end - if attributes.has_key?(:'sendAtBestTime') - self.send_at_best_time = attributes[:'sendAtBestTime'] + if attributes.key?(:'send_at_best_time') + self.send_at_best_time = attributes[:'send_at_best_time'] else self.send_at_best_time = false end - if attributes.has_key?(:'abTesting') - self.ab_testing = attributes[:'abTesting'] + if attributes.key?(:'ab_testing') + self.ab_testing = attributes[:'ab_testing'] else self.ab_testing = false end - if attributes.has_key?(:'subjectA') - self.subject_a = attributes[:'subjectA'] + if attributes.key?(:'subject_a') + self.subject_a = attributes[:'subject_a'] end - if attributes.has_key?(:'subjectB') - self.subject_b = attributes[:'subjectB'] + if attributes.key?(:'subject_b') + self.subject_b = attributes[:'subject_b'] end - if attributes.has_key?(:'splitRule') - self.split_rule = attributes[:'splitRule'] + if attributes.key?(:'split_rule') + self.split_rule = attributes[:'split_rule'] end - if attributes.has_key?(:'winnerCriteria') - self.winner_criteria = attributes[:'winnerCriteria'] + if attributes.key?(:'winner_criteria') + self.winner_criteria = attributes[:'winner_criteria'] end - if attributes.has_key?(:'winnerDelay') - self.winner_delay = attributes[:'winnerDelay'] + if attributes.key?(:'winner_delay') + self.winner_delay = attributes[:'winner_delay'] end - if attributes.has_key?(:'ipWarmupEnable') - self.ip_warmup_enable = attributes[:'ipWarmupEnable'] + if attributes.key?(:'ip_warmup_enable') + self.ip_warmup_enable = attributes[:'ip_warmup_enable'] else self.ip_warmup_enable = false end - if attributes.has_key?(:'initialQuota') - self.initial_quota = attributes[:'initialQuota'] + if attributes.key?(:'initial_quota') + self.initial_quota = attributes[:'initial_quota'] end - if attributes.has_key?(:'increaseRate') - self.increase_rate = attributes[:'increaseRate'] + if attributes.key?(:'increase_rate') + self.increase_rate = attributes[:'increase_rate'] end end @@ -361,7 +380,7 @@ def valid? return false if @name.nil? return false if !@split_rule.nil? && @split_rule > 50 return false if !@split_rule.nil? && @split_rule < 1 - winner_criteria_validator = EnumAttributeValidator.new('String', ['open', 'click']) + winner_criteria_validator = EnumAttributeValidator.new('String', ["open", "click"]) return false unless winner_criteria_validator.valid?(@winner_criteria) return false if !@winner_delay.nil? && @winner_delay > 168 return false if !@winner_delay.nil? && @winner_delay < 1 @@ -387,9 +406,9 @@ def split_rule=(split_rule) # Custom attribute writer method checking allowed values (enum). # @param [Object] winner_criteria Object to be assigned def winner_criteria=(winner_criteria) - validator = EnumAttributeValidator.new('String', ['open', 'click']) + validator = EnumAttributeValidator.new('String', ["open", "click"]) unless validator.valid?(winner_criteria) - fail ArgumentError, 'invalid value for "winner_criteria", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"winner_criteria\", must be one of #{validator.allowable_values}." end @winner_criteria = winner_criteria end @@ -464,18 +483,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [tag, sender, name, html_content, html_url, template_id, scheduled_at, subject, reply_to, to_field, recipients, attachment_url, inline_image_activation, mirror_active, footer, header, utm_campaign, params, send_at_best_time, ab_testing, subject_a, subject_b, split_rule, winner_criteria, winner_delay, ip_warmup_enable, initial_quota, increase_rate].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -483,7 +511,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -495,8 +523,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -505,7 +533,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -526,8 +554,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -549,7 +578,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -574,4 +607,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_email_campaign_recipients.rb b/lib/sib-api-v3-sdk/models/create_email_campaign_recipients.rb index d3cc80b..a277740 100644 --- a/lib/sib-api-v3-sdk/models/create_email_campaign_recipients.rb +++ b/lib/sib-api-v3-sdk/models/create_email_campaign_recipients.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # List ids to include/exclude from campaign @@ -29,30 +30,48 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'exclusion_list_ids' => :'Array', :'list_ids' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateEmailCampaignRecipients` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateEmailCampaignRecipients`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'exclusionListIds') - if (value = attributes[:'exclusionListIds']).is_a?(Array) + if attributes.key?(:'exclusion_list_ids') + if (value = attributes[:'exclusion_list_ids']).is_a?(Array) self.exclusion_list_ids = value end end - if attributes.has_key?(:'listIds') - if (value = attributes[:'listIds']).is_a?(Array) + if attributes.key?(:'list_ids') + if (value = attributes[:'list_ids']).is_a?(Array) self.list_ids = value end end @@ -87,18 +106,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [exclusion_list_ids, list_ids].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -106,7 +134,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -118,8 +146,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -128,7 +156,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -149,8 +177,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -172,7 +201,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -197,4 +230,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_email_campaign_sender.rb b/lib/sib-api-v3-sdk/models/create_email_campaign_sender.rb index af77698..8369912 100644 --- a/lib/sib-api-v3-sdk/models/create_email_campaign_sender.rb +++ b/lib/sib-api-v3-sdk/models/create_email_campaign_sender.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` @@ -33,8 +34,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'String', :'email' => :'String', @@ -42,23 +48,36 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateEmailCampaignSender` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateEmailCampaignSender`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end end @@ -98,18 +117,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, email, id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -117,7 +145,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -129,8 +157,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -139,7 +167,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -160,8 +188,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -183,7 +212,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -208,4 +241,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_list.rb b/lib/sib-api-v3-sdk/models/create_list.rb index b3e73fd..d373f0c 100644 --- a/lib/sib-api-v3-sdk/models/create_list.rb +++ b/lib/sib-api-v3-sdk/models/create_list.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateList @@ -28,28 +29,46 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'String', :'folder_id' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateList` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'folderId') - self.folder_id = attributes[:'folderId'] + if attributes.key?(:'folder_id') + self.folder_id = attributes[:'folder_id'] end end @@ -92,18 +111,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, folder_id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -111,7 +139,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -123,8 +151,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -133,7 +161,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,8 +182,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -177,7 +206,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -202,4 +235,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_model.rb b/lib/sib-api-v3-sdk/models/create_model.rb index 0461a4c..b58774e 100644 --- a/lib/sib-api-v3-sdk/models/create_model.rb +++ b/lib/sib-api-v3-sdk/models/create_model.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateModel @@ -24,22 +25,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateModel` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end end @@ -77,18 +96,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -96,7 +124,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -108,8 +136,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -118,7 +146,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -139,8 +167,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -162,7 +191,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -187,4 +220,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_reseller.rb b/lib/sib-api-v3-sdk/models/create_reseller.rb index 6db5ef7..3ba0888 100644 --- a/lib/sib-api-v3-sdk/models/create_reseller.rb +++ b/lib/sib-api-v3-sdk/models/create_reseller.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateReseller @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'auth_key' => :'String', :'id' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateReseller` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateReseller`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'authKey') - self.auth_key = attributes[:'authKey'] + if attributes.key?(:'auth_key') + self.auth_key = attributes[:'auth_key'] end - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end end @@ -87,18 +106,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [auth_key, id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -106,7 +134,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -118,8 +146,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -128,7 +156,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -149,8 +177,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -172,7 +201,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -197,4 +230,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_sender.rb b/lib/sib-api-v3-sdk/models/create_sender.rb index e62ffda..494bb2d 100644 --- a/lib/sib-api-v3-sdk/models/create_sender.rb +++ b/lib/sib-api-v3-sdk/models/create_sender.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateSender @@ -32,8 +33,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'String', :'email' => :'String', @@ -41,23 +47,36 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateSender` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateSender`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'ips') + if attributes.key?(:'ips') if (value = attributes[:'ips']).is_a?(Array) self.ips = value end @@ -104,18 +123,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, email, ips].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -123,7 +151,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -135,8 +163,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -145,7 +173,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -166,8 +194,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -189,7 +218,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -214,4 +247,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_sender_ips.rb b/lib/sib-api-v3-sdk/models/create_sender_ips.rb index 6ecaf02..0fb48a0 100644 --- a/lib/sib-api-v3-sdk/models/create_sender_ips.rb +++ b/lib/sib-api-v3-sdk/models/create_sender_ips.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateSenderIps @@ -32,8 +33,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'ip' => :'String', :'domain' => :'String', @@ -41,23 +47,36 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateSenderIps` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateSenderIps`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'ip') + if attributes.key?(:'ip') self.ip = attributes[:'ip'] end - if attributes.has_key?(:'domain') + if attributes.key?(:'domain') self.domain = attributes[:'domain'] end - if attributes.has_key?(:'weight') + if attributes.key?(:'weight') self.weight = attributes[:'weight'] end end @@ -126,18 +145,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [ip, domain, weight].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -145,7 +173,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -157,8 +185,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -167,7 +195,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -188,8 +216,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -211,7 +240,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -236,4 +269,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_sender_model.rb b/lib/sib-api-v3-sdk/models/create_sender_model.rb index 4d2ac89..70a526d 100644 --- a/lib/sib-api-v3-sdk/models/create_sender_model.rb +++ b/lib/sib-api-v3-sdk/models/create_sender_model.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateSenderModel @@ -32,33 +33,51 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', - :'spf_error' => :'BOOLEAN', - :'dkim_error' => :'BOOLEAN' + :'spf_error' => :'Boolean', + :'dkim_error' => :'Boolean' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateSenderModel` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateSenderModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'spfError') - self.spf_error = attributes[:'spfError'] + if attributes.key?(:'spf_error') + self.spf_error = attributes[:'spf_error'] end - if attributes.has_key?(:'dkimError') - self.dkim_error = attributes[:'dkimError'] + if attributes.key?(:'dkim_error') + self.dkim_error = attributes[:'dkim_error'] end end @@ -97,18 +116,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id, spf_error, dkim_error].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -116,7 +144,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -128,8 +156,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -138,7 +166,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -159,8 +187,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -182,7 +211,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -207,4 +240,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_sms_campaign.rb b/lib/sib-api-v3-sdk/models/create_sms_campaign.rb index d1b504a..ed411a0 100644 --- a/lib/sib-api-v3-sdk/models/create_sms_campaign.rb +++ b/lib/sib-api-v3-sdk/models/create_sms_campaign.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateSmsCampaign @@ -39,8 +40,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'String', :'sender' => :'String', @@ -50,32 +56,45 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateSmsCampaign` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateSmsCampaign`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'sender') + if attributes.key?(:'sender') self.sender = attributes[:'sender'] end - if attributes.has_key?(:'content') + if attributes.key?(:'content') self.content = attributes[:'content'] end - if attributes.has_key?(:'recipients') + if attributes.key?(:'recipients') self.recipients = attributes[:'recipients'] end - if attributes.has_key?(:'scheduledAt') - self.scheduled_at = attributes[:'scheduledAt'] + if attributes.key?(:'scheduled_at') + self.scheduled_at = attributes[:'scheduled_at'] end end @@ -145,18 +164,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, sender, content, recipients, scheduled_at].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -164,7 +192,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -176,8 +204,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -186,7 +214,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -207,8 +235,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -230,7 +259,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -255,4 +288,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_sms_campaign_recipients.rb b/lib/sib-api-v3-sdk/models/create_sms_campaign_recipients.rb index 1ad2300..964e6d5 100644 --- a/lib/sib-api-v3-sdk/models/create_sms_campaign_recipients.rb +++ b/lib/sib-api-v3-sdk/models/create_sms_campaign_recipients.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateSmsCampaignRecipients @@ -28,30 +29,48 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'list_ids' => :'Array', :'exclusion_list_ids' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateSmsCampaignRecipients` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateSmsCampaignRecipients`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'listIds') - if (value = attributes[:'listIds']).is_a?(Array) + if attributes.key?(:'list_ids') + if (value = attributes[:'list_ids']).is_a?(Array) self.list_ids = value end end - if attributes.has_key?(:'exclusionListIds') - if (value = attributes[:'exclusionListIds']).is_a?(Array) + if attributes.key?(:'exclusion_list_ids') + if (value = attributes[:'exclusion_list_ids']).is_a?(Array) self.exclusion_list_ids = value end end @@ -91,18 +110,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [list_ids, exclusion_list_ids].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -110,7 +138,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -122,8 +150,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -132,7 +160,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -153,8 +181,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -176,7 +205,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -201,4 +234,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_smtp_email.rb b/lib/sib-api-v3-sdk/models/create_smtp_email.rb index bc86d9d..9810951 100644 --- a/lib/sib-api-v3-sdk/models/create_smtp_email.rb +++ b/lib/sib-api-v3-sdk/models/create_smtp_email.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateSmtpEmail @@ -27,28 +28,46 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'message_id' => :'String', :'message_ids' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateSmtpEmail` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateSmtpEmail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'messageId') - self.message_id = attributes[:'messageId'] + if attributes.key?(:'message_id') + self.message_id = attributes[:'message_id'] end - if attributes.has_key?(:'messageIds') - if (value = attributes[:'messageIds']).is_a?(Array) + if attributes.key?(:'message_ids') + if (value = attributes[:'message_ids']).is_a?(Array) self.message_ids = value end end @@ -83,18 +102,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [message_id, message_ids].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -102,7 +130,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -114,8 +142,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -124,7 +152,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -145,8 +173,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -168,7 +197,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -193,4 +226,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_smtp_template.rb b/lib/sib-api-v3-sdk/models/create_smtp_template.rb index ef514b1..a91da14 100644 --- a/lib/sib-api-v3-sdk/models/create_smtp_template.rb +++ b/lib/sib-api-v3-sdk/models/create_smtp_template.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateSmtpTemplate @@ -59,8 +60,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'tag' => :'String', :'sender' => :'CreateSmtpTemplateSender', @@ -71,56 +77,69 @@ def self.swagger_types :'reply_to' => :'String', :'to_field' => :'String', :'attachment_url' => :'String', - :'is_active' => :'BOOLEAN' + :'is_active' => :'Boolean' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateSmtpTemplate` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateSmtpTemplate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'tag') + if attributes.key?(:'tag') self.tag = attributes[:'tag'] end - if attributes.has_key?(:'sender') + if attributes.key?(:'sender') self.sender = attributes[:'sender'] end - if attributes.has_key?(:'templateName') - self.template_name = attributes[:'templateName'] + if attributes.key?(:'template_name') + self.template_name = attributes[:'template_name'] end - if attributes.has_key?(:'htmlContent') - self.html_content = attributes[:'htmlContent'] + if attributes.key?(:'html_content') + self.html_content = attributes[:'html_content'] end - if attributes.has_key?(:'htmlUrl') - self.html_url = attributes[:'htmlUrl'] + if attributes.key?(:'html_url') + self.html_url = attributes[:'html_url'] end - if attributes.has_key?(:'subject') + if attributes.key?(:'subject') self.subject = attributes[:'subject'] end - if attributes.has_key?(:'replyTo') - self.reply_to = attributes[:'replyTo'] + if attributes.key?(:'reply_to') + self.reply_to = attributes[:'reply_to'] end - if attributes.has_key?(:'toField') - self.to_field = attributes[:'toField'] + if attributes.key?(:'to_field') + self.to_field = attributes[:'to_field'] end - if attributes.has_key?(:'attachmentUrl') - self.attachment_url = attributes[:'attachmentUrl'] + if attributes.key?(:'attachment_url') + self.attachment_url = attributes[:'attachment_url'] end - if attributes.has_key?(:'isActive') - self.is_active = attributes[:'isActive'] + if attributes.key?(:'is_active') + self.is_active = attributes[:'is_active'] end end @@ -176,18 +195,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [tag, sender, template_name, html_content, html_url, subject, reply_to, to_field, attachment_url, is_active].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -195,7 +223,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -207,8 +235,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -217,7 +245,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -238,8 +266,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -261,7 +290,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -286,4 +319,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_smtp_template_sender.rb b/lib/sib-api-v3-sdk/models/create_smtp_template_sender.rb index e67c222..0b8bd22 100644 --- a/lib/sib-api-v3-sdk/models/create_smtp_template_sender.rb +++ b/lib/sib-api-v3-sdk/models/create_smtp_template_sender.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` @@ -33,8 +34,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'String', :'email' => :'String', @@ -42,23 +48,36 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateSmtpTemplateSender` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateSmtpTemplateSender`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end end @@ -93,18 +112,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, email, id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -112,7 +140,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -124,8 +152,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -134,7 +162,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -155,8 +183,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -178,7 +207,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -203,4 +236,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_update_contact_model.rb b/lib/sib-api-v3-sdk/models/create_update_contact_model.rb index b06e15d..88f5596 100644 --- a/lib/sib-api-v3-sdk/models/create_update_contact_model.rb +++ b/lib/sib-api-v3-sdk/models/create_update_contact_model.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateUpdateContactModel @@ -24,22 +25,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateUpdateContactModel` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateUpdateContactModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end end @@ -72,18 +91,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -91,7 +119,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -103,8 +131,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -113,7 +141,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -134,8 +162,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -157,7 +186,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -182,4 +215,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_update_folder.rb b/lib/sib-api-v3-sdk/models/create_update_folder.rb index 99a6655..bae42ec 100644 --- a/lib/sib-api-v3-sdk/models/create_update_folder.rb +++ b/lib/sib-api-v3-sdk/models/create_update_folder.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateUpdateFolder @@ -24,22 +25,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateUpdateFolder` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateUpdateFolder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end end @@ -72,18 +91,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -91,7 +119,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -103,8 +131,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -113,7 +141,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -134,8 +162,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -157,7 +186,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -182,4 +215,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/create_webhook.rb b/lib/sib-api-v3-sdk/models/create_webhook.rb index abf46c3..0d60209 100644 --- a/lib/sib-api-v3-sdk/models/create_webhook.rb +++ b/lib/sib-api-v3-sdk/models/create_webhook.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreateWebhook @@ -58,8 +59,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'url' => :'String', :'description' => :'String', @@ -68,29 +74,42 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreateWebhook` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'url') + if attributes.key?(:'url') self.url = attributes[:'url'] end - if attributes.has_key?(:'description') + if attributes.key?(:'description') self.description = attributes[:'description'] end - if attributes.has_key?(:'events') + if attributes.key?(:'events') if (value = attributes[:'events']).is_a?(Array) self.events = value end end - if attributes.has_key?(:'type') + if attributes.key?(:'type') self.type = attributes[:'type'] else self.type = 'transactional' @@ -117,7 +136,7 @@ def list_invalid_properties def valid? return false if @url.nil? return false if @events.nil? - type_validator = EnumAttributeValidator.new('String', ['transactional', 'marketing']) + type_validator = EnumAttributeValidator.new('String', ["transactional", "marketing"]) return false unless type_validator.valid?(@type) true end @@ -125,9 +144,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ['transactional', 'marketing']) + validator = EnumAttributeValidator.new('String', ["transactional", "marketing"]) unless validator.valid?(type) - fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @type = type end @@ -150,18 +169,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [url, description, events, type].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -169,7 +197,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -181,8 +209,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -191,7 +219,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -212,8 +240,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -235,7 +264,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -260,4 +293,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/created_process_id.rb b/lib/sib-api-v3-sdk/models/created_process_id.rb index c036c7c..1776d73 100644 --- a/lib/sib-api-v3-sdk/models/created_process_id.rb +++ b/lib/sib-api-v3-sdk/models/created_process_id.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class CreatedProcessId @@ -24,23 +25,41 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'process_id' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::CreatedProcessId` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::CreatedProcessId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'processId') - self.process_id = attributes[:'processId'] + if attributes.key?(:'process_id') + self.process_id = attributes[:'process_id'] end end @@ -77,18 +96,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [process_id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -96,7 +124,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -108,8 +136,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -118,7 +146,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -139,8 +167,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -162,7 +191,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -187,4 +220,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/delete_hardbounces.rb b/lib/sib-api-v3-sdk/models/delete_hardbounces.rb index b8b4671..24250c0 100644 --- a/lib/sib-api-v3-sdk/models/delete_hardbounces.rb +++ b/lib/sib-api-v3-sdk/models/delete_hardbounces.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class DeleteHardbounces @@ -32,8 +33,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'start_date' => :'String', :'end_date' => :'String', @@ -41,24 +47,37 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::DeleteHardbounces` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::DeleteHardbounces`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'startDate') - self.start_date = attributes[:'startDate'] + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] end - if attributes.has_key?(:'endDate') - self.end_date = attributes[:'endDate'] + if attributes.key?(:'end_date') + self.end_date = attributes[:'end_date'] end - if attributes.has_key?(:'contactEmail') - self.contact_email = attributes[:'contactEmail'] + if attributes.key?(:'contact_email') + self.contact_email = attributes[:'contact_email'] end end @@ -92,18 +111,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [start_date, end_date, contact_email].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -111,7 +139,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -123,8 +151,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -133,7 +161,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,8 +182,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -177,7 +206,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -202,4 +235,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/email_export_recipients.rb b/lib/sib-api-v3-sdk/models/email_export_recipients.rb index cf64537..0072210 100644 --- a/lib/sib-api-v3-sdk/models/email_export_recipients.rb +++ b/lib/sib-api-v3-sdk/models/email_export_recipients.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class EmailExportRecipients @@ -50,28 +51,46 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'notify_url' => :'String', :'recipients_type' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::EmailExportRecipients` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::EmailExportRecipients`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'notifyURL') - self.notify_url = attributes[:'notifyURL'] + if attributes.key?(:'notify_url') + self.notify_url = attributes[:'notify_url'] end - if attributes.has_key?(:'recipientsType') - self.recipients_type = attributes[:'recipientsType'] + if attributes.key?(:'recipients_type') + self.recipients_type = attributes[:'recipients_type'] end end @@ -90,7 +109,7 @@ def list_invalid_properties # @return true if the model is valid def valid? return false if @recipients_type.nil? - recipients_type_validator = EnumAttributeValidator.new('String', ['all', 'nonClickers', 'nonOpeners', 'clickers', 'openers', 'softBounces', 'hardBounces', 'unsubscribed']) + recipients_type_validator = EnumAttributeValidator.new('String', ["all", "nonClickers", "nonOpeners", "clickers", "openers", "softBounces", "hardBounces", "unsubscribed"]) return false unless recipients_type_validator.valid?(@recipients_type) true end @@ -98,9 +117,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] recipients_type Object to be assigned def recipients_type=(recipients_type) - validator = EnumAttributeValidator.new('String', ['all', 'nonClickers', 'nonOpeners', 'clickers', 'openers', 'softBounces', 'hardBounces', 'unsubscribed']) + validator = EnumAttributeValidator.new('String', ["all", "nonClickers", "nonOpeners", "clickers", "openers", "softBounces", "hardBounces", "unsubscribed"]) unless validator.valid?(recipients_type) - fail ArgumentError, 'invalid value for "recipients_type", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"recipients_type\", must be one of #{validator.allowable_values}." end @recipients_type = recipients_type end @@ -121,18 +140,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [notify_url, recipients_type].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -140,7 +168,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -152,8 +180,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -162,7 +190,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -183,8 +211,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -206,7 +235,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -231,4 +264,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/error_model.rb b/lib/sib-api-v3-sdk/models/error_model.rb index cf2abf9..ae2fc7c 100644 --- a/lib/sib-api-v3-sdk/models/error_model.rb +++ b/lib/sib-api-v3-sdk/models/error_model.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class ErrorModel @@ -50,27 +51,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'code' => :'String', :'message' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::ErrorModel` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::ErrorModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'code') + if attributes.key?(:'code') self.code = attributes[:'code'] end - if attributes.has_key?(:'message') + if attributes.key?(:'message') self.message = attributes[:'message'] end end @@ -94,7 +113,7 @@ def list_invalid_properties # @return true if the model is valid def valid? return false if @code.nil? - code_validator = EnumAttributeValidator.new('String', ['invalid_parameter', 'missing_parameter', 'out_of_range', 'campaign_processing', 'campaign_sent', 'document_not_found', 'reseller_permission_denied', 'not_enough_credits', 'permission_denied', 'duplicate_parameter', 'duplicate_request', 'method_not_allowed', 'unauthorized', 'account_under_validation', 'not_acceptable']) + code_validator = EnumAttributeValidator.new('String', ["invalid_parameter", "missing_parameter", "out_of_range", "campaign_processing", "campaign_sent", "document_not_found", "reseller_permission_denied", "not_enough_credits", "permission_denied", "duplicate_parameter", "duplicate_request", "method_not_allowed", "unauthorized", "account_under_validation", "not_acceptable"]) return false unless code_validator.valid?(@code) return false if @message.nil? true @@ -103,9 +122,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] code Object to be assigned def code=(code) - validator = EnumAttributeValidator.new('String', ['invalid_parameter', 'missing_parameter', 'out_of_range', 'campaign_processing', 'campaign_sent', 'document_not_found', 'reseller_permission_denied', 'not_enough_credits', 'permission_denied', 'duplicate_parameter', 'duplicate_request', 'method_not_allowed', 'unauthorized', 'account_under_validation', 'not_acceptable']) + validator = EnumAttributeValidator.new('String', ["invalid_parameter", "missing_parameter", "out_of_range", "campaign_processing", "campaign_sent", "document_not_found", "reseller_permission_denied", "not_enough_credits", "permission_denied", "duplicate_parameter", "duplicate_request", "method_not_allowed", "unauthorized", "account_under_validation", "not_acceptable"]) unless validator.valid?(code) - fail ArgumentError, 'invalid value for "code", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." end @code = code end @@ -126,18 +145,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [code, message].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -145,7 +173,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -157,8 +185,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -167,7 +195,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -188,8 +216,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -211,7 +240,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -236,4 +269,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_account.rb b/lib/sib-api-v3-sdk/models/get_account.rb index f9ced4c..03dc75b 100644 --- a/lib/sib-api-v3-sdk/models/get_account.rb +++ b/lib/sib-api-v3-sdk/models/get_account.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetAccount @@ -49,60 +50,86 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'first_name' => :'String', :'last_name' => :'String', :'company_name' => :'String', - :'address' => :'GetExtendedClientAddress', - :'plan' => :'Array', - :'relay' => :'GetAccountRelay', - :'marketing_automation' => :'GetAccountMarketingAutomation' + :'address' => :'GetExtendedClientAllOfAddress', + :'plan' => :'Array', + :'relay' => :'GetAccountAllOfRelay', + :'marketing_automation' => :'GetAccountAllOfMarketingAutomation' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'GetAccountAllOf', + :'GetExtendedClient' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetAccount` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'firstName') - self.first_name = attributes[:'firstName'] + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] end - if attributes.has_key?(:'lastName') - self.last_name = attributes[:'lastName'] + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] end - if attributes.has_key?(:'companyName') - self.company_name = attributes[:'companyName'] + if attributes.key?(:'company_name') + self.company_name = attributes[:'company_name'] end - if attributes.has_key?(:'address') + if attributes.key?(:'address') self.address = attributes[:'address'] end - if attributes.has_key?(:'plan') + if attributes.key?(:'plan') if (value = attributes[:'plan']).is_a?(Array) self.plan = value end end - if attributes.has_key?(:'relay') + if attributes.key?(:'relay') self.relay = attributes[:'relay'] end - if attributes.has_key?(:'marketingAutomation') - self.marketing_automation = attributes[:'marketingAutomation'] + if attributes.key?(:'marketing_automation') + self.marketing_automation = attributes[:'marketing_automation'] end end @@ -176,18 +203,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, first_name, last_name, company_name, address, plan, relay, marketing_automation].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -195,7 +231,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -207,8 +243,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -217,7 +253,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -238,8 +274,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -261,7 +298,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -286,4 +327,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/ab_test_version_clicks_inner.rb b/lib/sib-api-v3-sdk/models/get_account_all_of.rb similarity index 62% rename from lib/sib-api-v3-sdk/models/ab_test_version_clicks_inner.rb rename to lib/sib-api-v3-sdk/models/get_account_all_of.rb index e801672..f400293 100644 --- a/lib/sib-api-v3-sdk/models/ab_test_version_clicks_inner.rb +++ b/lib/sib-api-v3-sdk/models/get_account_all_of.rb @@ -3,62 +3,81 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk - class AbTestVersionClicksInner - # URL of the link - attr_accessor :link + class GetAccountAllOf + # Information about your plans and credits + attr_accessor :plan - # Number of times a link is clicked - attr_accessor :clicks_count + attr_accessor :relay - # Percentage of clicks of link with respect to total clicks - attr_accessor :click_rate + attr_accessor :marketing_automation # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'link' => :'link', - :'clicks_count' => :'clicksCount', - :'click_rate' => :'clickRate' + :'plan' => :'plan', + :'relay' => :'relay', + :'marketing_automation' => :'marketingAutomation' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'link' => :'String', - :'clicks_count' => :'Float', - :'click_rate' => :'String' + :'plan' => :'Array', + :'relay' => :'GetAccountAllOfRelay', + :'marketing_automation' => :'GetAccountAllOfMarketingAutomation' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetAccountAllOf` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetAccountAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'link') - self.link = attributes[:'link'] + if attributes.key?(:'plan') + if (value = attributes[:'plan']).is_a?(Array) + self.plan = value + end end - if attributes.has_key?(:'clicksCount') - self.clicks_count = attributes[:'clicksCount'] + if attributes.key?(:'relay') + self.relay = attributes[:'relay'] end - if attributes.has_key?(:'clickRate') - self.click_rate = attributes[:'clickRate'] + if attributes.key?(:'marketing_automation') + self.marketing_automation = attributes[:'marketing_automation'] end end @@ -66,16 +85,12 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new - if @link.nil? - invalid_properties.push('invalid value for "link", link cannot be nil.') - end - - if @clicks_count.nil? - invalid_properties.push('invalid value for "clicks_count", clicks_count cannot be nil.') + if @plan.nil? + invalid_properties.push('invalid value for "plan", plan cannot be nil.') end - if @click_rate.nil? - invalid_properties.push('invalid value for "click_rate", click_rate cannot be nil.') + if @relay.nil? + invalid_properties.push('invalid value for "relay", relay cannot be nil.') end invalid_properties @@ -84,9 +99,8 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - return false if @link.nil? - return false if @clicks_count.nil? - return false if @click_rate.nil? + return false if @plan.nil? + return false if @relay.nil? true end @@ -95,9 +109,9 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - link == o.link && - clicks_count == o.clicks_count && - click_rate == o.click_rate + plan == o.plan && + relay == o.relay && + marketing_automation == o.marketing_automation end # @see the `==` method @@ -107,9 +121,16 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash - [link, clicks_count, click_rate].hash + [plan, relay, marketing_automation].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) end # Builds the object from hash @@ -117,8 +138,10 @@ def hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -126,7 +149,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -138,8 +161,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -148,7 +171,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -169,8 +192,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -192,7 +216,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -217,4 +245,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_account_marketing_automation.rb b/lib/sib-api-v3-sdk/models/get_account_all_of_marketing_automation.rb similarity index 72% rename from lib/sib-api-v3-sdk/models/get_account_marketing_automation.rb rename to lib/sib-api-v3-sdk/models/get_account_all_of_marketing_automation.rb index 08d2d89..2d0fcd0 100644 --- a/lib/sib-api-v3-sdk/models/get_account_marketing_automation.rb +++ b/lib/sib-api-v3-sdk/models/get_account_all_of_marketing_automation.rb @@ -3,17 +3,18 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk - class GetAccountMarketingAutomation + class GetAccountAllOfMarketingAutomation # Marketing Automation Tracker ID attr_accessor :key @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'key' => :'String', - :'enabled' => :'BOOLEAN' + :'enabled' => :'Boolean' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetAccountAllOfMarketingAutomation` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetAccountAllOfMarketingAutomation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'key') + if attributes.key?(:'key') self.key = attributes[:'key'] end - if attributes.has_key?(:'enabled') + if attributes.key?(:'enabled') self.enabled = attributes[:'enabled'] end end @@ -87,18 +106,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [key, enabled].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -106,7 +134,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -118,8 +146,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -128,7 +156,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -149,8 +177,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -172,7 +201,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -197,4 +230,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_account_plan.rb b/lib/sib-api-v3-sdk/models/get_account_all_of_plan.rb similarity index 74% rename from lib/sib-api-v3-sdk/models/get_account_plan.rb rename to lib/sib-api-v3-sdk/models/get_account_all_of_plan.rb index 8f70b4c..364fbd6 100644 --- a/lib/sib-api-v3-sdk/models/get_account_plan.rb +++ b/lib/sib-api-v3-sdk/models/get_account_all_of_plan.rb @@ -3,17 +3,18 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk - class GetAccountPlan + class GetAccountAllOfPlan # Displays the plan type of the user attr_accessor :type @@ -66,8 +67,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'type' => :'String', :'credits_type' => :'String', @@ -78,36 +84,49 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetAccountAllOfPlan` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetAccountAllOfPlan`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'type') + if attributes.key?(:'type') self.type = attributes[:'type'] end - if attributes.has_key?(:'creditsType') - self.credits_type = attributes[:'creditsType'] + if attributes.key?(:'credits_type') + self.credits_type = attributes[:'credits_type'] end - if attributes.has_key?(:'credits') + if attributes.key?(:'credits') self.credits = attributes[:'credits'] end - if attributes.has_key?(:'startDate') - self.start_date = attributes[:'startDate'] + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] end - if attributes.has_key?(:'endDate') - self.end_date = attributes[:'endDate'] + if attributes.key?(:'end_date') + self.end_date = attributes[:'end_date'] end - if attributes.has_key?(:'userLimit') - self.user_limit = attributes[:'userLimit'] + if attributes.key?(:'user_limit') + self.user_limit = attributes[:'user_limit'] end end @@ -134,10 +153,10 @@ def list_invalid_properties # @return true if the model is valid def valid? return false if @type.nil? - type_validator = EnumAttributeValidator.new('String', ['payAsYouGo', 'free', 'subscription', 'sms', 'reseller']) + type_validator = EnumAttributeValidator.new('String', ["payAsYouGo", "free", "subscription", "sms", "reseller"]) return false unless type_validator.valid?(@type) return false if @credits_type.nil? - credits_type_validator = EnumAttributeValidator.new('String', ['sendLimit']) + credits_type_validator = EnumAttributeValidator.new('String', ["sendLimit"]) return false unless credits_type_validator.valid?(@credits_type) return false if @credits.nil? true @@ -146,9 +165,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ['payAsYouGo', 'free', 'subscription', 'sms', 'reseller']) + validator = EnumAttributeValidator.new('String', ["payAsYouGo", "free", "subscription", "sms", "reseller"]) unless validator.valid?(type) - fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @type = type end @@ -156,9 +175,9 @@ def type=(type) # Custom attribute writer method checking allowed values (enum). # @param [Object] credits_type Object to be assigned def credits_type=(credits_type) - validator = EnumAttributeValidator.new('String', ['sendLimit']) + validator = EnumAttributeValidator.new('String', ["sendLimit"]) unless validator.valid?(credits_type) - fail ArgumentError, 'invalid value for "credits_type", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"credits_type\", must be one of #{validator.allowable_values}." end @credits_type = credits_type end @@ -183,18 +202,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [type, credits_type, credits, start_date, end_date, user_limit].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -202,7 +230,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -214,8 +242,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -224,7 +252,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -245,8 +273,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -268,7 +297,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -293,4 +326,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_account_relay.rb b/lib/sib-api-v3-sdk/models/get_account_all_of_relay.rb similarity index 73% rename from lib/sib-api-v3-sdk/models/get_account_relay.rb rename to lib/sib-api-v3-sdk/models/get_account_all_of_relay.rb index 01e45bc..728cb20 100644 --- a/lib/sib-api-v3-sdk/models/get_account_relay.rb +++ b/lib/sib-api-v3-sdk/models/get_account_all_of_relay.rb @@ -3,18 +3,19 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Information about your transactional email account - class GetAccountRelay + class GetAccountAllOfRelay # Status of your transactional email Account (true=Enabled, false=Disabled) attr_accessor :enabled @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'enabled' => :'BOOLEAN', - :'data' => :'GetAccountRelayData' + :'enabled' => :'Boolean', + :'data' => :'GetAccountAllOfRelayData' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetAccountAllOfRelay` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetAccountAllOfRelay`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'enabled') + if attributes.key?(:'enabled') self.enabled = attributes[:'enabled'] end - if attributes.has_key?(:'data') + if attributes.key?(:'data') self.data = attributes[:'data'] end end @@ -92,18 +111,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [enabled, data].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -111,7 +139,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -123,8 +151,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -133,7 +161,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,8 +182,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -177,7 +206,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -202,4 +235,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_account_relay_data.rb b/lib/sib-api-v3-sdk/models/get_account_all_of_relay_data.rb similarity index 74% rename from lib/sib-api-v3-sdk/models/get_account_relay_data.rb rename to lib/sib-api-v3-sdk/models/get_account_all_of_relay_data.rb index b579850..98f6d51 100644 --- a/lib/sib-api-v3-sdk/models/get_account_relay_data.rb +++ b/lib/sib-api-v3-sdk/models/get_account_all_of_relay_data.rb @@ -3,18 +3,19 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Data regarding the transactional email account - class GetAccountRelayData + class GetAccountAllOfRelayData # Email to use as login on transactional platform attr_accessor :user_name @@ -33,8 +34,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'user_name' => :'String', :'relay' => :'String', @@ -42,23 +48,36 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetAccountAllOfRelayData` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetAccountAllOfRelayData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'userName') - self.user_name = attributes[:'userName'] + if attributes.key?(:'user_name') + self.user_name = attributes[:'user_name'] end - if attributes.has_key?(:'relay') + if attributes.key?(:'relay') self.relay = attributes[:'relay'] end - if attributes.has_key?(:'port') + if attributes.key?(:'port') self.port = attributes[:'port'] end end @@ -108,18 +127,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [user_name, relay, port].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -127,7 +155,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -139,8 +167,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -149,7 +177,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -170,8 +198,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -193,7 +222,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -218,4 +251,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_aggregated_report.rb b/lib/sib-api-v3-sdk/models/get_aggregated_report.rb index 67ac227..cc835aa 100644 --- a/lib/sib-api-v3-sdk/models/get_aggregated_report.rb +++ b/lib/sib-api-v3-sdk/models/get_aggregated_report.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetAggregatedReport @@ -72,8 +73,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'range' => :'String', :'requests' => :'Integer', @@ -91,63 +97,76 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetAggregatedReport` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetAggregatedReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'range') + if attributes.key?(:'range') self.range = attributes[:'range'] end - if attributes.has_key?(:'requests') + if attributes.key?(:'requests') self.requests = attributes[:'requests'] end - if attributes.has_key?(:'delivered') + if attributes.key?(:'delivered') self.delivered = attributes[:'delivered'] end - if attributes.has_key?(:'hardBounces') - self.hard_bounces = attributes[:'hardBounces'] + if attributes.key?(:'hard_bounces') + self.hard_bounces = attributes[:'hard_bounces'] end - if attributes.has_key?(:'softBounces') - self.soft_bounces = attributes[:'softBounces'] + if attributes.key?(:'soft_bounces') + self.soft_bounces = attributes[:'soft_bounces'] end - if attributes.has_key?(:'clicks') + if attributes.key?(:'clicks') self.clicks = attributes[:'clicks'] end - if attributes.has_key?(:'uniqueClicks') - self.unique_clicks = attributes[:'uniqueClicks'] + if attributes.key?(:'unique_clicks') + self.unique_clicks = attributes[:'unique_clicks'] end - if attributes.has_key?(:'opens') + if attributes.key?(:'opens') self.opens = attributes[:'opens'] end - if attributes.has_key?(:'uniqueOpens') - self.unique_opens = attributes[:'uniqueOpens'] + if attributes.key?(:'unique_opens') + self.unique_opens = attributes[:'unique_opens'] end - if attributes.has_key?(:'spamReports') - self.spam_reports = attributes[:'spamReports'] + if attributes.key?(:'spam_reports') + self.spam_reports = attributes[:'spam_reports'] end - if attributes.has_key?(:'blocked') + if attributes.key?(:'blocked') self.blocked = attributes[:'blocked'] end - if attributes.has_key?(:'invalid') + if attributes.key?(:'invalid') self.invalid = attributes[:'invalid'] end - if attributes.has_key?(:'unsubscribed') + if attributes.key?(:'unsubscribed') self.unsubscribed = attributes[:'unsubscribed'] end end @@ -192,18 +211,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [range, requests, delivered, hard_bounces, soft_bounces, clicks, unique_clicks, opens, unique_opens, spam_reports, blocked, invalid, unsubscribed].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -211,7 +239,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -223,8 +251,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -233,7 +261,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -254,8 +282,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -277,7 +306,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -302,4 +335,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_attributes.rb b/lib/sib-api-v3-sdk/models/get_attributes.rb index 4b17021..f442fa1 100644 --- a/lib/sib-api-v3-sdk/models/get_attributes.rb +++ b/lib/sib-api-v3-sdk/models/get_attributes.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetAttributes @@ -24,22 +25,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'attributes' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetAttributes` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'attributes') + if attributes.key?(:'attributes') if (value = attributes[:'attributes']).is_a?(Array) self.attributes = value end @@ -79,18 +98,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [attributes].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -98,7 +126,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -110,8 +138,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -120,7 +148,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -141,8 +169,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -164,7 +193,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -189,4 +222,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_attributes_attributes.rb b/lib/sib-api-v3-sdk/models/get_attributes_attributes.rb index 17bf985..5f90878 100644 --- a/lib/sib-api-v3-sdk/models/get_attributes_attributes.rb +++ b/lib/sib-api-v3-sdk/models/get_attributes_attributes.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetAttributesAttributes @@ -62,8 +63,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'String', :'category' => :'String', @@ -73,34 +79,47 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetAttributesAttributes` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetAttributesAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'category') + if attributes.key?(:'category') self.category = attributes[:'category'] end - if attributes.has_key?(:'type') + if attributes.key?(:'type') self.type = attributes[:'type'] end - if attributes.has_key?(:'enumeration') + if attributes.key?(:'enumeration') if (value = attributes[:'enumeration']).is_a?(Array) self.enumeration = value end end - if attributes.has_key?(:'calculatedValue') - self.calculated_value = attributes[:'calculatedValue'] + if attributes.key?(:'calculated_value') + self.calculated_value = attributes[:'calculated_value'] end end @@ -124,9 +143,9 @@ def list_invalid_properties def valid? return false if @name.nil? return false if @category.nil? - category_validator = EnumAttributeValidator.new('String', ['normal', 'transactional', 'category', 'calculated', 'global']) + category_validator = EnumAttributeValidator.new('String', ["normal", "transactional", "category", "calculated", "global"]) return false unless category_validator.valid?(@category) - type_validator = EnumAttributeValidator.new('String', ['text', 'date', 'float', 'id', 'boolean']) + type_validator = EnumAttributeValidator.new('String', ["text", "date", "float", "id", "boolean"]) return false unless type_validator.valid?(@type) true end @@ -134,9 +153,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] category Object to be assigned def category=(category) - validator = EnumAttributeValidator.new('String', ['normal', 'transactional', 'category', 'calculated', 'global']) + validator = EnumAttributeValidator.new('String', ["normal", "transactional", "category", "calculated", "global"]) unless validator.valid?(category) - fail ArgumentError, 'invalid value for "category", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"category\", must be one of #{validator.allowable_values}." end @category = category end @@ -144,9 +163,9 @@ def category=(category) # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ['text', 'date', 'float', 'id', 'boolean']) + validator = EnumAttributeValidator.new('String', ["text", "date", "float", "id", "boolean"]) unless validator.valid?(type) - fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @type = type end @@ -170,18 +189,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, category, type, enumeration, calculated_value].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -189,7 +217,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -201,8 +229,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -211,7 +239,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -232,8 +260,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -255,7 +284,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -280,4 +313,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_attributes_enumeration.rb b/lib/sib-api-v3-sdk/models/get_attributes_enumeration.rb index d6668f8..7c4a94e 100644 --- a/lib/sib-api-v3-sdk/models/get_attributes_enumeration.rb +++ b/lib/sib-api-v3-sdk/models/get_attributes_enumeration.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetAttributesEnumeration @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'value' => :'Integer', :'label' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetAttributesEnumeration` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetAttributesEnumeration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'value') + if attributes.key?(:'value') self.value = attributes[:'value'] end - if attributes.has_key?(:'label') + if attributes.key?(:'label') self.label = attributes[:'label'] end end @@ -92,18 +111,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [value, label].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -111,7 +139,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -123,8 +151,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -133,7 +161,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,8 +182,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -177,7 +206,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -202,4 +235,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_blocked_domains.rb b/lib/sib-api-v3-sdk/models/get_blocked_domains.rb index 0f3311f..277efa9 100644 --- a/lib/sib-api-v3-sdk/models/get_blocked_domains.rb +++ b/lib/sib-api-v3-sdk/models/get_blocked_domains.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # list of blocked domains @@ -25,22 +26,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'domains' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetBlockedDomains` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetBlockedDomains`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'domains') + if attributes.key?(:'domains') if (value = attributes[:'domains']).is_a?(Array) self.domains = value end @@ -80,18 +99,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [domains].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -99,7 +127,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -111,8 +139,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -121,7 +149,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -142,8 +170,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -165,7 +194,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -190,4 +223,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_campaign_overview.rb b/lib/sib-api-v3-sdk/models/get_campaign_overview.rb index bc8e701..13f58d4 100644 --- a/lib/sib-api-v3-sdk/models/get_campaign_overview.rb +++ b/lib/sib-api-v3-sdk/models/get_campaign_overview.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetCampaignOverview @@ -94,8 +95,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', :'name' => :'String', @@ -103,74 +109,87 @@ def self.swagger_types :'type' => :'String', :'status' => :'String', :'scheduled_at' => :'String', - :'ab_testing' => :'BOOLEAN', + :'ab_testing' => :'Boolean', :'subject_a' => :'String', :'subject_b' => :'String', :'split_rule' => :'Integer', :'winner_criteria' => :'String', :'winner_delay' => :'Integer', - :'send_at_best_time' => :'BOOLEAN' + :'send_at_best_time' => :'Boolean' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetCampaignOverview` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetCampaignOverview`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'subject') + if attributes.key?(:'subject') self.subject = attributes[:'subject'] end - if attributes.has_key?(:'type') + if attributes.key?(:'type') self.type = attributes[:'type'] end - if attributes.has_key?(:'status') + if attributes.key?(:'status') self.status = attributes[:'status'] end - if attributes.has_key?(:'scheduledAt') - self.scheduled_at = attributes[:'scheduledAt'] + if attributes.key?(:'scheduled_at') + self.scheduled_at = attributes[:'scheduled_at'] end - if attributes.has_key?(:'abTesting') - self.ab_testing = attributes[:'abTesting'] + if attributes.key?(:'ab_testing') + self.ab_testing = attributes[:'ab_testing'] end - if attributes.has_key?(:'subjectA') - self.subject_a = attributes[:'subjectA'] + if attributes.key?(:'subject_a') + self.subject_a = attributes[:'subject_a'] end - if attributes.has_key?(:'subjectB') - self.subject_b = attributes[:'subjectB'] + if attributes.key?(:'subject_b') + self.subject_b = attributes[:'subject_b'] end - if attributes.has_key?(:'splitRule') - self.split_rule = attributes[:'splitRule'] + if attributes.key?(:'split_rule') + self.split_rule = attributes[:'split_rule'] end - if attributes.has_key?(:'winnerCriteria') - self.winner_criteria = attributes[:'winnerCriteria'] + if attributes.key?(:'winner_criteria') + self.winner_criteria = attributes[:'winner_criteria'] end - if attributes.has_key?(:'winnerDelay') - self.winner_delay = attributes[:'winnerDelay'] + if attributes.key?(:'winner_delay') + self.winner_delay = attributes[:'winner_delay'] end - if attributes.has_key?(:'sendAtBestTime') - self.send_at_best_time = attributes[:'sendAtBestTime'] + if attributes.key?(:'send_at_best_time') + self.send_at_best_time = attributes[:'send_at_best_time'] end end @@ -203,10 +222,10 @@ def valid? return false if @id.nil? return false if @name.nil? return false if @type.nil? - type_validator = EnumAttributeValidator.new('String', ['classic', 'trigger']) + type_validator = EnumAttributeValidator.new('String', ["classic", "trigger"]) return false unless type_validator.valid?(@type) return false if @status.nil? - status_validator = EnumAttributeValidator.new('String', ['draft', 'sent', 'archive', 'queued', 'suspended', 'in_process']) + status_validator = EnumAttributeValidator.new('String', ["draft", "sent", "archive", "queued", "suspended", "in_process"]) return false unless status_validator.valid?(@status) true end @@ -214,9 +233,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ['classic', 'trigger']) + validator = EnumAttributeValidator.new('String', ["classic", "trigger"]) unless validator.valid?(type) - fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @type = type end @@ -224,9 +243,9 @@ def type=(type) # Custom attribute writer method checking allowed values (enum). # @param [Object] status Object to be assigned def status=(status) - validator = EnumAttributeValidator.new('String', ['draft', 'sent', 'archive', 'queued', 'suspended', 'in_process']) + validator = EnumAttributeValidator.new('String', ["draft", "sent", "archive", "queued", "suspended", "in_process"]) unless validator.valid?(status) - fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." end @status = status end @@ -258,18 +277,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id, name, subject, type, status, scheduled_at, ab_testing, subject_a, subject_b, split_rule, winner_criteria, winner_delay, send_at_best_time].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -277,7 +305,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -289,8 +317,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -299,7 +327,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -320,8 +348,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -343,7 +372,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -368,4 +401,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_campaign_recipients.rb b/lib/sib-api-v3-sdk/models/get_campaign_recipients.rb index 0638152..17538a8 100644 --- a/lib/sib-api-v3-sdk/models/get_campaign_recipients.rb +++ b/lib/sib-api-v3-sdk/models/get_campaign_recipients.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetCampaignRecipients @@ -26,30 +27,48 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'lists' => :'Array', :'exclusion_lists' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetCampaignRecipients` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetCampaignRecipients`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'lists') + if attributes.key?(:'lists') if (value = attributes[:'lists']).is_a?(Array) self.lists = value end end - if attributes.has_key?(:'exclusionLists') - if (value = attributes[:'exclusionLists']).is_a?(Array) + if attributes.key?(:'exclusion_lists') + if (value = attributes[:'exclusion_lists']).is_a?(Array) self.exclusion_lists = value end end @@ -94,18 +113,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [lists, exclusion_lists].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -113,7 +141,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -125,8 +153,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -135,7 +163,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -156,8 +184,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -179,7 +208,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -204,4 +237,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_campaign_stats.rb b/lib/sib-api-v3-sdk/models/get_campaign_stats.rb index 2504ad4..5967ae3 100644 --- a/lib/sib-api-v3-sdk/models/get_campaign_stats.rb +++ b/lib/sib-api-v3-sdk/models/get_campaign_stats.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetCampaignStats @@ -72,8 +73,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'list_id' => :'Integer', :'unique_clicks' => :'Integer', @@ -91,64 +97,77 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetCampaignStats` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetCampaignStats`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'listId') - self.list_id = attributes[:'listId'] + if attributes.key?(:'list_id') + self.list_id = attributes[:'list_id'] end - if attributes.has_key?(:'uniqueClicks') - self.unique_clicks = attributes[:'uniqueClicks'] + if attributes.key?(:'unique_clicks') + self.unique_clicks = attributes[:'unique_clicks'] end - if attributes.has_key?(:'clickers') + if attributes.key?(:'clickers') self.clickers = attributes[:'clickers'] end - if attributes.has_key?(:'complaints') + if attributes.key?(:'complaints') self.complaints = attributes[:'complaints'] end - if attributes.has_key?(:'delivered') + if attributes.key?(:'delivered') self.delivered = attributes[:'delivered'] end - if attributes.has_key?(:'sent') + if attributes.key?(:'sent') self.sent = attributes[:'sent'] end - if attributes.has_key?(:'softBounces') - self.soft_bounces = attributes[:'softBounces'] + if attributes.key?(:'soft_bounces') + self.soft_bounces = attributes[:'soft_bounces'] end - if attributes.has_key?(:'hardBounces') - self.hard_bounces = attributes[:'hardBounces'] + if attributes.key?(:'hard_bounces') + self.hard_bounces = attributes[:'hard_bounces'] end - if attributes.has_key?(:'uniqueViews') - self.unique_views = attributes[:'uniqueViews'] + if attributes.key?(:'unique_views') + self.unique_views = attributes[:'unique_views'] end - if attributes.has_key?(:'unsubscriptions') + if attributes.key?(:'unsubscriptions') self.unsubscriptions = attributes[:'unsubscriptions'] end - if attributes.has_key?(:'viewed') + if attributes.key?(:'viewed') self.viewed = attributes[:'viewed'] end - if attributes.has_key?(:'deferred') + if attributes.key?(:'deferred') self.deferred = attributes[:'deferred'] end - if attributes.has_key?(:'returnBounce') - self.return_bounce = attributes[:'returnBounce'] + if attributes.key?(:'return_bounce') + self.return_bounce = attributes[:'return_bounce'] end end @@ -242,18 +261,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [list_id, unique_clicks, clickers, complaints, delivered, sent, soft_bounces, hard_bounces, unique_views, unsubscriptions, viewed, deferred, return_bounce].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -261,7 +289,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -273,8 +301,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -283,7 +311,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -304,8 +332,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -327,7 +356,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -352,4 +385,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_child_account_creation_status.rb b/lib/sib-api-v3-sdk/models/get_child_account_creation_status.rb index 8f5586c..be1426b 100644 --- a/lib/sib-api-v3-sdk/models/get_child_account_creation_status.rb +++ b/lib/sib-api-v3-sdk/models/get_child_account_creation_status.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetChildAccountCreationStatus @@ -24,23 +25,41 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'child_account_created' => :'BOOLEAN' + :'child_account_created' => :'Boolean' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetChildAccountCreationStatus` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetChildAccountCreationStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'childAccountCreated') - self.child_account_created = attributes[:'childAccountCreated'] + if attributes.key?(:'child_account_created') + self.child_account_created = attributes[:'child_account_created'] end end @@ -77,18 +96,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [child_account_created].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -96,7 +124,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -108,8 +136,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -118,7 +146,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -139,8 +167,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -162,7 +191,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -187,4 +220,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_child_domain.rb b/lib/sib-api-v3-sdk/models/get_child_domain.rb index 1fb006c..1a65360 100644 --- a/lib/sib-api-v3-sdk/models/get_child_domain.rb +++ b/lib/sib-api-v3-sdk/models/get_child_domain.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetChildDomain @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'domain' => :'String', - :'active' => :'BOOLEAN' + :'active' => :'Boolean' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetChildDomain` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetChildDomain`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'domain') + if attributes.key?(:'domain') self.domain = attributes[:'domain'] end - if attributes.has_key?(:'active') + if attributes.key?(:'active') self.active = attributes[:'active'] end end @@ -82,18 +101,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [domain, active].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -101,7 +129,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -113,8 +141,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -123,7 +151,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -144,8 +172,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -167,7 +196,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -192,4 +225,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_child_domains.rb b/lib/sib-api-v3-sdk/models/get_child_domains.rb deleted file mode 100644 index 646b1d6..0000000 --- a/lib/sib-api-v3-sdk/models/get_child_domains.rb +++ /dev/null @@ -1,175 +0,0 @@ -=begin -#SendinBlue API - -#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 | - -OpenAPI spec version: 3.0.0 -Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 - -=end - -require 'date' - -module SibApiV3Sdk - class GetChildDomains - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.swagger_types - { - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end -end diff --git a/lib/sib-api-v3-sdk/models/get_child_info.rb b/lib/sib-api-v3-sdk/models/get_child_info.rb index 4db0918..456f2a6 100644 --- a/lib/sib-api-v3-sdk/models/get_child_info.rb +++ b/lib/sib-api-v3-sdk/models/get_child_info.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetChildInfo @@ -53,65 +54,91 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'first_name' => :'String', :'last_name' => :'String', :'company_name' => :'String', - :'credits' => :'GetChildInfoCredits', - :'statistics' => :'GetChildInfoStatistics', + :'credits' => :'GetChildInfoAllOfCredits', + :'statistics' => :'GetChildInfoAllOfStatistics', :'password' => :'String', :'ips' => :'Array', - :'api_keys' => :'GetChildInfoApiKeys' + :'api_keys' => :'GetChildInfoAllOfApiKeys' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'GetChildInfoAllOf', + :'GetClient' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetChildInfo` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetChildInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'firstName') - self.first_name = attributes[:'firstName'] + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] end - if attributes.has_key?(:'lastName') - self.last_name = attributes[:'lastName'] + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] end - if attributes.has_key?(:'companyName') - self.company_name = attributes[:'companyName'] + if attributes.key?(:'company_name') + self.company_name = attributes[:'company_name'] end - if attributes.has_key?(:'credits') + if attributes.key?(:'credits') self.credits = attributes[:'credits'] end - if attributes.has_key?(:'statistics') + if attributes.key?(:'statistics') self.statistics = attributes[:'statistics'] end - if attributes.has_key?(:'password') + if attributes.key?(:'password') self.password = attributes[:'password'] end - if attributes.has_key?(:'ips') + if attributes.key?(:'ips') if (value = attributes[:'ips']).is_a?(Array) self.ips = value end end - if attributes.has_key?(:'apiKeys') - self.api_keys = attributes[:'apiKeys'] + if attributes.key?(:'api_keys') + self.api_keys = attributes[:'api_keys'] end end @@ -176,18 +203,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, first_name, last_name, company_name, credits, statistics, password, ips, api_keys].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -195,7 +231,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -207,8 +243,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -217,7 +253,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -238,8 +274,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -261,7 +298,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -286,4 +327,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_child_info_all_of.rb b/lib/sib-api-v3-sdk/models/get_child_info_all_of.rb new file mode 100644 index 0000000..9915499 --- /dev/null +++ b/lib/sib-api-v3-sdk/models/get_child_info_all_of.rb @@ -0,0 +1,263 @@ +=begin +#SendinBlue API + +#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 | + +The version of the OpenAPI document: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 + +=end + +require 'date' +require 'time' + +module SibApiV3Sdk + class GetChildInfoAllOf + attr_accessor :credits + + attr_accessor :statistics + + # The encrypted password of child account + attr_accessor :password + + # IP(s) associated to a child account user + attr_accessor :ips + + attr_accessor :api_keys + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'credits' => :'credits', + :'statistics' => :'statistics', + :'password' => :'password', + :'ips' => :'ips', + :'api_keys' => :'apiKeys' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'credits' => :'GetChildInfoAllOfCredits', + :'statistics' => :'GetChildInfoAllOfStatistics', + :'password' => :'String', + :'ips' => :'Array', + :'api_keys' => :'GetChildInfoAllOfApiKeys' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetChildInfoAllOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetChildInfoAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'credits') + self.credits = attributes[:'credits'] + end + + if attributes.key?(:'statistics') + self.statistics = attributes[:'statistics'] + end + + if attributes.key?(:'password') + self.password = attributes[:'password'] + end + + if attributes.key?(:'ips') + if (value = attributes[:'ips']).is_a?(Array) + self.ips = value + end + end + + if attributes.key?(:'api_keys') + self.api_keys = attributes[:'api_keys'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @password.nil? + invalid_properties.push('invalid value for "password", password cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @password.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + credits == o.credits && + statistics == o.statistics && + password == o.password && + ips == o.ips && + api_keys == o.api_keys + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [credits, statistics, password, ips, api_keys].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/sib-api-v3-sdk/models/get_child_info_api_keys.rb b/lib/sib-api-v3-sdk/models/get_child_info_all_of_api_keys.rb similarity index 72% rename from lib/sib-api-v3-sdk/models/get_child_info_api_keys.rb rename to lib/sib-api-v3-sdk/models/get_child_info_all_of_api_keys.rb index bbfbe3a..c0c5b06 100644 --- a/lib/sib-api-v3-sdk/models/get_child_info_api_keys.rb +++ b/lib/sib-api-v3-sdk/models/get_child_info_all_of_api_keys.rb @@ -3,18 +3,19 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # API Keys associated to child account - class GetChildInfoApiKeys + class GetChildInfoAllOfApiKeys attr_accessor :v2 attr_accessor :v3 @@ -27,29 +28,47 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'v2' => :'Array', - :'v3' => :'Array' + :'v2' => :'Array', + :'v3' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetChildInfoAllOfApiKeys` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetChildInfoAllOfApiKeys`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'v2') + if attributes.key?(:'v2') if (value = attributes[:'v2']).is_a?(Array) self.v2 = value end end - if attributes.has_key?(:'v3') + if attributes.key?(:'v3') if (value = attributes[:'v3']).is_a?(Array) self.v3 = value end @@ -90,18 +109,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [v2, v3].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -109,7 +137,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -121,8 +149,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -131,7 +159,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -152,8 +180,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -175,7 +204,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -200,4 +233,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_child_info_api_keys_v2.rb b/lib/sib-api-v3-sdk/models/get_child_info_all_of_api_keys_v2.rb similarity index 73% rename from lib/sib-api-v3-sdk/models/get_child_info_api_keys_v2.rb rename to lib/sib-api-v3-sdk/models/get_child_info_all_of_api_keys_v2.rb index d4d40d2..71ac7d7 100644 --- a/lib/sib-api-v3-sdk/models/get_child_info_api_keys_v2.rb +++ b/lib/sib-api-v3-sdk/models/get_child_info_all_of_api_keys_v2.rb @@ -3,17 +3,18 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk - class GetChildInfoApiKeysV2 + class GetChildInfoAllOfApiKeysV2 # Name of the key for version 2 attr_accessor :name @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'String', :'key' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetChildInfoAllOfApiKeysV2` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetChildInfoAllOfApiKeysV2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'key') + if attributes.key?(:'key') self.key = attributes[:'key'] end end @@ -92,18 +111,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, key].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -111,7 +139,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -123,8 +151,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -133,7 +161,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,8 +182,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -177,7 +206,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -202,4 +235,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_child_info_api_keys_v3.rb b/lib/sib-api-v3-sdk/models/get_child_info_all_of_api_keys_v3.rb similarity index 73% rename from lib/sib-api-v3-sdk/models/get_child_info_api_keys_v3.rb rename to lib/sib-api-v3-sdk/models/get_child_info_all_of_api_keys_v3.rb index aed6b9a..0f484bd 100644 --- a/lib/sib-api-v3-sdk/models/get_child_info_api_keys_v3.rb +++ b/lib/sib-api-v3-sdk/models/get_child_info_all_of_api_keys_v3.rb @@ -3,17 +3,18 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk - class GetChildInfoApiKeysV3 + class GetChildInfoAllOfApiKeysV3 # Name of the key for version 3 attr_accessor :name @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'String', :'key' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetChildInfoAllOfApiKeysV3` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetChildInfoAllOfApiKeysV3`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'key') + if attributes.key?(:'key') self.key = attributes[:'key'] end end @@ -92,18 +111,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, key].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -111,7 +139,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -123,8 +151,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -133,7 +161,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,8 +182,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -177,7 +206,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -202,4 +235,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_child_info_credits.rb b/lib/sib-api-v3-sdk/models/get_child_info_all_of_credits.rb similarity index 71% rename from lib/sib-api-v3-sdk/models/get_child_info_credits.rb rename to lib/sib-api-v3-sdk/models/get_child_info_all_of_credits.rb index 0db427d..bc1da0e 100644 --- a/lib/sib-api-v3-sdk/models/get_child_info_credits.rb +++ b/lib/sib-api-v3-sdk/models/get_child_info_all_of_credits.rb @@ -3,18 +3,19 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Credits available for your child - class GetChildInfoCredits + class GetChildInfoAllOfCredits # Email credits available for your child attr_accessor :email_credits @@ -29,28 +30,46 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email_credits' => :'Integer', :'sms_credits' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetChildInfoAllOfCredits` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetChildInfoAllOfCredits`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'emailCredits') - self.email_credits = attributes[:'emailCredits'] + if attributes.key?(:'email_credits') + self.email_credits = attributes[:'email_credits'] end - if attributes.has_key?(:'smsCredits') - self.sms_credits = attributes[:'smsCredits'] + if attributes.key?(:'sms_credits') + self.sms_credits = attributes[:'sms_credits'] end end @@ -83,18 +102,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email_credits, sms_credits].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -102,7 +130,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -114,8 +142,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -124,7 +152,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -145,8 +173,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -168,7 +197,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -193,4 +226,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_child_info_statistics.rb b/lib/sib-api-v3-sdk/models/get_child_info_all_of_statistics.rb similarity index 71% rename from lib/sib-api-v3-sdk/models/get_child_info_statistics.rb rename to lib/sib-api-v3-sdk/models/get_child_info_all_of_statistics.rb index 6e15747..d892a7f 100644 --- a/lib/sib-api-v3-sdk/models/get_child_info_statistics.rb +++ b/lib/sib-api-v3-sdk/models/get_child_info_all_of_statistics.rb @@ -3,18 +3,19 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Statistics about your child account activity - class GetChildInfoStatistics + class GetChildInfoAllOfStatistics # Overall emails sent for the previous month attr_accessor :previous_month_total_sent @@ -33,8 +34,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'previous_month_total_sent' => :'Integer', :'current_month_total_sent' => :'Integer', @@ -42,24 +48,37 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetChildInfoAllOfStatistics` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetChildInfoAllOfStatistics`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'previousMonthTotalSent') - self.previous_month_total_sent = attributes[:'previousMonthTotalSent'] + if attributes.key?(:'previous_month_total_sent') + self.previous_month_total_sent = attributes[:'previous_month_total_sent'] end - if attributes.has_key?(:'currentMonthTotalSent') - self.current_month_total_sent = attributes[:'currentMonthTotalSent'] + if attributes.key?(:'current_month_total_sent') + self.current_month_total_sent = attributes[:'current_month_total_sent'] end - if attributes.has_key?(:'totalSent') - self.total_sent = attributes[:'totalSent'] + if attributes.key?(:'total_sent') + self.total_sent = attributes[:'total_sent'] end end @@ -93,18 +112,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [previous_month_total_sent, current_month_total_sent, total_sent].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -112,7 +140,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -124,8 +152,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -134,7 +162,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -155,8 +183,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -178,7 +207,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -203,4 +236,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_children_list.rb b/lib/sib-api-v3-sdk/models/get_children_list.rb index 9fba626..bcc3cb0 100644 --- a/lib/sib-api-v3-sdk/models/get_children_list.rb +++ b/lib/sib-api-v3-sdk/models/get_children_list.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetChildrenList @@ -28,29 +29,47 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'children' => :'Array', + :'children' => :'Array', :'count' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetChildrenList` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetChildrenList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'children') + if attributes.key?(:'children') if (value = attributes[:'children']).is_a?(Array) self.children = value end end - if attributes.has_key?(:'count') + if attributes.key?(:'count') self.count = attributes[:'count'] end end @@ -84,18 +103,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [children, count].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -103,7 +131,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -115,8 +143,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -125,7 +153,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -146,8 +174,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -169,7 +198,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -194,4 +227,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_client.rb b/lib/sib-api-v3-sdk/models/get_client.rb index 77538a1..76b1c06 100644 --- a/lib/sib-api-v3-sdk/models/get_client.rb +++ b/lib/sib-api-v3-sdk/models/get_client.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetClient @@ -36,8 +37,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'first_name' => :'String', @@ -46,28 +52,41 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetClient` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetClient`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'firstName') - self.first_name = attributes[:'firstName'] + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] end - if attributes.has_key?(:'lastName') - self.last_name = attributes[:'lastName'] + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] end - if attributes.has_key?(:'companyName') - self.company_name = attributes[:'companyName'] + if attributes.key?(:'company_name') + self.company_name = attributes[:'company_name'] end end @@ -122,18 +141,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, first_name, last_name, company_name].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -141,7 +169,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -153,8 +181,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -163,7 +191,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -184,8 +212,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -207,7 +236,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -232,4 +265,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_contact_campaign_stats.rb b/lib/sib-api-v3-sdk/models/get_contact_campaign_stats.rb index 1c57b27..6beaa22 100644 --- a/lib/sib-api-v3-sdk/models/get_contact_campaign_stats.rb +++ b/lib/sib-api-v3-sdk/models/get_contact_campaign_stats.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Campaign Statistics for the contact @@ -45,13 +46,18 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'messages_sent' => :'Array', - :'hard_bounces' => :'Array', - :'soft_bounces' => :'Array', - :'complaints' => :'Array', + :'messages_sent' => :'Array', + :'hard_bounces' => :'Array', + :'soft_bounces' => :'Array', + :'complaints' => :'Array', :'unsubscriptions' => :'GetContactCampaignStatsUnsubscriptions', :'opened' => :'Array', :'clicked' => :'Array', @@ -59,56 +65,69 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetContactCampaignStats` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetContactCampaignStats`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'messagesSent') - if (value = attributes[:'messagesSent']).is_a?(Array) + if attributes.key?(:'messages_sent') + if (value = attributes[:'messages_sent']).is_a?(Array) self.messages_sent = value end end - if attributes.has_key?(:'hardBounces') - if (value = attributes[:'hardBounces']).is_a?(Array) + if attributes.key?(:'hard_bounces') + if (value = attributes[:'hard_bounces']).is_a?(Array) self.hard_bounces = value end end - if attributes.has_key?(:'softBounces') - if (value = attributes[:'softBounces']).is_a?(Array) + if attributes.key?(:'soft_bounces') + if (value = attributes[:'soft_bounces']).is_a?(Array) self.soft_bounces = value end end - if attributes.has_key?(:'complaints') + if attributes.key?(:'complaints') if (value = attributes[:'complaints']).is_a?(Array) self.complaints = value end end - if attributes.has_key?(:'unsubscriptions') + if attributes.key?(:'unsubscriptions') self.unsubscriptions = attributes[:'unsubscriptions'] end - if attributes.has_key?(:'opened') + if attributes.key?(:'opened') if (value = attributes[:'opened']).is_a?(Array) self.opened = value end end - if attributes.has_key?(:'clicked') + if attributes.key?(:'clicked') if (value = attributes[:'clicked']).is_a?(Array) self.clicked = value end end - if attributes.has_key?(:'transacAttributes') - if (value = attributes[:'transacAttributes']).is_a?(Array) + if attributes.key?(:'transac_attributes') + if (value = attributes[:'transac_attributes']).is_a?(Array) self.transac_attributes = value end end @@ -149,18 +168,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [messages_sent, hard_bounces, soft_bounces, complaints, unsubscriptions, opened, clicked, transac_attributes].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -168,7 +196,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -180,8 +208,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -190,7 +218,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -211,8 +239,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -234,7 +263,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -259,4 +292,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_contact_campaign_stats_clicked.rb b/lib/sib-api-v3-sdk/models/get_contact_campaign_stats_clicked.rb index d7f1fd9..7d49915 100644 --- a/lib/sib-api-v3-sdk/models/get_contact_campaign_stats_clicked.rb +++ b/lib/sib-api-v3-sdk/models/get_contact_campaign_stats_clicked.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetContactCampaignStatsClicked @@ -27,27 +28,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'campaign_id' => :'Integer', - :'links' => :'Array' + :'links' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetContactCampaignStatsClicked` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetContactCampaignStatsClicked`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'campaignId') - self.campaign_id = attributes[:'campaignId'] + if attributes.key?(:'campaign_id') + self.campaign_id = attributes[:'campaign_id'] end - if attributes.has_key?(:'links') + if attributes.key?(:'links') if (value = attributes[:'links']).is_a?(Array) self.links = value end @@ -93,18 +112,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [campaign_id, links].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -112,7 +140,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -124,8 +152,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -134,7 +162,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -155,8 +183,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -178,7 +207,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -203,4 +236,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_contact_campaign_stats_opened.rb b/lib/sib-api-v3-sdk/models/get_contact_campaign_stats_opened.rb index b2da9e2..e7db1c2 100644 --- a/lib/sib-api-v3-sdk/models/get_contact_campaign_stats_opened.rb +++ b/lib/sib-api-v3-sdk/models/get_contact_campaign_stats_opened.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetContactCampaignStatsOpened @@ -36,8 +37,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'campaign_id' => :'Integer', :'count' => :'Integer', @@ -46,27 +52,40 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetContactCampaignStatsOpened` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetContactCampaignStatsOpened`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'campaignId') - self.campaign_id = attributes[:'campaignId'] + if attributes.key?(:'campaign_id') + self.campaign_id = attributes[:'campaign_id'] end - if attributes.has_key?(:'count') + if attributes.key?(:'count') self.count = attributes[:'count'] end - if attributes.has_key?(:'eventTime') - self.event_time = attributes[:'eventTime'] + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] end - if attributes.has_key?(:'ip') + if attributes.key?(:'ip') self.ip = attributes[:'ip'] end end @@ -122,18 +141,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [campaign_id, count, event_time, ip].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -141,7 +169,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -153,8 +181,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -163,7 +191,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -184,8 +212,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -207,7 +236,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -232,4 +265,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_contact_campaign_stats_transac_attributes.rb b/lib/sib-api-v3-sdk/models/get_contact_campaign_stats_transac_attributes.rb index 2a51c4e..221ffa3 100644 --- a/lib/sib-api-v3-sdk/models/get_contact_campaign_stats_transac_attributes.rb +++ b/lib/sib-api-v3-sdk/models/get_contact_campaign_stats_transac_attributes.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetContactCampaignStatsTransacAttributes @@ -32,8 +33,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'order_date' => :'Date', :'order_price' => :'Float', @@ -41,24 +47,37 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetContactCampaignStatsTransacAttributes` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetContactCampaignStatsTransacAttributes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'orderDate') - self.order_date = attributes[:'orderDate'] + if attributes.key?(:'order_date') + self.order_date = attributes[:'order_date'] end - if attributes.has_key?(:'orderPrice') - self.order_price = attributes[:'orderPrice'] + if attributes.key?(:'order_price') + self.order_price = attributes[:'order_price'] end - if attributes.has_key?(:'orderId') - self.order_id = attributes[:'orderId'] + if attributes.key?(:'order_id') + self.order_id = attributes[:'order_id'] end end @@ -107,18 +126,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [order_date, order_price, order_id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -126,7 +154,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -138,8 +166,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -148,7 +176,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -169,8 +197,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -192,7 +221,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -217,4 +250,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_contact_campaign_stats_unsubscriptions.rb b/lib/sib-api-v3-sdk/models/get_contact_campaign_stats_unsubscriptions.rb index 616b219..b516f89 100644 --- a/lib/sib-api-v3-sdk/models/get_contact_campaign_stats_unsubscriptions.rb +++ b/lib/sib-api-v3-sdk/models/get_contact_campaign_stats_unsubscriptions.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetContactCampaignStatsUnsubscriptions @@ -28,30 +29,48 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'user_unsubscription' => :'Array', - :'admin_unsubscription' => :'Array' + :'user_unsubscription' => :'Array', + :'admin_unsubscription' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetContactCampaignStatsUnsubscriptions` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetContactCampaignStatsUnsubscriptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'userUnsubscription') - if (value = attributes[:'userUnsubscription']).is_a?(Array) + if attributes.key?(:'user_unsubscription') + if (value = attributes[:'user_unsubscription']).is_a?(Array) self.user_unsubscription = value end end - if attributes.has_key?(:'adminUnsubscription') - if (value = attributes[:'adminUnsubscription']).is_a?(Array) + if attributes.key?(:'admin_unsubscription') + if (value = attributes[:'admin_unsubscription']).is_a?(Array) self.admin_unsubscription = value end end @@ -96,18 +115,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [user_unsubscription, admin_unsubscription].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -115,7 +143,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -127,8 +155,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -137,7 +165,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -158,8 +186,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -181,7 +210,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -206,4 +239,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_contact_details.rb b/lib/sib-api-v3-sdk/models/get_contact_details.rb index 86e6f86..c0aa4da 100644 --- a/lib/sib-api-v3-sdk/models/get_contact_details.rb +++ b/lib/sib-api-v3-sdk/models/get_contact_details.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetContactDetails @@ -54,13 +55,18 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'id' => :'Integer', - :'email_blacklisted' => :'BOOLEAN', - :'sms_blacklisted' => :'BOOLEAN', + :'email_blacklisted' => :'Boolean', + :'sms_blacklisted' => :'Boolean', :'created_at' => :'String', :'modified_at' => :'String', :'list_ids' => :'Array', @@ -69,51 +75,64 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetContactDetails` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetContactDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'emailBlacklisted') - self.email_blacklisted = attributes[:'emailBlacklisted'] + if attributes.key?(:'email_blacklisted') + self.email_blacklisted = attributes[:'email_blacklisted'] end - if attributes.has_key?(:'smsBlacklisted') - self.sms_blacklisted = attributes[:'smsBlacklisted'] + if attributes.key?(:'sms_blacklisted') + self.sms_blacklisted = attributes[:'sms_blacklisted'] end - if attributes.has_key?(:'createdAt') - self.created_at = attributes[:'createdAt'] + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] end - if attributes.has_key?(:'modifiedAt') - self.modified_at = attributes[:'modifiedAt'] + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] end - if attributes.has_key?(:'listIds') - if (value = attributes[:'listIds']).is_a?(Array) + if attributes.key?(:'list_ids') + if (value = attributes[:'list_ids']).is_a?(Array) self.list_ids = value end end - if attributes.has_key?(:'listUnsubscribed') - if (value = attributes[:'listUnsubscribed']).is_a?(Array) + if attributes.key?(:'list_unsubscribed') + if (value = attributes[:'list_unsubscribed']).is_a?(Array) self.list_unsubscribed = value end end - if attributes.has_key?(:'attributes') + if attributes.key?(:'attributes') self.attributes = attributes[:'attributes'] end end @@ -194,18 +213,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, id, email_blacklisted, sms_blacklisted, created_at, modified_at, list_ids, list_unsubscribed, attributes].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -213,7 +241,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -225,8 +253,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -235,7 +263,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -256,8 +284,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -279,7 +308,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -304,4 +337,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_contacts.rb b/lib/sib-api-v3-sdk/models/get_contacts.rb index e147d0a..cb8248e 100644 --- a/lib/sib-api-v3-sdk/models/get_contacts.rb +++ b/lib/sib-api-v3-sdk/models/get_contacts.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetContacts @@ -27,29 +28,47 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'contacts' => :'Array', + :'contacts' => :'Array', :'count' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetContacts` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetContacts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'contacts') + if attributes.key?(:'contacts') if (value = attributes[:'contacts']).is_a?(Array) self.contacts = value end end - if attributes.has_key?(:'count') + if attributes.key?(:'count') self.count = attributes[:'count'] end end @@ -93,18 +112,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [contacts, count].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -112,7 +140,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -124,8 +152,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -134,7 +162,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -155,8 +183,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -178,7 +207,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -203,4 +236,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_device_browser_stats.rb b/lib/sib-api-v3-sdk/models/get_device_browser_stats.rb index 0442a9f..88bb632 100644 --- a/lib/sib-api-v3-sdk/models/get_device_browser_stats.rb +++ b/lib/sib-api-v3-sdk/models/get_device_browser_stats.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetDeviceBrowserStats @@ -36,8 +37,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'clickers' => :'Integer', :'unique_clicks' => :'Integer', @@ -46,28 +52,41 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetDeviceBrowserStats` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetDeviceBrowserStats`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'clickers') + if attributes.key?(:'clickers') self.clickers = attributes[:'clickers'] end - if attributes.has_key?(:'uniqueClicks') - self.unique_clicks = attributes[:'uniqueClicks'] + if attributes.key?(:'unique_clicks') + self.unique_clicks = attributes[:'unique_clicks'] end - if attributes.has_key?(:'viewed') + if attributes.key?(:'viewed') self.viewed = attributes[:'viewed'] end - if attributes.has_key?(:'uniqueViews') - self.unique_views = attributes[:'uniqueViews'] + if attributes.key?(:'unique_views') + self.unique_views = attributes[:'unique_views'] end end @@ -122,18 +141,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [clickers, unique_clicks, viewed, unique_views].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -141,7 +169,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -153,8 +181,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -163,7 +191,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -184,8 +212,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -207,7 +236,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -232,4 +265,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_email_campaign.rb b/lib/sib-api-v3-sdk/models/get_email_campaign.rb index 250902c..b0e795e 100644 --- a/lib/sib-api-v3-sdk/models/get_email_campaign.rb +++ b/lib/sib-api-v3-sdk/models/get_email_campaign.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetEmailCampaign @@ -163,8 +164,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', :'name' => :'String', @@ -172,17 +178,17 @@ def self.swagger_types :'type' => :'String', :'status' => :'String', :'scheduled_at' => :'String', - :'ab_testing' => :'BOOLEAN', + :'ab_testing' => :'Boolean', :'subject_a' => :'String', :'subject_b' => :'String', :'split_rule' => :'Integer', :'winner_criteria' => :'String', :'winner_delay' => :'Integer', - :'send_at_best_time' => :'BOOLEAN', - :'test_sent' => :'BOOLEAN', + :'send_at_best_time' => :'Boolean', + :'test_sent' => :'Boolean', :'header' => :'String', :'footer' => :'String', - :'sender' => :'GetExtendedCampaignOverviewSender', + :'sender' => :'GetExtendedCampaignOverviewAllOfSender', :'reply_to' => :'String', :'to_field' => :'String', :'html_content' => :'String', @@ -190,145 +196,166 @@ def self.swagger_types :'tag' => :'String', :'created_at' => :'String', :'modified_at' => :'String', - :'inline_image_activation' => :'BOOLEAN', - :'mirror_active' => :'BOOLEAN', - :'recurring' => :'BOOLEAN', + :'inline_image_activation' => :'Boolean', + :'mirror_active' => :'Boolean', + :'recurring' => :'Boolean', :'sent_date' => :'String', :'return_bounce' => :'Integer', - :'recipients' => :'GetSmsCampaignRecipients', - :'statistics' => :'GetSmsCampaignRecipients' + :'recipients' => :'GetCampaignRecipients', + :'statistics' => :'GetExtendedCampaignStats' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'GetEmailCampaignAllOf', + :'GetExtendedCampaignOverview' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetEmailCampaign` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetEmailCampaign`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'subject') + if attributes.key?(:'subject') self.subject = attributes[:'subject'] end - if attributes.has_key?(:'type') + if attributes.key?(:'type') self.type = attributes[:'type'] end - if attributes.has_key?(:'status') + if attributes.key?(:'status') self.status = attributes[:'status'] end - if attributes.has_key?(:'scheduledAt') - self.scheduled_at = attributes[:'scheduledAt'] + if attributes.key?(:'scheduled_at') + self.scheduled_at = attributes[:'scheduled_at'] end - if attributes.has_key?(:'abTesting') - self.ab_testing = attributes[:'abTesting'] + if attributes.key?(:'ab_testing') + self.ab_testing = attributes[:'ab_testing'] end - if attributes.has_key?(:'subjectA') - self.subject_a = attributes[:'subjectA'] + if attributes.key?(:'subject_a') + self.subject_a = attributes[:'subject_a'] end - if attributes.has_key?(:'subjectB') - self.subject_b = attributes[:'subjectB'] + if attributes.key?(:'subject_b') + self.subject_b = attributes[:'subject_b'] end - if attributes.has_key?(:'splitRule') - self.split_rule = attributes[:'splitRule'] + if attributes.key?(:'split_rule') + self.split_rule = attributes[:'split_rule'] end - if attributes.has_key?(:'winnerCriteria') - self.winner_criteria = attributes[:'winnerCriteria'] + if attributes.key?(:'winner_criteria') + self.winner_criteria = attributes[:'winner_criteria'] end - if attributes.has_key?(:'winnerDelay') - self.winner_delay = attributes[:'winnerDelay'] + if attributes.key?(:'winner_delay') + self.winner_delay = attributes[:'winner_delay'] end - if attributes.has_key?(:'sendAtBestTime') - self.send_at_best_time = attributes[:'sendAtBestTime'] + if attributes.key?(:'send_at_best_time') + self.send_at_best_time = attributes[:'send_at_best_time'] end - if attributes.has_key?(:'testSent') - self.test_sent = attributes[:'testSent'] + if attributes.key?(:'test_sent') + self.test_sent = attributes[:'test_sent'] end - if attributes.has_key?(:'header') + if attributes.key?(:'header') self.header = attributes[:'header'] end - if attributes.has_key?(:'footer') + if attributes.key?(:'footer') self.footer = attributes[:'footer'] end - if attributes.has_key?(:'sender') + if attributes.key?(:'sender') self.sender = attributes[:'sender'] end - if attributes.has_key?(:'replyTo') - self.reply_to = attributes[:'replyTo'] + if attributes.key?(:'reply_to') + self.reply_to = attributes[:'reply_to'] end - if attributes.has_key?(:'toField') - self.to_field = attributes[:'toField'] + if attributes.key?(:'to_field') + self.to_field = attributes[:'to_field'] end - if attributes.has_key?(:'htmlContent') - self.html_content = attributes[:'htmlContent'] + if attributes.key?(:'html_content') + self.html_content = attributes[:'html_content'] end - if attributes.has_key?(:'shareLink') - self.share_link = attributes[:'shareLink'] + if attributes.key?(:'share_link') + self.share_link = attributes[:'share_link'] end - if attributes.has_key?(:'tag') + if attributes.key?(:'tag') self.tag = attributes[:'tag'] end - if attributes.has_key?(:'createdAt') - self.created_at = attributes[:'createdAt'] + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] end - if attributes.has_key?(:'modifiedAt') - self.modified_at = attributes[:'modifiedAt'] + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] end - if attributes.has_key?(:'inlineImageActivation') - self.inline_image_activation = attributes[:'inlineImageActivation'] + if attributes.key?(:'inline_image_activation') + self.inline_image_activation = attributes[:'inline_image_activation'] end - if attributes.has_key?(:'mirrorActive') - self.mirror_active = attributes[:'mirrorActive'] + if attributes.key?(:'mirror_active') + self.mirror_active = attributes[:'mirror_active'] end - if attributes.has_key?(:'recurring') + if attributes.key?(:'recurring') self.recurring = attributes[:'recurring'] end - if attributes.has_key?(:'sentDate') - self.sent_date = attributes[:'sentDate'] + if attributes.key?(:'sent_date') + self.sent_date = attributes[:'sent_date'] end - if attributes.has_key?(:'returnBounce') - self.return_bounce = attributes[:'returnBounce'] + if attributes.key?(:'return_bounce') + self.return_bounce = attributes[:'return_bounce'] end - if attributes.has_key?(:'recipients') + if attributes.key?(:'recipients') self.recipients = attributes[:'recipients'] end - if attributes.has_key?(:'statistics') + if attributes.key?(:'statistics') self.statistics = attributes[:'statistics'] end end @@ -402,10 +429,10 @@ def valid? return false if @id.nil? return false if @name.nil? return false if @type.nil? - type_validator = EnumAttributeValidator.new('String', ['classic', 'trigger']) + type_validator = EnumAttributeValidator.new('String', ["classic", "trigger"]) return false unless type_validator.valid?(@type) return false if @status.nil? - status_validator = EnumAttributeValidator.new('String', ['draft', 'sent', 'archive', 'queued', 'suspended', 'in_process']) + status_validator = EnumAttributeValidator.new('String', ["draft", "sent", "archive", "queued", "suspended", "in_process"]) return false unless status_validator.valid?(@status) return false if @test_sent.nil? return false if @header.nil? @@ -423,9 +450,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ['classic', 'trigger']) + validator = EnumAttributeValidator.new('String', ["classic", "trigger"]) unless validator.valid?(type) - fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @type = type end @@ -433,9 +460,9 @@ def type=(type) # Custom attribute writer method checking allowed values (enum). # @param [Object] status Object to be assigned def status=(status) - validator = EnumAttributeValidator.new('String', ['draft', 'sent', 'archive', 'queued', 'suspended', 'in_process']) + validator = EnumAttributeValidator.new('String', ["draft", "sent", "archive", "queued", "suspended", "in_process"]) unless validator.valid?(status) - fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." end @status = status end @@ -485,18 +512,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id, name, subject, type, status, scheduled_at, ab_testing, subject_a, subject_b, split_rule, winner_criteria, winner_delay, send_at_best_time, test_sent, header, footer, sender, reply_to, to_field, html_content, share_link, tag, created_at, modified_at, inline_image_activation, mirror_active, recurring, sent_date, return_bounce, recipients, statistics].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -504,7 +540,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -516,8 +552,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -526,7 +562,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -547,8 +583,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -570,7 +607,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -595,4 +636,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_email_campaign_all_of.rb b/lib/sib-api-v3-sdk/models/get_email_campaign_all_of.rb new file mode 100644 index 0000000..2bbe3b9 --- /dev/null +++ b/lib/sib-api-v3-sdk/models/get_email_campaign_all_of.rb @@ -0,0 +1,237 @@ +=begin +#SendinBlue API + +#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 | + +The version of the OpenAPI document: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 + +=end + +require 'date' +require 'time' + +module SibApiV3Sdk + class GetEmailCampaignAllOf + attr_accessor :recipients + + attr_accessor :statistics + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'recipients' => :'recipients', + :'statistics' => :'statistics' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'recipients' => :'GetCampaignRecipients', + :'statistics' => :'GetExtendedCampaignStats' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetEmailCampaignAllOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetEmailCampaignAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'recipients') + self.recipients = attributes[:'recipients'] + end + + if attributes.key?(:'statistics') + self.statistics = attributes[:'statistics'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @recipients.nil? + invalid_properties.push('invalid value for "recipients", recipients cannot be nil.') + end + + if @statistics.nil? + invalid_properties.push('invalid value for "statistics", statistics cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @recipients.nil? + return false if @statistics.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + recipients == o.recipients && + statistics == o.statistics + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [recipients, statistics].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/sib-api-v3-sdk/models/get_email_campaigns.rb b/lib/sib-api-v3-sdk/models/get_email_campaigns.rb index c9b181a..3d8807d 100644 --- a/lib/sib-api-v3-sdk/models/get_email_campaigns.rb +++ b/lib/sib-api-v3-sdk/models/get_email_campaigns.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetEmailCampaigns @@ -27,29 +28,47 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'campaigns' => :'Array', + :'campaigns' => :'Array', :'count' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetEmailCampaigns` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetEmailCampaigns`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'campaigns') + if attributes.key?(:'campaigns') if (value = attributes[:'campaigns']).is_a?(Array) self.campaigns = value end end - if attributes.has_key?(:'count') + if attributes.key?(:'count') self.count = attributes[:'count'] end end @@ -83,18 +102,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [campaigns, count].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -102,7 +130,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -114,8 +142,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -124,7 +152,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -145,8 +173,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -168,7 +197,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -193,4 +226,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_email_event_report.rb b/lib/sib-api-v3-sdk/models/get_email_event_report.rb index ff14249..17b7eb1 100644 --- a/lib/sib-api-v3-sdk/models/get_email_event_report.rb +++ b/lib/sib-api-v3-sdk/models/get_email_event_report.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetEmailEventReport @@ -23,22 +24,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'events' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetEmailEventReport` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetEmailEventReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'events') + if attributes.key?(:'events') if (value = attributes[:'events']).is_a?(Array) self.events = value end @@ -73,18 +92,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [events].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -92,7 +120,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -104,8 +132,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -114,7 +142,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -135,8 +163,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -158,7 +187,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -183,4 +216,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_email_event_report_events.rb b/lib/sib-api-v3-sdk/models/get_email_event_report_events.rb index de13fb2..4f83e4e 100644 --- a/lib/sib-api-v3-sdk/models/get_email_event_report_events.rb +++ b/lib/sib-api-v3-sdk/models/get_email_event_report_events.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetEmailEventReportEvents @@ -86,8 +87,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'date' => :'String', @@ -103,56 +109,69 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetEmailEventReportEvents` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetEmailEventReportEvents`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'date') + if attributes.key?(:'date') self.date = attributes[:'date'] end - if attributes.has_key?(:'subject') + if attributes.key?(:'subject') self.subject = attributes[:'subject'] end - if attributes.has_key?(:'messageId') - self.message_id = attributes[:'messageId'] + if attributes.key?(:'message_id') + self.message_id = attributes[:'message_id'] end - if attributes.has_key?(:'event') + if attributes.key?(:'event') self.event = attributes[:'event'] end - if attributes.has_key?(:'reason') + if attributes.key?(:'reason') self.reason = attributes[:'reason'] end - if attributes.has_key?(:'tag') + if attributes.key?(:'tag') self.tag = attributes[:'tag'] end - if attributes.has_key?(:'ip') + if attributes.key?(:'ip') self.ip = attributes[:'ip'] end - if attributes.has_key?(:'link') + if attributes.key?(:'link') self.link = attributes[:'link'] end - if attributes.has_key?(:'from') + if attributes.key?(:'from') self.from = attributes[:'from'] end - if attributes.has_key?(:'templateId') - self.template_id = attributes[:'templateId'] + if attributes.key?(:'template_id') + self.template_id = attributes[:'template_id'] end end @@ -186,7 +205,7 @@ def valid? return false if @date.nil? return false if @message_id.nil? return false if @event.nil? - event_validator = EnumAttributeValidator.new('String', ['bounces', 'hardBounces', 'softBounces', 'delivered', 'spam', 'requests', 'opened', 'clicks', 'invalid', 'deferred', 'blocked', 'unsubscribed', 'error']) + event_validator = EnumAttributeValidator.new('String', ["bounces", "hardBounces", "softBounces", "delivered", "spam", "requests", "opened", "clicks", "invalid", "deferred", "blocked", "unsubscribed", "error"]) return false unless event_validator.valid?(@event) true end @@ -194,9 +213,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] event Object to be assigned def event=(event) - validator = EnumAttributeValidator.new('String', ['bounces', 'hardBounces', 'softBounces', 'delivered', 'spam', 'requests', 'opened', 'clicks', 'invalid', 'deferred', 'blocked', 'unsubscribed', 'error']) + validator = EnumAttributeValidator.new('String', ["bounces", "hardBounces", "softBounces", "delivered", "spam", "requests", "opened", "clicks", "invalid", "deferred", "blocked", "unsubscribed", "error"]) unless validator.valid?(event) - fail ArgumentError, 'invalid value for "event", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"event\", must be one of #{validator.allowable_values}." end @event = event end @@ -226,18 +245,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, date, subject, message_id, event, reason, tag, ip, link, from, template_id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -245,7 +273,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -257,8 +285,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -267,7 +295,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -288,8 +316,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -311,7 +340,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -336,4 +369,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_extended_campaign_overview.rb b/lib/sib-api-v3-sdk/models/get_extended_campaign_overview.rb index 39eb655..86eb0e5 100644 --- a/lib/sib-api-v3-sdk/models/get_extended_campaign_overview.rb +++ b/lib/sib-api-v3-sdk/models/get_extended_campaign_overview.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetExtendedCampaignOverview @@ -157,8 +158,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', :'name' => :'String', @@ -166,17 +172,17 @@ def self.swagger_types :'type' => :'String', :'status' => :'String', :'scheduled_at' => :'String', - :'ab_testing' => :'BOOLEAN', + :'ab_testing' => :'Boolean', :'subject_a' => :'String', :'subject_b' => :'String', :'split_rule' => :'Integer', :'winner_criteria' => :'String', :'winner_delay' => :'Integer', - :'send_at_best_time' => :'BOOLEAN', - :'test_sent' => :'BOOLEAN', + :'send_at_best_time' => :'Boolean', + :'test_sent' => :'Boolean', :'header' => :'String', :'footer' => :'String', - :'sender' => :'GetExtendedCampaignOverviewSender', + :'sender' => :'GetExtendedCampaignOverviewAllOfSender', :'reply_to' => :'String', :'to_field' => :'String', :'html_content' => :'String', @@ -184,136 +190,157 @@ def self.swagger_types :'tag' => :'String', :'created_at' => :'String', :'modified_at' => :'String', - :'inline_image_activation' => :'BOOLEAN', - :'mirror_active' => :'BOOLEAN', - :'recurring' => :'BOOLEAN', + :'inline_image_activation' => :'Boolean', + :'mirror_active' => :'Boolean', + :'recurring' => :'Boolean', :'sent_date' => :'String', :'return_bounce' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'GetCampaignOverview', + :'GetExtendedCampaignOverviewAllOf' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedCampaignOverview` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedCampaignOverview`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'subject') + if attributes.key?(:'subject') self.subject = attributes[:'subject'] end - if attributes.has_key?(:'type') + if attributes.key?(:'type') self.type = attributes[:'type'] end - if attributes.has_key?(:'status') + if attributes.key?(:'status') self.status = attributes[:'status'] end - if attributes.has_key?(:'scheduledAt') - self.scheduled_at = attributes[:'scheduledAt'] + if attributes.key?(:'scheduled_at') + self.scheduled_at = attributes[:'scheduled_at'] end - if attributes.has_key?(:'abTesting') - self.ab_testing = attributes[:'abTesting'] + if attributes.key?(:'ab_testing') + self.ab_testing = attributes[:'ab_testing'] end - if attributes.has_key?(:'subjectA') - self.subject_a = attributes[:'subjectA'] + if attributes.key?(:'subject_a') + self.subject_a = attributes[:'subject_a'] end - if attributes.has_key?(:'subjectB') - self.subject_b = attributes[:'subjectB'] + if attributes.key?(:'subject_b') + self.subject_b = attributes[:'subject_b'] end - if attributes.has_key?(:'splitRule') - self.split_rule = attributes[:'splitRule'] + if attributes.key?(:'split_rule') + self.split_rule = attributes[:'split_rule'] end - if attributes.has_key?(:'winnerCriteria') - self.winner_criteria = attributes[:'winnerCriteria'] + if attributes.key?(:'winner_criteria') + self.winner_criteria = attributes[:'winner_criteria'] end - if attributes.has_key?(:'winnerDelay') - self.winner_delay = attributes[:'winnerDelay'] + if attributes.key?(:'winner_delay') + self.winner_delay = attributes[:'winner_delay'] end - if attributes.has_key?(:'sendAtBestTime') - self.send_at_best_time = attributes[:'sendAtBestTime'] + if attributes.key?(:'send_at_best_time') + self.send_at_best_time = attributes[:'send_at_best_time'] end - if attributes.has_key?(:'testSent') - self.test_sent = attributes[:'testSent'] + if attributes.key?(:'test_sent') + self.test_sent = attributes[:'test_sent'] end - if attributes.has_key?(:'header') + if attributes.key?(:'header') self.header = attributes[:'header'] end - if attributes.has_key?(:'footer') + if attributes.key?(:'footer') self.footer = attributes[:'footer'] end - if attributes.has_key?(:'sender') + if attributes.key?(:'sender') self.sender = attributes[:'sender'] end - if attributes.has_key?(:'replyTo') - self.reply_to = attributes[:'replyTo'] + if attributes.key?(:'reply_to') + self.reply_to = attributes[:'reply_to'] end - if attributes.has_key?(:'toField') - self.to_field = attributes[:'toField'] + if attributes.key?(:'to_field') + self.to_field = attributes[:'to_field'] end - if attributes.has_key?(:'htmlContent') - self.html_content = attributes[:'htmlContent'] + if attributes.key?(:'html_content') + self.html_content = attributes[:'html_content'] end - if attributes.has_key?(:'shareLink') - self.share_link = attributes[:'shareLink'] + if attributes.key?(:'share_link') + self.share_link = attributes[:'share_link'] end - if attributes.has_key?(:'tag') + if attributes.key?(:'tag') self.tag = attributes[:'tag'] end - if attributes.has_key?(:'createdAt') - self.created_at = attributes[:'createdAt'] + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] end - if attributes.has_key?(:'modifiedAt') - self.modified_at = attributes[:'modifiedAt'] + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] end - if attributes.has_key?(:'inlineImageActivation') - self.inline_image_activation = attributes[:'inlineImageActivation'] + if attributes.key?(:'inline_image_activation') + self.inline_image_activation = attributes[:'inline_image_activation'] end - if attributes.has_key?(:'mirrorActive') - self.mirror_active = attributes[:'mirrorActive'] + if attributes.key?(:'mirror_active') + self.mirror_active = attributes[:'mirror_active'] end - if attributes.has_key?(:'recurring') + if attributes.key?(:'recurring') self.recurring = attributes[:'recurring'] end - if attributes.has_key?(:'sentDate') - self.sent_date = attributes[:'sentDate'] + if attributes.key?(:'sent_date') + self.sent_date = attributes[:'sent_date'] end - if attributes.has_key?(:'returnBounce') - self.return_bounce = attributes[:'returnBounce'] + if attributes.key?(:'return_bounce') + self.return_bounce = attributes[:'return_bounce'] end end @@ -378,10 +405,10 @@ def valid? return false if @id.nil? return false if @name.nil? return false if @type.nil? - type_validator = EnumAttributeValidator.new('String', ['classic', 'trigger']) + type_validator = EnumAttributeValidator.new('String', ["classic", "trigger"]) return false unless type_validator.valid?(@type) return false if @status.nil? - status_validator = EnumAttributeValidator.new('String', ['draft', 'sent', 'archive', 'queued', 'suspended', 'in_process']) + status_validator = EnumAttributeValidator.new('String', ["draft", "sent", "archive", "queued", "suspended", "in_process"]) return false unless status_validator.valid?(@status) return false if @test_sent.nil? return false if @header.nil? @@ -397,9 +424,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ['classic', 'trigger']) + validator = EnumAttributeValidator.new('String', ["classic", "trigger"]) unless validator.valid?(type) - fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @type = type end @@ -407,9 +434,9 @@ def type=(type) # Custom attribute writer method checking allowed values (enum). # @param [Object] status Object to be assigned def status=(status) - validator = EnumAttributeValidator.new('String', ['draft', 'sent', 'archive', 'queued', 'suspended', 'in_process']) + validator = EnumAttributeValidator.new('String', ["draft", "sent", "archive", "queued", "suspended", "in_process"]) unless validator.valid?(status) - fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." end @status = status end @@ -457,18 +484,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id, name, subject, type, status, scheduled_at, ab_testing, subject_a, subject_b, split_rule, winner_criteria, winner_delay, send_at_best_time, test_sent, header, footer, sender, reply_to, to_field, html_content, share_link, tag, created_at, modified_at, inline_image_activation, mirror_active, recurring, sent_date, return_bounce].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -476,7 +512,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -488,8 +524,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -498,7 +534,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -519,8 +555,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -542,7 +579,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -567,4 +608,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_extended_campaign_overview_all_of.rb b/lib/sib-api-v3-sdk/models/get_extended_campaign_overview_all_of.rb new file mode 100644 index 0000000..f28ffd6 --- /dev/null +++ b/lib/sib-api-v3-sdk/models/get_extended_campaign_overview_all_of.rb @@ -0,0 +1,408 @@ +=begin +#SendinBlue API + +#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 | + +The version of the OpenAPI document: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 + +=end + +require 'date' +require 'time' + +module SibApiV3Sdk + class GetExtendedCampaignOverviewAllOf + # Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent) + attr_accessor :test_sent + + # Header of the campaign + attr_accessor :header + + # Footer of the campaign + attr_accessor :footer + + attr_accessor :sender + + # Email defined as the \"Reply to\" of the campaign + attr_accessor :reply_to + + # Customisation of the \"to\" field of the campaign + attr_accessor :to_field + + # HTML content of the campaign + attr_accessor :html_content + + # Link to share the campaign on social medias + attr_accessor :share_link + + # Tag of the campaign + attr_accessor :tag + + # Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + attr_accessor :created_at + + # UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ) + attr_accessor :modified_at + + # Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email. + attr_accessor :inline_image_activation + + # Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign + attr_accessor :mirror_active + + # FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times + attr_accessor :recurring + + # Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent' + attr_accessor :sent_date + + # Total number of non-delivered campaigns for a particular campaign id. + attr_accessor :return_bounce + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'test_sent' => :'testSent', + :'header' => :'header', + :'footer' => :'footer', + :'sender' => :'sender', + :'reply_to' => :'replyTo', + :'to_field' => :'toField', + :'html_content' => :'htmlContent', + :'share_link' => :'shareLink', + :'tag' => :'tag', + :'created_at' => :'createdAt', + :'modified_at' => :'modifiedAt', + :'inline_image_activation' => :'inlineImageActivation', + :'mirror_active' => :'mirrorActive', + :'recurring' => :'recurring', + :'sent_date' => :'sentDate', + :'return_bounce' => :'returnBounce' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'test_sent' => :'Boolean', + :'header' => :'String', + :'footer' => :'String', + :'sender' => :'GetExtendedCampaignOverviewAllOfSender', + :'reply_to' => :'String', + :'to_field' => :'String', + :'html_content' => :'String', + :'share_link' => :'String', + :'tag' => :'String', + :'created_at' => :'String', + :'modified_at' => :'String', + :'inline_image_activation' => :'Boolean', + :'mirror_active' => :'Boolean', + :'recurring' => :'Boolean', + :'sent_date' => :'String', + :'return_bounce' => :'Integer' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedCampaignOverviewAllOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedCampaignOverviewAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'test_sent') + self.test_sent = attributes[:'test_sent'] + end + + if attributes.key?(:'header') + self.header = attributes[:'header'] + end + + if attributes.key?(:'footer') + self.footer = attributes[:'footer'] + end + + if attributes.key?(:'sender') + self.sender = attributes[:'sender'] + end + + if attributes.key?(:'reply_to') + self.reply_to = attributes[:'reply_to'] + end + + if attributes.key?(:'to_field') + self.to_field = attributes[:'to_field'] + end + + if attributes.key?(:'html_content') + self.html_content = attributes[:'html_content'] + end + + if attributes.key?(:'share_link') + self.share_link = attributes[:'share_link'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'inline_image_activation') + self.inline_image_activation = attributes[:'inline_image_activation'] + end + + if attributes.key?(:'mirror_active') + self.mirror_active = attributes[:'mirror_active'] + end + + if attributes.key?(:'recurring') + self.recurring = attributes[:'recurring'] + end + + if attributes.key?(:'sent_date') + self.sent_date = attributes[:'sent_date'] + end + + if attributes.key?(:'return_bounce') + self.return_bounce = attributes[:'return_bounce'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @test_sent.nil? + invalid_properties.push('invalid value for "test_sent", test_sent cannot be nil.') + end + + if @header.nil? + invalid_properties.push('invalid value for "header", header cannot be nil.') + end + + if @footer.nil? + invalid_properties.push('invalid value for "footer", footer cannot be nil.') + end + + if @sender.nil? + invalid_properties.push('invalid value for "sender", sender cannot be nil.') + end + + if @reply_to.nil? + invalid_properties.push('invalid value for "reply_to", reply_to cannot be nil.') + end + + if @html_content.nil? + invalid_properties.push('invalid value for "html_content", html_content cannot be nil.') + end + + if @created_at.nil? + invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') + end + + if @modified_at.nil? + invalid_properties.push('invalid value for "modified_at", modified_at cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @test_sent.nil? + return false if @header.nil? + return false if @footer.nil? + return false if @sender.nil? + return false if @reply_to.nil? + return false if @html_content.nil? + return false if @created_at.nil? + return false if @modified_at.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + test_sent == o.test_sent && + header == o.header && + footer == o.footer && + sender == o.sender && + reply_to == o.reply_to && + to_field == o.to_field && + html_content == o.html_content && + share_link == o.share_link && + tag == o.tag && + created_at == o.created_at && + modified_at == o.modified_at && + inline_image_activation == o.inline_image_activation && + mirror_active == o.mirror_active && + recurring == o.recurring && + sent_date == o.sent_date && + return_bounce == o.return_bounce + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [test_sent, header, footer, sender, reply_to, to_field, html_content, share_link, tag, created_at, modified_at, inline_image_activation, mirror_active, recurring, sent_date, return_bounce].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/sib-api-v3-sdk/models/get_extended_campaign_overview_sender.rb b/lib/sib-api-v3-sdk/models/get_extended_campaign_overview_all_of_sender.rb similarity index 72% rename from lib/sib-api-v3-sdk/models/get_extended_campaign_overview_sender.rb rename to lib/sib-api-v3-sdk/models/get_extended_campaign_overview_all_of_sender.rb index 1323e2b..ef87ca7 100644 --- a/lib/sib-api-v3-sdk/models/get_extended_campaign_overview_sender.rb +++ b/lib/sib-api-v3-sdk/models/get_extended_campaign_overview_all_of_sender.rb @@ -3,17 +3,18 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk - class GetExtendedCampaignOverviewSender + class GetExtendedCampaignOverviewAllOfSender # Sender name of the campaign attr_accessor :name @@ -32,8 +33,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'String', :'email' => :'String', @@ -41,23 +47,36 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedCampaignOverviewAllOfSender` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedCampaignOverviewAllOfSender`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end end @@ -92,18 +111,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, email, id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -111,7 +139,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -123,8 +151,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -133,7 +161,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,8 +182,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -177,7 +206,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -202,4 +235,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_extended_campaign_stats.rb b/lib/sib-api-v3-sdk/models/get_extended_campaign_stats.rb index 48efff9..8039a95 100644 --- a/lib/sib-api-v3-sdk/models/get_extended_campaign_stats.rb +++ b/lib/sib-api-v3-sdk/models/get_extended_campaign_stats.rb @@ -3,17 +3,19 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetExtendedCampaignStats + # Overall statistics of the campaign attr_accessor :global_stats # List-wise statistics of the campaign. @@ -30,10 +32,8 @@ class GetExtendedCampaignStats attr_accessor :stats_by_domain - # Statistics about the campaign on the basis of various devices attr_accessor :stats_by_device - # Statistics about the campaign on the basis of various browsers attr_accessor :stats_by_browser # Attribute mapping from ruby-style variable name to JSON key. @@ -50,60 +50,82 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'global_stats' => :'GetExtendedCampaignStatsGlobalStats', - :'campaign_stats' => :'Array', + :'global_stats' => :'GetCampaignStats', + :'campaign_stats' => :'Array', :'mirror_click' => :'Integer', :'remaining' => :'Integer', :'links_stats' => :'Object', - :'stats_by_domain' => :'GetStatsByDomain', + :'stats_by_domain' => :'Hash', :'stats_by_device' => :'GetStatsByDevice', - :'stats_by_browser' => :'GetStatsByBrowser' + :'stats_by_browser' => :'Hash' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedCampaignStats` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedCampaignStats`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'globalStats') - self.global_stats = attributes[:'globalStats'] + if attributes.key?(:'global_stats') + self.global_stats = attributes[:'global_stats'] end - if attributes.has_key?(:'campaignStats') - if (value = attributes[:'campaignStats']).is_a?(Array) + if attributes.key?(:'campaign_stats') + if (value = attributes[:'campaign_stats']).is_a?(Array) self.campaign_stats = value end end - if attributes.has_key?(:'mirrorClick') - self.mirror_click = attributes[:'mirrorClick'] + if attributes.key?(:'mirror_click') + self.mirror_click = attributes[:'mirror_click'] end - if attributes.has_key?(:'remaining') + if attributes.key?(:'remaining') self.remaining = attributes[:'remaining'] end - if attributes.has_key?(:'linksStats') - self.links_stats = attributes[:'linksStats'] + if attributes.key?(:'links_stats') + self.links_stats = attributes[:'links_stats'] end - if attributes.has_key?(:'statsByDomain') - self.stats_by_domain = attributes[:'statsByDomain'] + if attributes.key?(:'stats_by_domain') + if (value = attributes[:'stats_by_domain']).is_a?(Hash) + self.stats_by_domain = value + end end - if attributes.has_key?(:'statsByDevice') - self.stats_by_device = attributes[:'statsByDevice'] + if attributes.key?(:'stats_by_device') + self.stats_by_device = attributes[:'stats_by_device'] end - if attributes.has_key?(:'statsByBrowser') - self.stats_by_browser = attributes[:'statsByBrowser'] + if attributes.key?(:'stats_by_browser') + if (value = attributes[:'stats_by_browser']).is_a?(Hash) + self.stats_by_browser = value + end end end @@ -182,18 +204,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [global_stats, campaign_stats, mirror_click, remaining, links_stats, stats_by_domain, stats_by_device, stats_by_browser].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -201,7 +232,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -213,8 +244,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -223,7 +254,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -244,8 +275,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -267,7 +299,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -292,4 +328,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_extended_campaign_stats_global_stats.rb b/lib/sib-api-v3-sdk/models/get_extended_campaign_stats_global_stats.rb deleted file mode 100644 index 2c02774..0000000 --- a/lib/sib-api-v3-sdk/models/get_extended_campaign_stats_global_stats.rb +++ /dev/null @@ -1,176 +0,0 @@ -=begin -#SendinBlue API - -#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 | - -OpenAPI spec version: 3.0.0 -Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 - -=end - -require 'date' - -module SibApiV3Sdk - # Overall statistics of the campaign - class GetExtendedCampaignStatsGlobalStats - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.swagger_types - { - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end -end diff --git a/lib/sib-api-v3-sdk/models/get_extended_client.rb b/lib/sib-api-v3-sdk/models/get_extended_client.rb index 7e37935..06c9e9a 100644 --- a/lib/sib-api-v3-sdk/models/get_extended_client.rb +++ b/lib/sib-api-v3-sdk/models/get_extended_client.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetExtendedClient @@ -39,42 +40,68 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'first_name' => :'String', :'last_name' => :'String', :'company_name' => :'String', - :'address' => :'GetExtendedClientAddress' + :'address' => :'GetExtendedClientAllOfAddress' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'GetClient', + :'GetExtendedClientAllOf' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedClient` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedClient`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'firstName') - self.first_name = attributes[:'firstName'] + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] end - if attributes.has_key?(:'lastName') - self.last_name = attributes[:'lastName'] + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] end - if attributes.has_key?(:'companyName') - self.company_name = attributes[:'companyName'] + if attributes.key?(:'company_name') + self.company_name = attributes[:'company_name'] end - if attributes.has_key?(:'address') + if attributes.key?(:'address') self.address = attributes[:'address'] end end @@ -136,18 +163,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, first_name, last_name, company_name, address].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -155,7 +191,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -167,8 +203,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -177,7 +213,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -198,8 +234,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -221,7 +258,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -246,4 +287,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_extended_client_all_of.rb b/lib/sib-api-v3-sdk/models/get_extended_client_all_of.rb new file mode 100644 index 0000000..fabbc47 --- /dev/null +++ b/lib/sib-api-v3-sdk/models/get_extended_client_all_of.rb @@ -0,0 +1,223 @@ +=begin +#SendinBlue API + +#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 | + +The version of the OpenAPI document: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 + +=end + +require 'date' +require 'time' + +module SibApiV3Sdk + class GetExtendedClientAllOf + attr_accessor :address + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'address' => :'address' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'address' => :'GetExtendedClientAllOfAddress' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedClientAllOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedClientAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'address') + self.address = attributes[:'address'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @address.nil? + invalid_properties.push('invalid value for "address", address cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @address.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + address == o.address + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [address].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/sib-api-v3-sdk/models/get_extended_client_address.rb b/lib/sib-api-v3-sdk/models/get_extended_client_all_of_address.rb similarity index 74% rename from lib/sib-api-v3-sdk/models/get_extended_client_address.rb rename to lib/sib-api-v3-sdk/models/get_extended_client_all_of_address.rb index fde2738..bac7115 100644 --- a/lib/sib-api-v3-sdk/models/get_extended_client_address.rb +++ b/lib/sib-api-v3-sdk/models/get_extended_client_all_of_address.rb @@ -3,18 +3,19 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Address informations - class GetExtendedClientAddress + class GetExtendedClientAllOfAddress # Street information attr_accessor :street @@ -37,8 +38,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'street' => :'String', :'city' => :'String', @@ -47,27 +53,40 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedClientAllOfAddress` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedClientAllOfAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'street') + if attributes.key?(:'street') self.street = attributes[:'street'] end - if attributes.has_key?(:'city') + if attributes.key?(:'city') self.city = attributes[:'city'] end - if attributes.has_key?(:'zipCode') - self.zip_code = attributes[:'zipCode'] + if attributes.key?(:'zip_code') + self.zip_code = attributes[:'zip_code'] end - if attributes.has_key?(:'country') + if attributes.key?(:'country') self.country = attributes[:'country'] end end @@ -123,18 +142,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [street, city, zip_code, country].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -142,7 +170,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -154,8 +182,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -164,7 +192,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -185,8 +213,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -208,7 +237,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -233,4 +266,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_extended_contact_details.rb b/lib/sib-api-v3-sdk/models/get_extended_contact_details.rb index e63c7cc..3700a5f 100644 --- a/lib/sib-api-v3-sdk/models/get_extended_contact_details.rb +++ b/lib/sib-api-v3-sdk/models/get_extended_contact_details.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetExtendedContactDetails @@ -57,71 +58,97 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'id' => :'Integer', - :'email_blacklisted' => :'BOOLEAN', - :'sms_blacklisted' => :'BOOLEAN', + :'email_blacklisted' => :'Boolean', + :'sms_blacklisted' => :'Boolean', :'created_at' => :'String', :'modified_at' => :'String', :'list_ids' => :'Array', :'list_unsubscribed' => :'Array', :'attributes' => :'Object', - :'statistics' => :'GetExtendedContactDetailsStatistics' + :'statistics' => :'GetExtendedContactDetailsAllOfStatistics' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'GetContactDetails', + :'GetExtendedContactDetailsAllOf' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedContactDetails` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedContactDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'emailBlacklisted') - self.email_blacklisted = attributes[:'emailBlacklisted'] + if attributes.key?(:'email_blacklisted') + self.email_blacklisted = attributes[:'email_blacklisted'] end - if attributes.has_key?(:'smsBlacklisted') - self.sms_blacklisted = attributes[:'smsBlacklisted'] + if attributes.key?(:'sms_blacklisted') + self.sms_blacklisted = attributes[:'sms_blacklisted'] end - if attributes.has_key?(:'createdAt') - self.created_at = attributes[:'createdAt'] + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] end - if attributes.has_key?(:'modifiedAt') - self.modified_at = attributes[:'modifiedAt'] + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] end - if attributes.has_key?(:'listIds') - if (value = attributes[:'listIds']).is_a?(Array) + if attributes.key?(:'list_ids') + if (value = attributes[:'list_ids']).is_a?(Array) self.list_ids = value end end - if attributes.has_key?(:'listUnsubscribed') - if (value = attributes[:'listUnsubscribed']).is_a?(Array) + if attributes.key?(:'list_unsubscribed') + if (value = attributes[:'list_unsubscribed']).is_a?(Array) self.list_unsubscribed = value end end - if attributes.has_key?(:'attributes') + if attributes.key?(:'attributes') self.attributes = attributes[:'attributes'] end - if attributes.has_key?(:'statistics') + if attributes.key?(:'statistics') self.statistics = attributes[:'statistics'] end end @@ -208,18 +235,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, id, email_blacklisted, sms_blacklisted, created_at, modified_at, list_ids, list_unsubscribed, attributes, statistics].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -227,7 +263,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -239,8 +275,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -249,7 +285,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -270,8 +306,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -293,7 +330,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -318,4 +359,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of.rb b/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of.rb new file mode 100644 index 0000000..7fde8b9 --- /dev/null +++ b/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of.rb @@ -0,0 +1,223 @@ +=begin +#SendinBlue API + +#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 | + +The version of the OpenAPI document: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 + +=end + +require 'date' +require 'time' + +module SibApiV3Sdk + class GetExtendedContactDetailsAllOf + attr_accessor :statistics + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'statistics' => :'statistics' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'statistics' => :'GetExtendedContactDetailsAllOfStatistics' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedContactDetailsAllOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedContactDetailsAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'statistics') + self.statistics = attributes[:'statistics'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @statistics.nil? + invalid_properties.push('invalid value for "statistics", statistics cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @statistics.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + statistics == o.statistics + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [statistics].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics.rb b/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics.rb similarity index 69% rename from lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics.rb rename to lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics.rb index e271ebc..56135f5 100644 --- a/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics.rb +++ b/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics.rb @@ -3,18 +3,19 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Campaign statistics of the contact - class GetExtendedContactDetailsStatistics + class GetExtendedContactDetailsAllOfStatistics # Listing of the sent campaign for the contact attr_accessor :messages_sent @@ -52,70 +53,88 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'messages_sent' => :'Array', - :'hard_bounces' => :'Array', - :'soft_bounces' => :'Array', - :'complaints' => :'Array', - :'unsubscriptions' => :'GetExtendedContactDetailsStatisticsUnsubscriptions', - :'opened' => :'Array', - :'clicked' => :'Array', + :'messages_sent' => :'Array', + :'hard_bounces' => :'Array', + :'soft_bounces' => :'Array', + :'complaints' => :'Array', + :'unsubscriptions' => :'GetExtendedContactDetailsAllOfStatisticsUnsubscriptions', + :'opened' => :'Array', + :'clicked' => :'Array', :'transac_attributes' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedContactDetailsAllOfStatistics` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedContactDetailsAllOfStatistics`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'messagesSent') - if (value = attributes[:'messagesSent']).is_a?(Array) + if attributes.key?(:'messages_sent') + if (value = attributes[:'messages_sent']).is_a?(Array) self.messages_sent = value end end - if attributes.has_key?(:'hardBounces') - if (value = attributes[:'hardBounces']).is_a?(Array) + if attributes.key?(:'hard_bounces') + if (value = attributes[:'hard_bounces']).is_a?(Array) self.hard_bounces = value end end - if attributes.has_key?(:'softBounces') - if (value = attributes[:'softBounces']).is_a?(Array) + if attributes.key?(:'soft_bounces') + if (value = attributes[:'soft_bounces']).is_a?(Array) self.soft_bounces = value end end - if attributes.has_key?(:'complaints') + if attributes.key?(:'complaints') if (value = attributes[:'complaints']).is_a?(Array) self.complaints = value end end - if attributes.has_key?(:'unsubscriptions') + if attributes.key?(:'unsubscriptions') self.unsubscriptions = attributes[:'unsubscriptions'] end - if attributes.has_key?(:'opened') + if attributes.key?(:'opened') if (value = attributes[:'opened']).is_a?(Array) self.opened = value end end - if attributes.has_key?(:'clicked') + if attributes.key?(:'clicked') if (value = attributes[:'clicked']).is_a?(Array) self.clicked = value end end - if attributes.has_key?(:'transacAttributes') - if (value = attributes[:'transacAttributes']).is_a?(Array) + if attributes.key?(:'transac_attributes') + if (value = attributes[:'transac_attributes']).is_a?(Array) self.transac_attributes = value end end @@ -156,18 +175,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [messages_sent, hard_bounces, soft_bounces, complaints, unsubscriptions, opened, clicked, transac_attributes].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -175,7 +203,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -187,8 +215,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -197,7 +225,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -218,8 +246,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -241,7 +270,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -266,4 +299,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_clicked.rb b/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_clicked.rb similarity index 72% rename from lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_clicked.rb rename to lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_clicked.rb index f9c4a70..dd365e1 100644 --- a/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_clicked.rb +++ b/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_clicked.rb @@ -3,17 +3,18 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk - class GetExtendedContactDetailsStatisticsClicked + class GetExtendedContactDetailsAllOfStatisticsClicked # ID of the campaign which generated the event attr_accessor :campaign_id @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'campaign_id' => :'Integer', - :'links' => :'Array' + :'links' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsClicked` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsClicked`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'campaignId') - self.campaign_id = attributes[:'campaignId'] + if attributes.key?(:'campaign_id') + self.campaign_id = attributes[:'campaign_id'] end - if attributes.has_key?(:'links') + if attributes.key?(:'links') if (value = attributes[:'links']).is_a?(Array) self.links = value end @@ -94,18 +113,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [campaign_id, links].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -113,7 +141,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -125,8 +153,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -135,7 +163,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -156,8 +184,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -179,7 +208,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -204,4 +237,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_links.rb b/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_links.rb similarity index 74% rename from lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_links.rb rename to lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_links.rb index e7a0d5d..bd19e39 100644 --- a/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_links.rb +++ b/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_links.rb @@ -3,17 +3,18 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk - class GetExtendedContactDetailsStatisticsLinks + class GetExtendedContactDetailsAllOfStatisticsLinks # Number of clicks on this link for the campaign attr_accessor :count @@ -36,8 +37,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'count' => :'Integer', :'event_time' => :'String', @@ -46,27 +52,40 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsLinks` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsLinks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'count') + if attributes.key?(:'count') self.count = attributes[:'count'] end - if attributes.has_key?(:'eventTime') - self.event_time = attributes[:'eventTime'] + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] end - if attributes.has_key?(:'ip') + if attributes.key?(:'ip') self.ip = attributes[:'ip'] end - if attributes.has_key?(:'url') + if attributes.key?(:'url') self.url = attributes[:'url'] end end @@ -122,18 +141,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [count, event_time, ip, url].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -141,7 +169,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -153,8 +181,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -163,7 +191,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -184,8 +212,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -207,7 +236,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -232,4 +265,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_messages_sent.rb b/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_messages_sent.rb similarity index 72% rename from lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_messages_sent.rb rename to lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_messages_sent.rb index 779fd05..db63a6a 100644 --- a/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_messages_sent.rb +++ b/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_messages_sent.rb @@ -3,17 +3,18 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk - class GetExtendedContactDetailsStatisticsMessagesSent + class GetExtendedContactDetailsAllOfStatisticsMessagesSent # ID of the campaign which generated the event attr_accessor :campaign_id @@ -28,28 +29,46 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'campaign_id' => :'Integer', :'event_time' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsMessagesSent` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsMessagesSent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'campaignId') - self.campaign_id = attributes[:'campaignId'] + if attributes.key?(:'campaign_id') + self.campaign_id = attributes[:'campaign_id'] end - if attributes.has_key?(:'eventTime') - self.event_time = attributes[:'eventTime'] + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] end end @@ -92,18 +111,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [campaign_id, event_time].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -111,7 +139,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -123,8 +151,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -133,7 +161,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,8 +182,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -177,7 +206,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -202,4 +235,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_opened.rb b/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_opened.rb similarity index 74% rename from lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_opened.rb rename to lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_opened.rb index e553bf2..a47efa5 100644 --- a/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_opened.rb +++ b/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_opened.rb @@ -3,17 +3,18 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk - class GetExtendedContactDetailsStatisticsOpened + class GetExtendedContactDetailsAllOfStatisticsOpened # ID of the campaign which generated the event attr_accessor :campaign_id @@ -36,8 +37,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'campaign_id' => :'Integer', :'count' => :'Integer', @@ -46,27 +52,40 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsOpened` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsOpened`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'campaignId') - self.campaign_id = attributes[:'campaignId'] + if attributes.key?(:'campaign_id') + self.campaign_id = attributes[:'campaign_id'] end - if attributes.has_key?(:'count') + if attributes.key?(:'count') self.count = attributes[:'count'] end - if attributes.has_key?(:'eventTime') - self.event_time = attributes[:'eventTime'] + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] end - if attributes.has_key?(:'ip') + if attributes.key?(:'ip') self.ip = attributes[:'ip'] end end @@ -122,18 +141,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [campaign_id, count, event_time, ip].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -141,7 +169,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -153,8 +181,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -163,7 +191,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -184,8 +212,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -207,7 +236,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -232,4 +265,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_unsubscriptions.rb b/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_unsubscriptions.rb similarity index 72% rename from lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_unsubscriptions.rb rename to lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_unsubscriptions.rb index 78b4cd0..20c1d3c 100644 --- a/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_unsubscriptions.rb +++ b/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_unsubscriptions.rb @@ -3,18 +3,19 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Listing of the unsubscription for the contact - class GetExtendedContactDetailsStatisticsUnsubscriptions + class GetExtendedContactDetailsAllOfStatisticsUnsubscriptions # Contact unsubscribe via unsubscription link in a campaign attr_accessor :user_unsubscription @@ -29,30 +30,48 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'user_unsubscription' => :'Array', - :'admin_unsubscription' => :'Array' + :'user_unsubscription' => :'Array', + :'admin_unsubscription' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptions` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'userUnsubscription') - if (value = attributes[:'userUnsubscription']).is_a?(Array) + if attributes.key?(:'user_unsubscription') + if (value = attributes[:'user_unsubscription']).is_a?(Array) self.user_unsubscription = value end end - if attributes.has_key?(:'adminUnsubscription') - if (value = attributes[:'adminUnsubscription']).is_a?(Array) + if attributes.key?(:'admin_unsubscription') + if (value = attributes[:'admin_unsubscription']).is_a?(Array) self.admin_unsubscription = value end end @@ -97,18 +116,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [user_unsubscription, admin_unsubscription].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -116,7 +144,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -128,8 +156,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -138,7 +166,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -159,8 +187,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -182,7 +211,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -207,4 +240,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_unsubscriptions_admin_unsubscription.rb b/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_unsubscriptions_admin_unsubscription.rb similarity index 71% rename from lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_unsubscriptions_admin_unsubscription.rb rename to lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_unsubscriptions_admin_unsubscription.rb index 9ac4e2d..ed50604 100644 --- a/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_unsubscriptions_admin_unsubscription.rb +++ b/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_unsubscriptions_admin_unsubscription.rb @@ -3,17 +3,18 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk - class GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription + class GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription # UTC date-time of the event attr_accessor :event_time @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'event_time' => :'String', :'ip' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'eventTime') - self.event_time = attributes[:'eventTime'] + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] end - if attributes.has_key?(:'ip') + if attributes.key?(:'ip') self.ip = attributes[:'ip'] end end @@ -87,18 +106,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [event_time, ip].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -106,7 +134,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -118,8 +146,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -128,7 +156,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -149,8 +177,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -172,7 +201,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -197,4 +230,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_unsubscriptions_user_unsubscription.rb b/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_unsubscriptions_user_unsubscription.rb similarity index 72% rename from lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_unsubscriptions_user_unsubscription.rb rename to lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_unsubscriptions_user_unsubscription.rb index 436ba45..fc16147 100644 --- a/lib/sib-api-v3-sdk/models/get_extended_contact_details_statistics_unsubscriptions_user_unsubscription.rb +++ b/lib/sib-api-v3-sdk/models/get_extended_contact_details_all_of_statistics_unsubscriptions_user_unsubscription.rb @@ -3,17 +3,18 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk - class GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription + class GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription # ID of the campaign which generated the event attr_accessor :campaign_id @@ -32,8 +33,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'campaign_id' => :'Integer', :'event_time' => :'String', @@ -41,23 +47,36 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'campaignId') - self.campaign_id = attributes[:'campaignId'] + if attributes.key?(:'campaign_id') + self.campaign_id = attributes[:'campaign_id'] end - if attributes.has_key?(:'eventTime') - self.event_time = attributes[:'eventTime'] + if attributes.key?(:'event_time') + self.event_time = attributes[:'event_time'] end - if attributes.has_key?(:'ip') + if attributes.key?(:'ip') self.ip = attributes[:'ip'] end end @@ -102,18 +121,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [campaign_id, event_time, ip].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -121,7 +149,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -133,8 +161,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -143,7 +171,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -164,8 +192,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -187,7 +216,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -212,4 +245,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_extended_list.rb b/lib/sib-api-v3-sdk/models/get_extended_list.rb index 11e45c9..f51db26 100644 --- a/lib/sib-api-v3-sdk/models/get_extended_list.rb +++ b/lib/sib-api-v3-sdk/models/get_extended_list.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetExtendedList @@ -26,6 +27,9 @@ class GetExtendedList # Number of contacts in the list attr_accessor :total_subscribers + # Number of unique contacts in the list + attr_accessor :unique_subscribers + # ID of the folder attr_accessor :folder_id @@ -44,6 +48,7 @@ def self.attribute_map :'name' => :'name', :'total_blacklisted' => :'totalBlacklisted', :'total_subscribers' => :'totalSubscribers', + :'unique_subscribers' => :'uniqueSubscribers', :'folder_id' => :'folderId', :'created_at' => :'createdAt', :'campaign_stats' => :'campaignStats', @@ -51,60 +56,91 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', :'name' => :'String', :'total_blacklisted' => :'Integer', :'total_subscribers' => :'Integer', + :'unique_subscribers' => :'Integer', :'folder_id' => :'Integer', :'created_at' => :'String', - :'campaign_stats' => :'Array', - :'dynamic_list' => :'BOOLEAN' + :'campaign_stats' => :'Array', + :'dynamic_list' => :'Boolean' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'GetExtendedListAllOf', + :'GetList' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedList` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'totalBlacklisted') - self.total_blacklisted = attributes[:'totalBlacklisted'] + if attributes.key?(:'total_blacklisted') + self.total_blacklisted = attributes[:'total_blacklisted'] + end + + if attributes.key?(:'total_subscribers') + self.total_subscribers = attributes[:'total_subscribers'] end - if attributes.has_key?(:'totalSubscribers') - self.total_subscribers = attributes[:'totalSubscribers'] + if attributes.key?(:'unique_subscribers') + self.unique_subscribers = attributes[:'unique_subscribers'] end - if attributes.has_key?(:'folderId') - self.folder_id = attributes[:'folderId'] + if attributes.key?(:'folder_id') + self.folder_id = attributes[:'folder_id'] end - if attributes.has_key?(:'createdAt') - self.created_at = attributes[:'createdAt'] + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] end - if attributes.has_key?(:'campaignStats') - if (value = attributes[:'campaignStats']).is_a?(Array) + if attributes.key?(:'campaign_stats') + if (value = attributes[:'campaign_stats']).is_a?(Array) self.campaign_stats = value end end - if attributes.has_key?(:'dynamicList') - self.dynamic_list = attributes[:'dynamicList'] + if attributes.key?(:'dynamic_list') + self.dynamic_list = attributes[:'dynamic_list'] end end @@ -128,6 +164,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "total_subscribers", total_subscribers cannot be nil.') end + if @unique_subscribers.nil? + invalid_properties.push('invalid value for "unique_subscribers", unique_subscribers cannot be nil.') + end + if @folder_id.nil? invalid_properties.push('invalid value for "folder_id", folder_id cannot be nil.') end @@ -146,6 +186,7 @@ def valid? return false if @name.nil? return false if @total_blacklisted.nil? return false if @total_subscribers.nil? + return false if @unique_subscribers.nil? return false if @folder_id.nil? return false if @created_at.nil? true @@ -160,6 +201,7 @@ def ==(o) name == o.name && total_blacklisted == o.total_blacklisted && total_subscribers == o.total_subscribers && + unique_subscribers == o.unique_subscribers && folder_id == o.folder_id && created_at == o.created_at && campaign_stats == o.campaign_stats && @@ -173,9 +215,16 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash - [id, name, total_blacklisted, total_subscribers, folder_id, created_at, campaign_stats, dynamic_list].hash + [id, name, total_blacklisted, total_subscribers, unique_subscribers, folder_id, created_at, campaign_stats, dynamic_list].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) end # Builds the object from hash @@ -183,8 +232,10 @@ def hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -192,7 +243,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -204,8 +255,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -214,7 +265,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -235,8 +286,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -258,7 +310,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -283,4 +339,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_extended_list_all_of.rb b/lib/sib-api-v3-sdk/models/get_extended_list_all_of.rb new file mode 100644 index 0000000..9e20a03 --- /dev/null +++ b/lib/sib-api-v3-sdk/models/get_extended_list_all_of.rb @@ -0,0 +1,260 @@ +=begin +#SendinBlue API + +#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 | + +The version of the OpenAPI document: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 + +=end + +require 'date' +require 'time' + +module SibApiV3Sdk + class GetExtendedListAllOf + # ID of the folder + attr_accessor :folder_id + + # Creation UTC date-time of the list (YYYY-MM-DDTHH:mm:ss.SSSZ) + attr_accessor :created_at + + attr_accessor :campaign_stats + + # Status telling if the list is dynamic or not (true=dynamic, false=not dynamic) + attr_accessor :dynamic_list + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'folder_id' => :'folderId', + :'created_at' => :'createdAt', + :'campaign_stats' => :'campaignStats', + :'dynamic_list' => :'dynamicList' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'folder_id' => :'Integer', + :'created_at' => :'String', + :'campaign_stats' => :'Array', + :'dynamic_list' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedListAllOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedListAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'folder_id') + self.folder_id = attributes[:'folder_id'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'campaign_stats') + if (value = attributes[:'campaign_stats']).is_a?(Array) + self.campaign_stats = value + end + end + + if attributes.key?(:'dynamic_list') + self.dynamic_list = attributes[:'dynamic_list'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @folder_id.nil? + invalid_properties.push('invalid value for "folder_id", folder_id cannot be nil.') + end + + if @created_at.nil? + invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @folder_id.nil? + return false if @created_at.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + folder_id == o.folder_id && + created_at == o.created_at && + campaign_stats == o.campaign_stats && + dynamic_list == o.dynamic_list + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [folder_id, created_at, campaign_stats, dynamic_list].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/sib-api-v3-sdk/models/get_extended_list_campaign_stats.rb b/lib/sib-api-v3-sdk/models/get_extended_list_all_of_campaign_stats.rb similarity index 73% rename from lib/sib-api-v3-sdk/models/get_extended_list_campaign_stats.rb rename to lib/sib-api-v3-sdk/models/get_extended_list_all_of_campaign_stats.rb index 1a77c12..45dbcbc 100644 --- a/lib/sib-api-v3-sdk/models/get_extended_list_campaign_stats.rb +++ b/lib/sib-api-v3-sdk/models/get_extended_list_all_of_campaign_stats.rb @@ -3,17 +3,18 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk - class GetExtendedListCampaignStats + class GetExtendedListAllOfCampaignStats # ID of the campaign attr_accessor :campaign_id @@ -27,27 +28,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'campaign_id' => :'Integer', :'stats' => :'GetCampaignStats' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetExtendedListAllOfCampaignStats` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetExtendedListAllOfCampaignStats`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'campaignId') - self.campaign_id = attributes[:'campaignId'] + if attributes.key?(:'campaign_id') + self.campaign_id = attributes[:'campaign_id'] end - if attributes.has_key?(:'stats') + if attributes.key?(:'stats') self.stats = attributes[:'stats'] end end @@ -91,18 +110,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [campaign_id, stats].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -110,7 +138,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -122,8 +150,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -132,7 +160,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -153,8 +181,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -176,7 +205,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -201,4 +234,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_folder.rb b/lib/sib-api-v3-sdk/models/get_folder.rb index 1dd70bc..75ccc4f 100644 --- a/lib/sib-api-v3-sdk/models/get_folder.rb +++ b/lib/sib-api-v3-sdk/models/get_folder.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetFolder @@ -40,8 +41,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', :'name' => :'String', @@ -51,32 +57,45 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetFolder` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetFolder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'totalBlacklisted') - self.total_blacklisted = attributes[:'totalBlacklisted'] + if attributes.key?(:'total_blacklisted') + self.total_blacklisted = attributes[:'total_blacklisted'] end - if attributes.has_key?(:'totalSubscribers') - self.total_subscribers = attributes[:'totalSubscribers'] + if attributes.key?(:'total_subscribers') + self.total_subscribers = attributes[:'total_subscribers'] end - if attributes.has_key?(:'uniqueSubscribers') - self.unique_subscribers = attributes[:'uniqueSubscribers'] + if attributes.key?(:'unique_subscribers') + self.unique_subscribers = attributes[:'unique_subscribers'] end end @@ -137,18 +156,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id, name, total_blacklisted, total_subscribers, unique_subscribers].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -156,7 +184,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -168,8 +196,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -178,7 +206,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -199,8 +227,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -222,7 +251,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -247,4 +280,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_folder_lists.rb b/lib/sib-api-v3-sdk/models/get_folder_lists.rb index ded0605..75caec5 100644 --- a/lib/sib-api-v3-sdk/models/get_folder_lists.rb +++ b/lib/sib-api-v3-sdk/models/get_folder_lists.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetFolderLists @@ -27,29 +28,47 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'lists' => :'Array', + :'lists' => :'Array', :'count' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetFolderLists` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetFolderLists`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'lists') + if attributes.key?(:'lists') if (value = attributes[:'lists']).is_a?(Array) self.lists = value end end - if attributes.has_key?(:'count') + if attributes.key?(:'count') self.count = attributes[:'count'] end end @@ -83,18 +102,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [lists, count].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -102,7 +130,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -114,8 +142,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -124,7 +152,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -145,8 +173,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -168,7 +197,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -193,4 +226,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_folders.rb b/lib/sib-api-v3-sdk/models/get_folders.rb index 49dd292..bc84829 100644 --- a/lib/sib-api-v3-sdk/models/get_folders.rb +++ b/lib/sib-api-v3-sdk/models/get_folders.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetFolders @@ -27,29 +28,47 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'folders' => :'Array', + :'folders' => :'Array', :'count' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetFolders` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetFolders`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'folders') + if attributes.key?(:'folders') if (value = attributes[:'folders']).is_a?(Array) self.folders = value end end - if attributes.has_key?(:'count') + if attributes.key?(:'count') self.count = attributes[:'count'] end end @@ -83,18 +102,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [folders, count].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -102,7 +130,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -114,8 +142,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -124,7 +152,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -145,8 +173,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -168,7 +197,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -193,4 +226,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_ip.rb b/lib/sib-api-v3-sdk/models/get_ip.rb index 0a3f7fc..4bd5a64 100644 --- a/lib/sib-api-v3-sdk/models/get_ip.rb +++ b/lib/sib-api-v3-sdk/models/get_ip.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetIp @@ -36,37 +37,55 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', :'ip' => :'String', - :'active' => :'BOOLEAN', + :'active' => :'Boolean', :'domain' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetIp` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetIp`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'ip') + if attributes.key?(:'ip') self.ip = attributes[:'ip'] end - if attributes.has_key?(:'active') + if attributes.key?(:'active') self.active = attributes[:'active'] end - if attributes.has_key?(:'domain') + if attributes.key?(:'domain') self.domain = attributes[:'domain'] end end @@ -122,18 +141,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id, ip, active, domain].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -141,7 +169,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -153,8 +181,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -163,7 +191,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -184,8 +212,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -207,7 +236,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -232,4 +265,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_ip_from_sender.rb b/lib/sib-api-v3-sdk/models/get_ip_from_sender.rb index 0166ccd..9ff54e5 100644 --- a/lib/sib-api-v3-sdk/models/get_ip_from_sender.rb +++ b/lib/sib-api-v3-sdk/models/get_ip_from_sender.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetIpFromSender @@ -36,8 +37,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', :'ip' => :'String', @@ -46,27 +52,40 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetIpFromSender` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetIpFromSender`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'ip') + if attributes.key?(:'ip') self.ip = attributes[:'ip'] end - if attributes.has_key?(:'domain') + if attributes.key?(:'domain') self.domain = attributes[:'domain'] end - if attributes.has_key?(:'weight') + if attributes.key?(:'weight') self.weight = attributes[:'weight'] end end @@ -122,18 +141,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id, ip, domain, weight].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -141,7 +169,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -153,8 +181,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -163,7 +191,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -184,8 +212,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -207,7 +236,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -232,4 +265,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_ips.rb b/lib/sib-api-v3-sdk/models/get_ips.rb index e749b73..f059fa9 100644 --- a/lib/sib-api-v3-sdk/models/get_ips.rb +++ b/lib/sib-api-v3-sdk/models/get_ips.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetIps @@ -24,22 +25,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'ips' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetIps` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetIps`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'ips') + if attributes.key?(:'ips') if (value = attributes[:'ips']).is_a?(Array) self.ips = value end @@ -79,18 +98,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [ips].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -98,7 +126,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -110,8 +138,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -120,7 +148,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -141,8 +169,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -164,7 +193,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -189,4 +222,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_ips_from_sender.rb b/lib/sib-api-v3-sdk/models/get_ips_from_sender.rb index 153a681..df0d45e 100644 --- a/lib/sib-api-v3-sdk/models/get_ips_from_sender.rb +++ b/lib/sib-api-v3-sdk/models/get_ips_from_sender.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetIpsFromSender @@ -24,22 +25,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'ips' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetIpsFromSender` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetIpsFromSender`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'ips') + if attributes.key?(:'ips') if (value = attributes[:'ips']).is_a?(Array) self.ips = value end @@ -79,18 +98,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [ips].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -98,7 +126,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -110,8 +138,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -120,7 +148,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -141,8 +169,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -164,7 +193,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -189,4 +222,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_list.rb b/lib/sib-api-v3-sdk/models/get_list.rb index a4be18d..346733d 100644 --- a/lib/sib-api-v3-sdk/models/get_list.rb +++ b/lib/sib-api-v3-sdk/models/get_list.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetList @@ -26,48 +27,75 @@ class GetList # Number of contacts in the list attr_accessor :total_subscribers + # Number of unique contacts in the list + attr_accessor :unique_subscribers + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'id' => :'id', :'name' => :'name', :'total_blacklisted' => :'totalBlacklisted', - :'total_subscribers' => :'totalSubscribers' + :'total_subscribers' => :'totalSubscribers', + :'unique_subscribers' => :'uniqueSubscribers' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', :'name' => :'String', :'total_blacklisted' => :'Integer', - :'total_subscribers' => :'Integer' + :'total_subscribers' => :'Integer', + :'unique_subscribers' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetList` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'totalBlacklisted') - self.total_blacklisted = attributes[:'totalBlacklisted'] + if attributes.key?(:'total_blacklisted') + self.total_blacklisted = attributes[:'total_blacklisted'] end - if attributes.has_key?(:'totalSubscribers') - self.total_subscribers = attributes[:'totalSubscribers'] + if attributes.key?(:'total_subscribers') + self.total_subscribers = attributes[:'total_subscribers'] + end + + if attributes.key?(:'unique_subscribers') + self.unique_subscribers = attributes[:'unique_subscribers'] end end @@ -91,6 +119,10 @@ def list_invalid_properties invalid_properties.push('invalid value for "total_subscribers", total_subscribers cannot be nil.') end + if @unique_subscribers.nil? + invalid_properties.push('invalid value for "unique_subscribers", unique_subscribers cannot be nil.') + end + invalid_properties end @@ -101,6 +133,7 @@ def valid? return false if @name.nil? return false if @total_blacklisted.nil? return false if @total_subscribers.nil? + return false if @unique_subscribers.nil? true end @@ -112,7 +145,8 @@ def ==(o) id == o.id && name == o.name && total_blacklisted == o.total_blacklisted && - total_subscribers == o.total_subscribers + total_subscribers == o.total_subscribers && + unique_subscribers == o.unique_subscribers end # @see the `==` method @@ -122,9 +156,16 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash - [id, name, total_blacklisted, total_subscribers].hash + [id, name, total_blacklisted, total_subscribers, unique_subscribers].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) end # Builds the object from hash @@ -132,8 +173,10 @@ def hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -141,7 +184,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -153,8 +196,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -163,7 +206,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -184,8 +227,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -207,7 +251,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -232,4 +280,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_lists.rb b/lib/sib-api-v3-sdk/models/get_lists.rb index 44a6659..8c5e9ba 100644 --- a/lib/sib-api-v3-sdk/models/get_lists.rb +++ b/lib/sib-api-v3-sdk/models/get_lists.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetLists @@ -28,29 +29,47 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'lists' => :'Array', + :'lists' => :'Array', :'count' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetLists` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetLists`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'lists') + if attributes.key?(:'lists') if (value = attributes[:'lists']).is_a?(Array) self.lists = value end end - if attributes.has_key?(:'count') + if attributes.key?(:'count') self.count = attributes[:'count'] end end @@ -84,18 +103,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [lists, count].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -103,7 +131,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -115,8 +143,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -125,7 +153,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -146,8 +174,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -169,7 +198,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -194,4 +227,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_process.rb b/lib/sib-api-v3-sdk/models/get_process.rb index 214993d..90f7b69 100644 --- a/lib/sib-api-v3-sdk/models/get_process.rb +++ b/lib/sib-api-v3-sdk/models/get_process.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetProcess @@ -58,8 +59,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', :'status' => :'String', @@ -68,27 +74,40 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetProcess` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetProcess`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'status') + if attributes.key?(:'status') self.status = attributes[:'status'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'export_url') + if attributes.key?(:'export_url') self.export_url = attributes[:'export_url'] end end @@ -117,7 +136,7 @@ def list_invalid_properties def valid? return false if @id.nil? return false if @status.nil? - status_validator = EnumAttributeValidator.new('String', ['queued', 'in_process', 'completed']) + status_validator = EnumAttributeValidator.new('String', ["queued", "in_process", "completed"]) return false unless status_validator.valid?(@status) return false if @name.nil? true @@ -126,9 +145,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] status Object to be assigned def status=(status) - validator = EnumAttributeValidator.new('String', ['queued', 'in_process', 'completed']) + validator = EnumAttributeValidator.new('String', ["queued", "in_process", "completed"]) unless validator.valid?(status) - fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." end @status = status end @@ -151,18 +170,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id, status, name, export_url].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -170,7 +198,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -182,8 +210,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -192,7 +220,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -213,8 +241,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -236,7 +265,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -261,4 +294,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_processes.rb b/lib/sib-api-v3-sdk/models/get_processes.rb index 842a699..1206a05 100644 --- a/lib/sib-api-v3-sdk/models/get_processes.rb +++ b/lib/sib-api-v3-sdk/models/get_processes.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetProcesses @@ -28,29 +29,47 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'processes' => :'Array', :'count' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetProcesses` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetProcesses`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'processes') + if attributes.key?(:'processes') if (value = attributes[:'processes']).is_a?(Array) self.processes = value end end - if attributes.has_key?(:'count') + if attributes.key?(:'count') self.count = attributes[:'count'] end end @@ -84,18 +103,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [processes, count].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -103,7 +131,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -115,8 +143,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -125,7 +153,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -146,8 +174,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -169,7 +198,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -194,4 +227,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_reports.rb b/lib/sib-api-v3-sdk/models/get_reports.rb index 910a1cc..d87514a 100644 --- a/lib/sib-api-v3-sdk/models/get_reports.rb +++ b/lib/sib-api-v3-sdk/models/get_reports.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetReports @@ -23,22 +24,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'reports' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetReports` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetReports`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'reports') + if attributes.key?(:'reports') if (value = attributes[:'reports']).is_a?(Array) self.reports = value end @@ -73,18 +92,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [reports].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -92,7 +120,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -104,8 +132,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -114,7 +142,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -135,8 +163,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -158,7 +187,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -183,4 +216,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_reports_reports.rb b/lib/sib-api-v3-sdk/models/get_reports_reports.rb index 40e28fc..683e1ba 100644 --- a/lib/sib-api-v3-sdk/models/get_reports_reports.rb +++ b/lib/sib-api-v3-sdk/models/get_reports_reports.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetReportsReports @@ -72,8 +73,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'date' => :'Date', :'requests' => :'Integer', @@ -91,63 +97,76 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetReportsReports` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetReportsReports`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'date') + if attributes.key?(:'date') self.date = attributes[:'date'] end - if attributes.has_key?(:'requests') + if attributes.key?(:'requests') self.requests = attributes[:'requests'] end - if attributes.has_key?(:'delivered') + if attributes.key?(:'delivered') self.delivered = attributes[:'delivered'] end - if attributes.has_key?(:'hardBounces') - self.hard_bounces = attributes[:'hardBounces'] + if attributes.key?(:'hard_bounces') + self.hard_bounces = attributes[:'hard_bounces'] end - if attributes.has_key?(:'softBounces') - self.soft_bounces = attributes[:'softBounces'] + if attributes.key?(:'soft_bounces') + self.soft_bounces = attributes[:'soft_bounces'] end - if attributes.has_key?(:'clicks') + if attributes.key?(:'clicks') self.clicks = attributes[:'clicks'] end - if attributes.has_key?(:'uniqueClicks') - self.unique_clicks = attributes[:'uniqueClicks'] + if attributes.key?(:'unique_clicks') + self.unique_clicks = attributes[:'unique_clicks'] end - if attributes.has_key?(:'opens') + if attributes.key?(:'opens') self.opens = attributes[:'opens'] end - if attributes.has_key?(:'uniqueOpens') - self.unique_opens = attributes[:'uniqueOpens'] + if attributes.key?(:'unique_opens') + self.unique_opens = attributes[:'unique_opens'] end - if attributes.has_key?(:'spamReports') - self.spam_reports = attributes[:'spamReports'] + if attributes.key?(:'spam_reports') + self.spam_reports = attributes[:'spam_reports'] end - if attributes.has_key?(:'blocked') + if attributes.key?(:'blocked') self.blocked = attributes[:'blocked'] end - if attributes.has_key?(:'invalid') + if attributes.key?(:'invalid') self.invalid = attributes[:'invalid'] end - if attributes.has_key?(:'unsubscribed') + if attributes.key?(:'unsubscribed') self.unsubscribed = attributes[:'unsubscribed'] end end @@ -257,18 +276,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [date, requests, delivered, hard_bounces, soft_bounces, clicks, unique_clicks, opens, unique_opens, spam_reports, blocked, invalid, unsubscribed].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -276,7 +304,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -288,8 +316,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -298,7 +326,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -319,8 +347,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -342,7 +371,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -367,4 +400,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_senders_list.rb b/lib/sib-api-v3-sdk/models/get_senders_list.rb index 419e7c7..19f2b3a 100644 --- a/lib/sib-api-v3-sdk/models/get_senders_list.rb +++ b/lib/sib-api-v3-sdk/models/get_senders_list.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetSendersList @@ -24,22 +25,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'senders' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetSendersList` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetSendersList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'senders') + if attributes.key?(:'senders') if (value = attributes[:'senders']).is_a?(Array) self.senders = value end @@ -74,18 +93,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [senders].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -93,7 +121,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -105,8 +133,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -115,7 +143,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -136,8 +164,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -159,7 +188,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -184,4 +217,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_senders_list_ips.rb b/lib/sib-api-v3-sdk/models/get_senders_list_ips.rb index 5d32ac3..ca94671 100644 --- a/lib/sib-api-v3-sdk/models/get_senders_list_ips.rb +++ b/lib/sib-api-v3-sdk/models/get_senders_list_ips.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetSendersListIps @@ -32,8 +33,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'ip' => :'String', :'domain' => :'String', @@ -41,23 +47,36 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetSendersListIps` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetSendersListIps`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'ip') + if attributes.key?(:'ip') self.ip = attributes[:'ip'] end - if attributes.has_key?(:'domain') + if attributes.key?(:'domain') self.domain = attributes[:'domain'] end - if attributes.has_key?(:'weight') + if attributes.key?(:'weight') self.weight = attributes[:'weight'] end end @@ -107,18 +126,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [ip, domain, weight].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -126,7 +154,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -138,8 +166,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -148,7 +176,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -169,8 +197,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -192,7 +221,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -217,4 +250,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_senders_list_senders.rb b/lib/sib-api-v3-sdk/models/get_senders_list_senders.rb index ef1a609..c0dfe32 100644 --- a/lib/sib-api-v3-sdk/models/get_senders_list_senders.rb +++ b/lib/sib-api-v3-sdk/models/get_senders_list_senders.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetSendersListSenders @@ -40,42 +41,60 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', :'name' => :'String', :'email' => :'String', - :'active' => :'BOOLEAN', + :'active' => :'Boolean', :'ips' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetSendersListSenders` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetSendersListSenders`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'active') + if attributes.key?(:'active') self.active = attributes[:'active'] end - if attributes.has_key?(:'ips') + if attributes.key?(:'ips') if (value = attributes[:'ips']).is_a?(Array) self.ips = value end @@ -134,18 +153,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id, name, email, active, ips].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -153,7 +181,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -165,8 +193,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -175,7 +203,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -196,8 +224,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -219,7 +248,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -244,4 +277,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_shared_template_url.rb b/lib/sib-api-v3-sdk/models/get_shared_template_url.rb index fd6a094..cc425f1 100644 --- a/lib/sib-api-v3-sdk/models/get_shared_template_url.rb +++ b/lib/sib-api-v3-sdk/models/get_shared_template_url.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetSharedTemplateUrl @@ -24,23 +25,41 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'shared_url' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetSharedTemplateUrl` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetSharedTemplateUrl`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'sharedUrl') - self.shared_url = attributes[:'sharedUrl'] + if attributes.key?(:'shared_url') + self.shared_url = attributes[:'shared_url'] end end @@ -77,18 +96,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [shared_url].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -96,7 +124,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -108,8 +136,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -118,7 +146,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -139,8 +167,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -162,7 +191,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -187,4 +220,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_sms_campaign.rb b/lib/sib-api-v3-sdk/models/get_sms_campaign.rb index adb7c4d..e4bf857 100644 --- a/lib/sib-api-v3-sdk/models/get_sms_campaign.rb +++ b/lib/sib-api-v3-sdk/models/get_sms_campaign.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetSmsCampaign @@ -80,8 +81,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', :'name' => :'String', @@ -91,56 +97,77 @@ def self.swagger_types :'sender' => :'String', :'created_at' => :'String', :'modified_at' => :'String', - :'recipients' => :'GetSmsCampaignRecipients', - :'statistics' => :'GetSmsCampaignRecipients' + :'recipients' => :'GetCampaignRecipients', + :'statistics' => :'GetSmsCampaignStats' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in allOf (OpenAPI v3) + def self.openapi_all_of + [ + :'GetSmsCampaignAllOf', + :'GetSmsCampaignOverview' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetSmsCampaign` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetSmsCampaign`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'status') + if attributes.key?(:'status') self.status = attributes[:'status'] end - if attributes.has_key?(:'content') + if attributes.key?(:'content') self.content = attributes[:'content'] end - if attributes.has_key?(:'scheduledAt') - self.scheduled_at = attributes[:'scheduledAt'] + if attributes.key?(:'scheduled_at') + self.scheduled_at = attributes[:'scheduled_at'] end - if attributes.has_key?(:'sender') + if attributes.key?(:'sender') self.sender = attributes[:'sender'] end - if attributes.has_key?(:'createdAt') - self.created_at = attributes[:'createdAt'] + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] end - if attributes.has_key?(:'modifiedAt') - self.modified_at = attributes[:'modifiedAt'] + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] end - if attributes.has_key?(:'recipients') + if attributes.key?(:'recipients') self.recipients = attributes[:'recipients'] end - if attributes.has_key?(:'statistics') + if attributes.key?(:'statistics') self.statistics = attributes[:'statistics'] end end @@ -194,7 +221,7 @@ def valid? return false if @id.nil? return false if @name.nil? return false if @status.nil? - status_validator = EnumAttributeValidator.new('String', ['draft', 'sent', 'archive', 'queued', 'suspended', 'inProcess']) + status_validator = EnumAttributeValidator.new('String', ["draft", "sent", "archive", "queued", "suspended", "inProcess"]) return false unless status_validator.valid?(@status) return false if @content.nil? return false if @sender.nil? @@ -208,9 +235,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] status Object to be assigned def status=(status) - validator = EnumAttributeValidator.new('String', ['draft', 'sent', 'archive', 'queued', 'suspended', 'inProcess']) + validator = EnumAttributeValidator.new('String', ["draft", "sent", "archive", "queued", "suspended", "inProcess"]) unless validator.valid?(status) - fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." end @status = status end @@ -239,18 +266,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id, name, status, content, scheduled_at, sender, created_at, modified_at, recipients, statistics].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -258,7 +294,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -270,8 +306,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -280,7 +316,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -301,8 +337,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -324,7 +361,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -349,4 +390,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_sms_campaign_all_of.rb b/lib/sib-api-v3-sdk/models/get_sms_campaign_all_of.rb new file mode 100644 index 0000000..33fda78 --- /dev/null +++ b/lib/sib-api-v3-sdk/models/get_sms_campaign_all_of.rb @@ -0,0 +1,237 @@ +=begin +#SendinBlue API + +#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 | + +The version of the OpenAPI document: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 + +=end + +require 'date' +require 'time' + +module SibApiV3Sdk + class GetSmsCampaignAllOf + attr_accessor :recipients + + attr_accessor :statistics + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'recipients' => :'recipients', + :'statistics' => :'statistics' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'recipients' => :'GetCampaignRecipients', + :'statistics' => :'GetSmsCampaignStats' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetSmsCampaignAllOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetSmsCampaignAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'recipients') + self.recipients = attributes[:'recipients'] + end + + if attributes.key?(:'statistics') + self.statistics = attributes[:'statistics'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @recipients.nil? + invalid_properties.push('invalid value for "recipients", recipients cannot be nil.') + end + + if @statistics.nil? + invalid_properties.push('invalid value for "statistics", statistics cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @recipients.nil? + return false if @statistics.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + recipients == o.recipients && + statistics == o.statistics + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [recipients, statistics].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/sib-api-v3-sdk/models/get_sms_campaign_overview.rb b/lib/sib-api-v3-sdk/models/get_sms_campaign_overview.rb index d102644..c59cf1a 100644 --- a/lib/sib-api-v3-sdk/models/get_sms_campaign_overview.rb +++ b/lib/sib-api-v3-sdk/models/get_sms_campaign_overview.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetSmsCampaignOverview @@ -74,8 +75,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', :'name' => :'String', @@ -88,44 +94,57 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetSmsCampaignOverview` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetSmsCampaignOverview`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'status') + if attributes.key?(:'status') self.status = attributes[:'status'] end - if attributes.has_key?(:'content') + if attributes.key?(:'content') self.content = attributes[:'content'] end - if attributes.has_key?(:'scheduledAt') - self.scheduled_at = attributes[:'scheduledAt'] + if attributes.key?(:'scheduled_at') + self.scheduled_at = attributes[:'scheduled_at'] end - if attributes.has_key?(:'sender') + if attributes.key?(:'sender') self.sender = attributes[:'sender'] end - if attributes.has_key?(:'createdAt') - self.created_at = attributes[:'createdAt'] + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] end - if attributes.has_key?(:'modifiedAt') - self.modified_at = attributes[:'modifiedAt'] + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] end end @@ -170,7 +189,7 @@ def valid? return false if @id.nil? return false if @name.nil? return false if @status.nil? - status_validator = EnumAttributeValidator.new('String', ['draft', 'sent', 'archive', 'queued', 'suspended', 'inProcess']) + status_validator = EnumAttributeValidator.new('String', ["draft", "sent", "archive", "queued", "suspended", "inProcess"]) return false unless status_validator.valid?(@status) return false if @content.nil? return false if @sender.nil? @@ -182,9 +201,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] status Object to be assigned def status=(status) - validator = EnumAttributeValidator.new('String', ['draft', 'sent', 'archive', 'queued', 'suspended', 'inProcess']) + validator = EnumAttributeValidator.new('String', ["draft", "sent", "archive", "queued", "suspended", "inProcess"]) unless validator.valid?(status) - fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." end @status = status end @@ -211,18 +230,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id, name, status, content, scheduled_at, sender, created_at, modified_at].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -230,7 +258,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -242,8 +270,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -252,7 +280,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -273,8 +301,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -296,7 +325,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -321,4 +354,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_sms_campaign_recipients.rb b/lib/sib-api-v3-sdk/models/get_sms_campaign_recipients.rb deleted file mode 100644 index be209a6..0000000 --- a/lib/sib-api-v3-sdk/models/get_sms_campaign_recipients.rb +++ /dev/null @@ -1,175 +0,0 @@ -=begin -#SendinBlue API - -#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 | - -OpenAPI spec version: 3.0.0 -Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 - -=end - -require 'date' - -module SibApiV3Sdk - class GetSmsCampaignRecipients - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.swagger_types - { - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end -end diff --git a/lib/sib-api-v3-sdk/models/get_sms_campaign_stats.rb b/lib/sib-api-v3-sdk/models/get_sms_campaign_stats.rb index 3d7004b..37a02a3 100644 --- a/lib/sib-api-v3-sdk/models/get_sms_campaign_stats.rb +++ b/lib/sib-api-v3-sdk/models/get_sms_campaign_stats.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetSmsCampaignStats @@ -48,8 +49,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'delivered' => :'Integer', :'sent' => :'Integer', @@ -61,39 +67,52 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetSmsCampaignStats` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetSmsCampaignStats`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'delivered') + if attributes.key?(:'delivered') self.delivered = attributes[:'delivered'] end - if attributes.has_key?(:'sent') + if attributes.key?(:'sent') self.sent = attributes[:'sent'] end - if attributes.has_key?(:'processing') + if attributes.key?(:'processing') self.processing = attributes[:'processing'] end - if attributes.has_key?(:'softBounces') - self.soft_bounces = attributes[:'softBounces'] + if attributes.key?(:'soft_bounces') + self.soft_bounces = attributes[:'soft_bounces'] end - if attributes.has_key?(:'hardBounces') - self.hard_bounces = attributes[:'hardBounces'] + if attributes.key?(:'hard_bounces') + self.hard_bounces = attributes[:'hard_bounces'] end - if attributes.has_key?(:'unsubscriptions') + if attributes.key?(:'unsubscriptions') self.unsubscriptions = attributes[:'unsubscriptions'] end - if attributes.has_key?(:'answered') + if attributes.key?(:'answered') self.answered = attributes[:'answered'] end end @@ -167,18 +186,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [delivered, sent, processing, soft_bounces, hard_bounces, unsubscriptions, answered].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -186,7 +214,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -198,8 +226,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -208,7 +236,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -229,8 +257,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -252,7 +281,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -277,4 +310,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_sms_campaigns.rb b/lib/sib-api-v3-sdk/models/get_sms_campaigns.rb index ca631d8..f8ba3be 100644 --- a/lib/sib-api-v3-sdk/models/get_sms_campaigns.rb +++ b/lib/sib-api-v3-sdk/models/get_sms_campaigns.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetSmsCampaigns @@ -27,29 +28,47 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'campaigns' => :'Array', + :'campaigns' => :'Array', :'count' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetSmsCampaigns` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetSmsCampaigns`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'campaigns') + if attributes.key?(:'campaigns') if (value = attributes[:'campaigns']).is_a?(Array) self.campaigns = value end end - if attributes.has_key?(:'count') + if attributes.key?(:'count') self.count = attributes[:'count'] end end @@ -83,18 +102,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [campaigns, count].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -102,7 +130,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -114,8 +142,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -124,7 +152,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -145,8 +173,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -168,7 +197,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -193,4 +226,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_sms_event_report.rb b/lib/sib-api-v3-sdk/models/get_sms_event_report.rb index 66d0929..315d2bb 100644 --- a/lib/sib-api-v3-sdk/models/get_sms_event_report.rb +++ b/lib/sib-api-v3-sdk/models/get_sms_event_report.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetSmsEventReport @@ -23,22 +24,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'events' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetSmsEventReport` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetSmsEventReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'events') + if attributes.key?(:'events') if (value = attributes[:'events']).is_a?(Array) self.events = value end @@ -73,18 +92,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [events].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -92,7 +120,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -104,8 +132,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -114,7 +142,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -135,8 +163,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -158,7 +187,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -183,4 +216,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_sms_event_report_events.rb b/lib/sib-api-v3-sdk/models/get_sms_event_report_events.rb index 21316d8..d703629 100644 --- a/lib/sib-api-v3-sdk/models/get_sms_event_report_events.rb +++ b/lib/sib-api-v3-sdk/models/get_sms_event_report_events.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetSmsEventReportEvents @@ -69,8 +70,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'phone_number' => :'String', :'date' => :'String', @@ -82,39 +88,52 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetSmsEventReportEvents` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetSmsEventReportEvents`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'phoneNumber') - self.phone_number = attributes[:'phoneNumber'] + if attributes.key?(:'phone_number') + self.phone_number = attributes[:'phone_number'] end - if attributes.has_key?(:'date') + if attributes.key?(:'date') self.date = attributes[:'date'] end - if attributes.has_key?(:'messageId') - self.message_id = attributes[:'messageId'] + if attributes.key?(:'message_id') + self.message_id = attributes[:'message_id'] end - if attributes.has_key?(:'event') + if attributes.key?(:'event') self.event = attributes[:'event'] end - if attributes.has_key?(:'reason') + if attributes.key?(:'reason') self.reason = attributes[:'reason'] end - if attributes.has_key?(:'reply') + if attributes.key?(:'reply') self.reply = attributes[:'reply'] end - if attributes.has_key?(:'tag') + if attributes.key?(:'tag') self.tag = attributes[:'tag'] end end @@ -129,7 +148,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - event_validator = EnumAttributeValidator.new('String', ['bounces', 'hardBounces', 'softBounces', 'delivered', 'sent', 'accepted', 'unsubscription', 'replies', 'blocked']) + event_validator = EnumAttributeValidator.new('String', ["bounces", "hardBounces", "softBounces", "delivered", "sent", "accepted", "unsubscription", "replies", "blocked"]) return false unless event_validator.valid?(@event) true end @@ -137,9 +156,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] event Object to be assigned def event=(event) - validator = EnumAttributeValidator.new('String', ['bounces', 'hardBounces', 'softBounces', 'delivered', 'sent', 'accepted', 'unsubscription', 'replies', 'blocked']) + validator = EnumAttributeValidator.new('String', ["bounces", "hardBounces", "softBounces", "delivered", "sent", "accepted", "unsubscription", "replies", "blocked"]) unless validator.valid?(event) - fail ArgumentError, 'invalid value for "event", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"event\", must be one of #{validator.allowable_values}." end @event = event end @@ -165,18 +184,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [phone_number, date, message_id, event, reason, reply, tag].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -184,7 +212,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -196,8 +224,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -206,7 +234,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -227,8 +255,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -250,7 +279,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -275,4 +308,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_smtp_template_overview.rb b/lib/sib-api-v3-sdk/models/get_smtp_template_overview.rb index 0fcc761..f8b7564 100644 --- a/lib/sib-api-v3-sdk/models/get_smtp_template_overview.rb +++ b/lib/sib-api-v3-sdk/models/get_smtp_template_overview.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetSmtpTemplateOverview @@ -71,14 +72,19 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'id' => :'Integer', :'name' => :'String', :'subject' => :'String', - :'is_active' => :'BOOLEAN', - :'test_sent' => :'BOOLEAN', + :'is_active' => :'Boolean', + :'test_sent' => :'Boolean', :'sender' => :'GetSmtpTemplateOverviewSender', :'reply_to' => :'String', :'to_field' => :'String', @@ -86,68 +92,81 @@ def self.swagger_types :'html_content' => :'String', :'created_at' => :'String', :'modified_at' => :'String', - :'doi_template' => :'BOOLEAN' + :'doi_template' => :'Boolean' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetSmtpTemplateOverview` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetSmtpTemplateOverview`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'subject') + if attributes.key?(:'subject') self.subject = attributes[:'subject'] end - if attributes.has_key?(:'isActive') - self.is_active = attributes[:'isActive'] + if attributes.key?(:'is_active') + self.is_active = attributes[:'is_active'] end - if attributes.has_key?(:'testSent') - self.test_sent = attributes[:'testSent'] + if attributes.key?(:'test_sent') + self.test_sent = attributes[:'test_sent'] end - if attributes.has_key?(:'sender') + if attributes.key?(:'sender') self.sender = attributes[:'sender'] end - if attributes.has_key?(:'replyTo') - self.reply_to = attributes[:'replyTo'] + if attributes.key?(:'reply_to') + self.reply_to = attributes[:'reply_to'] end - if attributes.has_key?(:'toField') - self.to_field = attributes[:'toField'] + if attributes.key?(:'to_field') + self.to_field = attributes[:'to_field'] end - if attributes.has_key?(:'tag') + if attributes.key?(:'tag') self.tag = attributes[:'tag'] end - if attributes.has_key?(:'htmlContent') - self.html_content = attributes[:'htmlContent'] + if attributes.key?(:'html_content') + self.html_content = attributes[:'html_content'] end - if attributes.has_key?(:'createdAt') - self.created_at = attributes[:'createdAt'] + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] end - if attributes.has_key?(:'modifiedAt') - self.modified_at = attributes[:'modifiedAt'] + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] end - if attributes.has_key?(:'doiTemplate') - self.doi_template = attributes[:'doiTemplate'] + if attributes.key?(:'doi_template') + self.doi_template = attributes[:'doi_template'] end end @@ -251,18 +270,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [id, name, subject, is_active, test_sent, sender, reply_to, to_field, tag, html_content, created_at, modified_at, doi_template].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -270,7 +298,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -282,8 +310,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -292,7 +320,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -313,8 +341,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -336,7 +365,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -361,4 +394,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_smtp_template_overview_sender.rb b/lib/sib-api-v3-sdk/models/get_smtp_template_overview_sender.rb index a1a794f..eca5c26 100644 --- a/lib/sib-api-v3-sdk/models/get_smtp_template_overview_sender.rb +++ b/lib/sib-api-v3-sdk/models/get_smtp_template_overview_sender.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetSmtpTemplateOverviewSender @@ -32,8 +33,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'String', :'email' => :'String', @@ -41,23 +47,36 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetSmtpTemplateOverviewSender` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetSmtpTemplateOverviewSender`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end end @@ -92,18 +111,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, email, id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -111,7 +139,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -123,8 +151,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -133,7 +161,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,8 +182,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -177,7 +206,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -202,4 +235,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_smtp_templates.rb b/lib/sib-api-v3-sdk/models/get_smtp_templates.rb index d6237fe..f28986a 100644 --- a/lib/sib-api-v3-sdk/models/get_smtp_templates.rb +++ b/lib/sib-api-v3-sdk/models/get_smtp_templates.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetSmtpTemplates @@ -27,27 +28,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'count' => :'Integer', :'templates' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetSmtpTemplates` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetSmtpTemplates`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'count') + if attributes.key?(:'count') self.count = attributes[:'count'] end - if attributes.has_key?(:'templates') + if attributes.key?(:'templates') if (value = attributes[:'templates']).is_a?(Array) self.templates = value end @@ -83,18 +102,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [count, templates].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -102,7 +130,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -114,8 +142,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -124,7 +152,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -145,8 +173,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -168,7 +197,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -193,4 +226,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_sso_token.rb b/lib/sib-api-v3-sdk/models/get_sso_token.rb index 369580f..165b31b 100644 --- a/lib/sib-api-v3-sdk/models/get_sso_token.rb +++ b/lib/sib-api-v3-sdk/models/get_sso_token.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetSsoToken @@ -24,22 +25,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'token' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetSsoToken` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetSsoToken`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'token') + if attributes.key?(:'token') self.token = attributes[:'token'] end end @@ -77,18 +96,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [token].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -96,7 +124,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -108,8 +136,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -118,7 +146,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -139,8 +167,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -162,7 +191,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -187,4 +220,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_stats_by_browser.rb b/lib/sib-api-v3-sdk/models/get_stats_by_browser.rb deleted file mode 100644 index 0155a31..0000000 --- a/lib/sib-api-v3-sdk/models/get_stats_by_browser.rb +++ /dev/null @@ -1,175 +0,0 @@ -=begin -#SendinBlue API - -#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 | - -OpenAPI spec version: 3.0.0 -Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 - -=end - -require 'date' - -module SibApiV3Sdk - class GetStatsByBrowser - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.swagger_types - { - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end -end diff --git a/lib/sib-api-v3-sdk/models/get_stats_by_device.rb b/lib/sib-api-v3-sdk/models/get_stats_by_device.rb index 4fcf777..150a135 100644 --- a/lib/sib-api-v3-sdk/models/get_stats_by_device.rb +++ b/lib/sib-api-v3-sdk/models/get_stats_by_device.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetStatsByDevice @@ -36,8 +37,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'desktop' => :'Hash', :'mobile' => :'Hash', @@ -46,33 +52,46 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetStatsByDevice` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetStatsByDevice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'desktop') + if attributes.key?(:'desktop') if (value = attributes[:'desktop']).is_a?(Hash) self.desktop = value end end - if attributes.has_key?(:'mobile') + if attributes.key?(:'mobile') if (value = attributes[:'mobile']).is_a?(Hash) self.mobile = value end end - if attributes.has_key?(:'tablet') + if attributes.key?(:'tablet') if (value = attributes[:'tablet']).is_a?(Hash) self.tablet = value end end - if attributes.has_key?(:'unknown') + if attributes.key?(:'unknown') if (value = attributes[:'unknown']).is_a?(Hash) self.unknown = value end @@ -110,18 +129,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [desktop, mobile, tablet, unknown].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -129,7 +157,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -141,8 +169,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -151,7 +179,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -172,8 +200,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -195,7 +224,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -220,4 +253,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_stats_by_domain.rb b/lib/sib-api-v3-sdk/models/get_stats_by_domain.rb deleted file mode 100644 index a77794f..0000000 --- a/lib/sib-api-v3-sdk/models/get_stats_by_domain.rb +++ /dev/null @@ -1,175 +0,0 @@ -=begin -#SendinBlue API - -#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 | - -OpenAPI spec version: 3.0.0 -Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 - -=end - -require 'date' - -module SibApiV3Sdk - class GetStatsByDomain - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.swagger_types - { - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - end -end diff --git a/lib/sib-api-v3-sdk/models/get_transac_aggregated_sms_report.rb b/lib/sib-api-v3-sdk/models/get_transac_aggregated_sms_report.rb index 1437a92..030dbf8 100644 --- a/lib/sib-api-v3-sdk/models/get_transac_aggregated_sms_report.rb +++ b/lib/sib-api-v3-sdk/models/get_transac_aggregated_sms_report.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetTransacAggregatedSmsReport @@ -60,8 +61,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'range' => :'String', :'requests' => :'Integer', @@ -76,51 +82,64 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetTransacAggregatedSmsReport` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetTransacAggregatedSmsReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'range') + if attributes.key?(:'range') self.range = attributes[:'range'] end - if attributes.has_key?(:'requests') + if attributes.key?(:'requests') self.requests = attributes[:'requests'] end - if attributes.has_key?(:'delivered') + if attributes.key?(:'delivered') self.delivered = attributes[:'delivered'] end - if attributes.has_key?(:'hardBounces') - self.hard_bounces = attributes[:'hardBounces'] + if attributes.key?(:'hard_bounces') + self.hard_bounces = attributes[:'hard_bounces'] end - if attributes.has_key?(:'softBounces') - self.soft_bounces = attributes[:'softBounces'] + if attributes.key?(:'soft_bounces') + self.soft_bounces = attributes[:'soft_bounces'] end - if attributes.has_key?(:'blocked') + if attributes.key?(:'blocked') self.blocked = attributes[:'blocked'] end - if attributes.has_key?(:'unsubscribed') + if attributes.key?(:'unsubscribed') self.unsubscribed = attributes[:'unsubscribed'] end - if attributes.has_key?(:'replied') + if attributes.key?(:'replied') self.replied = attributes[:'replied'] end - if attributes.has_key?(:'accepted') + if attributes.key?(:'accepted') self.accepted = attributes[:'accepted'] end - if attributes.has_key?(:'rejected') + if attributes.key?(:'rejected') self.rejected = attributes[:'rejected'] end end @@ -162,18 +181,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [range, requests, delivered, hard_bounces, soft_bounces, blocked, unsubscribed, replied, accepted, rejected].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -181,7 +209,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -193,8 +221,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -203,7 +231,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -224,8 +252,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -247,7 +276,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -272,4 +305,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_transac_blocked_contacts.rb b/lib/sib-api-v3-sdk/models/get_transac_blocked_contacts.rb index cbe4187..a57494a 100644 --- a/lib/sib-api-v3-sdk/models/get_transac_blocked_contacts.rb +++ b/lib/sib-api-v3-sdk/models/get_transac_blocked_contacts.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetTransacBlockedContacts @@ -27,27 +28,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'count' => :'Integer', :'contacts' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetTransacBlockedContacts` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetTransacBlockedContacts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'count') + if attributes.key?(:'count') self.count = attributes[:'count'] end - if attributes.has_key?(:'contacts') + if attributes.key?(:'contacts') if (value = attributes[:'contacts']).is_a?(Array) self.contacts = value end @@ -83,18 +102,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [count, contacts].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -102,7 +130,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -114,8 +142,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -124,7 +152,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -145,8 +173,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -168,7 +197,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -193,4 +226,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_transac_blocked_contacts_contacts.rb b/lib/sib-api-v3-sdk/models/get_transac_blocked_contacts_contacts.rb index aee25f9..a38ab2c 100644 --- a/lib/sib-api-v3-sdk/models/get_transac_blocked_contacts_contacts.rb +++ b/lib/sib-api-v3-sdk/models/get_transac_blocked_contacts_contacts.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetTransacBlockedContactsContacts @@ -35,8 +36,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'sender_email' => :'String', @@ -45,28 +51,41 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetTransacBlockedContactsContacts` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetTransacBlockedContactsContacts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'senderEmail') - self.sender_email = attributes[:'senderEmail'] + if attributes.key?(:'sender_email') + self.sender_email = attributes[:'sender_email'] end - if attributes.has_key?(:'reason') + if attributes.key?(:'reason') self.reason = attributes[:'reason'] end - if attributes.has_key?(:'blockedAt') - self.blocked_at = attributes[:'blockedAt'] + if attributes.key?(:'blocked_at') + self.blocked_at = attributes[:'blocked_at'] end end @@ -121,18 +140,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, sender_email, reason, blocked_at].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -140,7 +168,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -152,8 +180,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -162,7 +190,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -183,8 +211,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -206,7 +235,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -231,4 +264,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_transac_blocked_contacts_reason.rb b/lib/sib-api-v3-sdk/models/get_transac_blocked_contacts_reason.rb index 5aafe66..83e8146 100644 --- a/lib/sib-api-v3-sdk/models/get_transac_blocked_contacts_reason.rb +++ b/lib/sib-api-v3-sdk/models/get_transac_blocked_contacts_reason.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Reason for blocking / unsubscribing @@ -51,27 +52,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'code' => :'String', :'message' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetTransacBlockedContactsReason` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetTransacBlockedContactsReason`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'code') + if attributes.key?(:'code') self.code = attributes[:'code'] end - if attributes.has_key?(:'message') + if attributes.key?(:'message') self.message = attributes[:'message'] end end @@ -86,7 +105,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - code_validator = EnumAttributeValidator.new('String', ['unsubscribedViaMA', 'unsubscribedViaEmail', 'adminBlocked', 'unsubscribedViaApi', 'hardBounce', 'contactFlaggedAsSpam']) + code_validator = EnumAttributeValidator.new('String', ["unsubscribedViaMA", "unsubscribedViaEmail", "adminBlocked", "unsubscribedViaApi", "hardBounce", "contactFlaggedAsSpam"]) return false unless code_validator.valid?(@code) true end @@ -94,9 +113,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] code Object to be assigned def code=(code) - validator = EnumAttributeValidator.new('String', ['unsubscribedViaMA', 'unsubscribedViaEmail', 'adminBlocked', 'unsubscribedViaApi', 'hardBounce', 'contactFlaggedAsSpam']) + validator = EnumAttributeValidator.new('String', ["unsubscribedViaMA", "unsubscribedViaEmail", "adminBlocked", "unsubscribedViaApi", "hardBounce", "contactFlaggedAsSpam"]) unless validator.valid?(code) - fail ArgumentError, 'invalid value for "code", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}." end @code = code end @@ -117,18 +136,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [code, message].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -136,7 +164,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -148,8 +176,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -158,7 +186,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -179,8 +207,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -202,7 +231,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -227,4 +260,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_transac_email_content.rb b/lib/sib-api-v3-sdk/models/get_transac_email_content.rb index f6a920b..7bbecdb 100644 --- a/lib/sib-api-v3-sdk/models/get_transac_email_content.rb +++ b/lib/sib-api-v3-sdk/models/get_transac_email_content.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetTransacEmailContent @@ -48,8 +49,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'subject' => :'String', @@ -61,42 +67,55 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetTransacEmailContent` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetTransacEmailContent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'subject') + if attributes.key?(:'subject') self.subject = attributes[:'subject'] end - if attributes.has_key?(:'templateId') - self.template_id = attributes[:'templateId'] + if attributes.key?(:'template_id') + self.template_id = attributes[:'template_id'] end - if attributes.has_key?(:'date') + if attributes.key?(:'date') self.date = attributes[:'date'] end - if attributes.has_key?(:'events') + if attributes.key?(:'events') if (value = attributes[:'events']).is_a?(Array) self.events = value end end - if attributes.has_key?(:'body') + if attributes.key?(:'body') self.body = attributes[:'body'] end - if attributes.has_key?(:'attachmentCount') - self.attachment_count = attributes[:'attachmentCount'] + if attributes.key?(:'attachment_count') + self.attachment_count = attributes[:'attachment_count'] end end @@ -164,18 +183,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, subject, template_id, date, events, body, attachment_count].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -183,7 +211,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -195,8 +223,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -205,7 +233,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -226,8 +254,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -249,7 +278,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -274,4 +307,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_transac_email_content_events.rb b/lib/sib-api-v3-sdk/models/get_transac_email_content_events.rb index 2d8f2a9..5dc7ce8 100644 --- a/lib/sib-api-v3-sdk/models/get_transac_email_content_events.rb +++ b/lib/sib-api-v3-sdk/models/get_transac_email_content_events.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetTransacEmailContentEvents @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'String', :'time' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetTransacEmailContentEvents` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetTransacEmailContentEvents`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'time') + if attributes.key?(:'time') self.time = attributes[:'time'] end end @@ -92,18 +111,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, time].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -111,7 +139,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -123,8 +151,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -133,7 +161,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,8 +182,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -177,7 +206,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -202,4 +235,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_transac_emails_list.rb b/lib/sib-api-v3-sdk/models/get_transac_emails_list.rb index 9908178..2c8112f 100644 --- a/lib/sib-api-v3-sdk/models/get_transac_emails_list.rb +++ b/lib/sib-api-v3-sdk/models/get_transac_emails_list.rb @@ -3,43 +3,71 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetTransacEmailsList + # Total number of transactional emails available on your account according to the passed filter + attr_accessor :count + attr_accessor :transactional_emails # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'count' => :'count', :'transactional_emails' => :'transactionalEmails' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { + :'count' => :'Integer', :'transactional_emails' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetTransacEmailsList` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetTransacEmailsList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'count') + self.count = attributes[:'count'] + end - if attributes.has_key?(:'transactionalEmails') - if (value = attributes[:'transactionalEmails']).is_a?(Array) + if attributes.key?(:'transactional_emails') + if (value = attributes[:'transactional_emails']).is_a?(Array) self.transactional_emails = value end end @@ -63,6 +91,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && + count == o.count && transactional_emails == o.transactional_emails end @@ -73,9 +102,16 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash - [transactional_emails].hash + [count, transactional_emails].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) end # Builds the object from hash @@ -83,8 +119,10 @@ def hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -92,7 +130,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -104,8 +142,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -114,7 +152,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -135,8 +173,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -158,7 +197,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -183,4 +226,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_transac_emails_list_transactional_emails.rb b/lib/sib-api-v3-sdk/models/get_transac_emails_list_transactional_emails.rb index cde0afa..b1271df 100644 --- a/lib/sib-api-v3-sdk/models/get_transac_emails_list_transactional_emails.rb +++ b/lib/sib-api-v3-sdk/models/get_transac_emails_list_transactional_emails.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetTransacEmailsListTransactionalEmails @@ -52,8 +53,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'subject' => :'String', @@ -66,43 +72,56 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetTransacEmailsListTransactionalEmails` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetTransacEmailsListTransactionalEmails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'subject') + if attributes.key?(:'subject') self.subject = attributes[:'subject'] end - if attributes.has_key?(:'templateId') - self.template_id = attributes[:'templateId'] + if attributes.key?(:'template_id') + self.template_id = attributes[:'template_id'] end - if attributes.has_key?(:'messageId') - self.message_id = attributes[:'messageId'] + if attributes.key?(:'message_id') + self.message_id = attributes[:'message_id'] end - if attributes.has_key?(:'uuid') + if attributes.key?(:'uuid') self.uuid = attributes[:'uuid'] end - if attributes.has_key?(:'date') + if attributes.key?(:'date') self.date = attributes[:'date'] end - if attributes.has_key?(:'from') + if attributes.key?(:'from') self.from = attributes[:'from'] end - if attributes.has_key?(:'tags') + if attributes.key?(:'tags') if (value = attributes[:'tags']).is_a?(Array) self.tags = value end @@ -169,18 +188,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, subject, template_id, message_id, uuid, date, from, tags].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -188,7 +216,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -200,8 +228,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -210,7 +238,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -231,8 +259,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -254,7 +283,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -279,4 +312,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_transac_sms_report.rb b/lib/sib-api-v3-sdk/models/get_transac_sms_report.rb index 1ea8e9f..df51ef8 100644 --- a/lib/sib-api-v3-sdk/models/get_transac_sms_report.rb +++ b/lib/sib-api-v3-sdk/models/get_transac_sms_report.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetTransacSmsReport @@ -23,22 +24,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'reports' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetTransacSmsReport` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetTransacSmsReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'reports') + if attributes.key?(:'reports') if (value = attributes[:'reports']).is_a?(Array) self.reports = value end @@ -73,18 +92,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [reports].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -92,7 +120,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -104,8 +132,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -114,7 +142,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -135,8 +163,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -158,7 +187,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -183,4 +216,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_transac_sms_report_reports.rb b/lib/sib-api-v3-sdk/models/get_transac_sms_report_reports.rb index 790a94c..2036efa 100644 --- a/lib/sib-api-v3-sdk/models/get_transac_sms_report_reports.rb +++ b/lib/sib-api-v3-sdk/models/get_transac_sms_report_reports.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetTransacSmsReportReports @@ -60,8 +61,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'date' => :'Date', :'requests' => :'Integer', @@ -76,51 +82,64 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetTransacSmsReportReports` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetTransacSmsReportReports`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'date') + if attributes.key?(:'date') self.date = attributes[:'date'] end - if attributes.has_key?(:'requests') + if attributes.key?(:'requests') self.requests = attributes[:'requests'] end - if attributes.has_key?(:'delivered') + if attributes.key?(:'delivered') self.delivered = attributes[:'delivered'] end - if attributes.has_key?(:'hardBounces') - self.hard_bounces = attributes[:'hardBounces'] + if attributes.key?(:'hard_bounces') + self.hard_bounces = attributes[:'hard_bounces'] end - if attributes.has_key?(:'softBounces') - self.soft_bounces = attributes[:'softBounces'] + if attributes.key?(:'soft_bounces') + self.soft_bounces = attributes[:'soft_bounces'] end - if attributes.has_key?(:'blocked') + if attributes.key?(:'blocked') self.blocked = attributes[:'blocked'] end - if attributes.has_key?(:'unsubscribed') + if attributes.key?(:'unsubscribed') self.unsubscribed = attributes[:'unsubscribed'] end - if attributes.has_key?(:'replied') + if attributes.key?(:'replied') self.replied = attributes[:'replied'] end - if attributes.has_key?(:'accepted') + if attributes.key?(:'accepted') self.accepted = attributes[:'accepted'] end - if attributes.has_key?(:'rejected') + if attributes.key?(:'rejected') self.rejected = attributes[:'rejected'] end end @@ -162,18 +181,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [date, requests, delivered, hard_bounces, soft_bounces, blocked, unsubscribed, replied, accepted, rejected].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -181,7 +209,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -193,8 +221,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -203,7 +231,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -224,8 +252,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -247,7 +276,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -272,4 +305,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_webhook.rb b/lib/sib-api-v3-sdk/models/get_webhook.rb index db35f35..557a4d1 100644 --- a/lib/sib-api-v3-sdk/models/get_webhook.rb +++ b/lib/sib-api-v3-sdk/models/get_webhook.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetWebhook @@ -69,8 +70,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'url' => :'String', :'id' => :'Integer', @@ -82,42 +88,55 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetWebhook` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'url') + if attributes.key?(:'url') self.url = attributes[:'url'] end - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end - if attributes.has_key?(:'description') + if attributes.key?(:'description') self.description = attributes[:'description'] end - if attributes.has_key?(:'events') + if attributes.key?(:'events') if (value = attributes[:'events']).is_a?(Array) self.events = value end end - if attributes.has_key?(:'type') + if attributes.key?(:'type') self.type = attributes[:'type'] end - if attributes.has_key?(:'createdAt') - self.created_at = attributes[:'createdAt'] + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] end - if attributes.has_key?(:'modifiedAt') - self.modified_at = attributes[:'modifiedAt'] + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] end end @@ -164,7 +183,7 @@ def valid? return false if @description.nil? return false if @events.nil? return false if @type.nil? - type_validator = EnumAttributeValidator.new('String', ['marketing', 'transac']) + type_validator = EnumAttributeValidator.new('String', ["marketing", "transac"]) return false unless type_validator.valid?(@type) return false if @created_at.nil? return false if @modified_at.nil? @@ -174,9 +193,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ['marketing', 'transac']) + validator = EnumAttributeValidator.new('String', ["marketing", "transac"]) unless validator.valid?(type) - fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @type = type end @@ -202,18 +221,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [url, id, description, events, type, created_at, modified_at].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -221,7 +249,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -233,8 +261,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -243,7 +271,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -264,8 +292,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -287,7 +316,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -312,4 +345,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/get_webhooks.rb b/lib/sib-api-v3-sdk/models/get_webhooks.rb index 4846895..bd84987 100644 --- a/lib/sib-api-v3-sdk/models/get_webhooks.rb +++ b/lib/sib-api-v3-sdk/models/get_webhooks.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class GetWebhooks @@ -23,22 +24,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'webhooks' => :'Array' + :'webhooks' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::GetWebhooks` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::GetWebhooks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'webhooks') + if attributes.key?(:'webhooks') if (value = attributes[:'webhooks']).is_a?(Array) self.webhooks = value end @@ -78,18 +97,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [webhooks].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -97,7 +125,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -109,8 +137,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -119,7 +147,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -140,8 +168,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -163,7 +192,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -188,4 +221,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/manage_ip.rb b/lib/sib-api-v3-sdk/models/manage_ip.rb index 6f14d85..f002c09 100644 --- a/lib/sib-api-v3-sdk/models/manage_ip.rb +++ b/lib/sib-api-v3-sdk/models/manage_ip.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class ManageIp @@ -24,22 +25,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'ip' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::ManageIp` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::ManageIp`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'ip') + if attributes.key?(:'ip') self.ip = attributes[:'ip'] end end @@ -72,18 +91,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [ip].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -91,7 +119,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -103,8 +131,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -113,7 +141,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -134,8 +162,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -157,7 +186,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -182,4 +215,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/post_contact_info.rb b/lib/sib-api-v3-sdk/models/post_contact_info.rb index 7ac3599..c0253d7 100644 --- a/lib/sib-api-v3-sdk/models/post_contact_info.rb +++ b/lib/sib-api-v3-sdk/models/post_contact_info.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class PostContactInfo @@ -23,22 +24,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'contacts' => :'PostContactInfoContacts' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::PostContactInfo` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::PostContactInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'contacts') + if attributes.key?(:'contacts') self.contacts = attributes[:'contacts'] end end @@ -76,18 +95,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [contacts].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -95,7 +123,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -107,8 +135,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -117,7 +145,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -138,8 +166,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -161,7 +190,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -186,4 +219,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/post_contact_info_contacts.rb b/lib/sib-api-v3-sdk/models/post_contact_info_contacts.rb index 7ecfb78..c77a4ba 100644 --- a/lib/sib-api-v3-sdk/models/post_contact_info_contacts.rb +++ b/lib/sib-api-v3-sdk/models/post_contact_info_contacts.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class PostContactInfoContacts @@ -34,8 +35,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'success' => :'Array', :'failure' => :'Array', @@ -44,32 +50,45 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::PostContactInfoContacts` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::PostContactInfoContacts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'success') + if attributes.key?(:'success') if (value = attributes[:'success']).is_a?(Array) self.success = value end end - if attributes.has_key?(:'failure') + if attributes.key?(:'failure') if (value = attributes[:'failure']).is_a?(Array) self.failure = value end end - if attributes.has_key?(:'total') + if attributes.key?(:'total') self.total = attributes[:'total'] end - if attributes.has_key?(:'processId') - self.process_id = attributes[:'processId'] + if attributes.key?(:'process_id') + self.process_id = attributes[:'process_id'] end end @@ -104,18 +123,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [success, failure, total, process_id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -123,7 +151,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -135,8 +163,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -145,7 +173,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -166,8 +194,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -189,7 +218,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -214,4 +247,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/post_send_failed.rb b/lib/sib-api-v3-sdk/models/post_send_failed.rb index 17afde7..0068231 100644 --- a/lib/sib-api-v3-sdk/models/post_send_failed.rb +++ b/lib/sib-api-v3-sdk/models/post_send_failed.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class PostSendFailed @@ -37,8 +38,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'code' => :'Integer', :'message' => :'String', @@ -48,36 +54,49 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::PostSendFailed` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::PostSendFailed`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'code') + if attributes.key?(:'code') self.code = attributes[:'code'] end - if attributes.has_key?(:'message') + if attributes.key?(:'message') self.message = attributes[:'message'] end - if attributes.has_key?(:'unexistingEmails') - if (value = attributes[:'unexistingEmails']).is_a?(Array) + if attributes.key?(:'unexisting_emails') + if (value = attributes[:'unexisting_emails']).is_a?(Array) self.unexisting_emails = value end end - if attributes.has_key?(:'withoutListEmails') - if (value = attributes[:'withoutListEmails']).is_a?(Array) + if attributes.key?(:'without_list_emails') + if (value = attributes[:'without_list_emails']).is_a?(Array) self.without_list_emails = value end end - if attributes.has_key?(:'blackListedEmails') - if (value = attributes[:'blackListedEmails']).is_a?(Array) + if attributes.key?(:'black_listed_emails') + if (value = attributes[:'black_listed_emails']).is_a?(Array) self.black_listed_emails = value end end @@ -125,18 +144,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [code, message, unexisting_emails, without_list_emails, black_listed_emails].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -144,7 +172,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -156,8 +184,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -166,7 +194,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -187,8 +215,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -210,7 +239,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -235,4 +268,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/post_send_sms_test_failed.rb b/lib/sib-api-v3-sdk/models/post_send_sms_test_failed.rb index dcfad8f..a4ac8ff 100644 --- a/lib/sib-api-v3-sdk/models/post_send_sms_test_failed.rb +++ b/lib/sib-api-v3-sdk/models/post_send_sms_test_failed.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class PostSendSmsTestFailed @@ -34,8 +35,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'code' => :'Integer', :'message' => :'String', @@ -44,30 +50,43 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::PostSendSmsTestFailed` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::PostSendSmsTestFailed`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'code') + if attributes.key?(:'code') self.code = attributes[:'code'] end - if attributes.has_key?(:'message') + if attributes.key?(:'message') self.message = attributes[:'message'] end - if attributes.has_key?(:'unexistingSms') - if (value = attributes[:'unexistingSms']).is_a?(Array) + if attributes.key?(:'unexisting_sms') + if (value = attributes[:'unexisting_sms']).is_a?(Array) self.unexisting_sms = value end end - if attributes.has_key?(:'withoutListSms') - if (value = attributes[:'withoutListSms']).is_a?(Array) + if attributes.key?(:'without_list_sms') + if (value = attributes[:'without_list_sms']).is_a?(Array) self.without_list_sms = value end end @@ -114,18 +133,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [code, message, unexisting_sms, without_list_sms].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -133,7 +161,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -145,8 +173,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -155,7 +183,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -176,8 +204,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -199,7 +228,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -224,4 +257,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/remaining_credit_model.rb b/lib/sib-api-v3-sdk/models/remaining_credit_model.rb index bcec5f7..74bffa8 100644 --- a/lib/sib-api-v3-sdk/models/remaining_credit_model.rb +++ b/lib/sib-api-v3-sdk/models/remaining_credit_model.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class RemainingCreditModel @@ -26,27 +27,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'child' => :'RemainingCreditModelChild', :'reseller' => :'RemainingCreditModelReseller' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::RemainingCreditModel` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::RemainingCreditModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'child') + if attributes.key?(:'child') self.child = attributes[:'child'] end - if attributes.has_key?(:'reseller') + if attributes.key?(:'reseller') self.reseller = attributes[:'reseller'] end end @@ -90,18 +109,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [child, reseller].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -109,7 +137,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -121,8 +149,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -131,7 +159,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -152,8 +180,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -175,7 +204,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -200,4 +233,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/remaining_credit_model_child.rb b/lib/sib-api-v3-sdk/models/remaining_credit_model_child.rb index 1ee9221..12cdaea 100644 --- a/lib/sib-api-v3-sdk/models/remaining_credit_model_child.rb +++ b/lib/sib-api-v3-sdk/models/remaining_credit_model_child.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Credits remaining for child account @@ -29,27 +30,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'sms' => :'Float', :'email' => :'Float' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::RemainingCreditModelChild` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::RemainingCreditModelChild`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'sms') + if attributes.key?(:'sms') self.sms = attributes[:'sms'] end - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end end @@ -93,18 +112,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [sms, email].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -112,7 +140,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -124,8 +152,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -134,7 +162,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -155,8 +183,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -178,7 +207,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -203,4 +236,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/remaining_credit_model_reseller.rb b/lib/sib-api-v3-sdk/models/remaining_credit_model_reseller.rb index 5cc9836..8280780 100644 --- a/lib/sib-api-v3-sdk/models/remaining_credit_model_reseller.rb +++ b/lib/sib-api-v3-sdk/models/remaining_credit_model_reseller.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class RemainingCreditModelReseller @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'sms' => :'Float', :'email' => :'Float' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::RemainingCreditModelReseller` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::RemainingCreditModelReseller`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'sms') + if attributes.key?(:'sms') self.sms = attributes[:'sms'] end - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end end @@ -92,18 +111,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [sms, email].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -111,7 +139,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -123,8 +151,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -133,7 +161,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,8 +182,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -177,7 +206,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -202,4 +235,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/remove_contact_from_list.rb b/lib/sib-api-v3-sdk/models/remove_contact_from_list.rb index aab4ada..4ba728d 100644 --- a/lib/sib-api-v3-sdk/models/remove_contact_from_list.rb +++ b/lib/sib-api-v3-sdk/models/remove_contact_from_list.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class RemoveContactFromList @@ -32,36 +33,54 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'emails' => :'Array', :'ids' => :'Array', - :'all' => :'BOOLEAN' + :'all' => :'Boolean' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::RemoveContactFromList` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::RemoveContactFromList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'emails') + if attributes.key?(:'emails') if (value = attributes[:'emails']).is_a?(Array) self.emails = value end end - if attributes.has_key?(:'ids') + if attributes.key?(:'ids') if (value = attributes[:'ids']).is_a?(Array) self.ids = value end end - if attributes.has_key?(:'all') + if attributes.key?(:'all') self.all = attributes[:'all'] end end @@ -70,15 +89,63 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if !@emails.nil? && @emails.length > 150 + invalid_properties.push('invalid value for "emails", number of items must be less than or equal to 150.') + end + + if !@emails.nil? && @emails.length < 1 + invalid_properties.push('invalid value for "emails", number of items must be greater than or equal to 1.') + end + + if !@ids.nil? && @ids.length > 150 + invalid_properties.push('invalid value for "ids", number of items must be less than or equal to 150.') + end + + if !@ids.nil? && @ids.length < 1 + invalid_properties.push('invalid value for "ids", number of items must be greater than or equal to 1.') + end + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + return false if !@emails.nil? && @emails.length > 150 + return false if !@emails.nil? && @emails.length < 1 + return false if !@ids.nil? && @ids.length > 150 + return false if !@ids.nil? && @ids.length < 1 true end + # Custom attribute writer method with validation + # @param [Object] emails Value to be assigned + def emails=(emails) + if !emails.nil? && emails.length > 150 + fail ArgumentError, 'invalid value for "emails", number of items must be less than or equal to 150.' + end + + if !emails.nil? && emails.length < 1 + fail ArgumentError, 'invalid value for "emails", number of items must be greater than or equal to 1.' + end + + @emails = emails + end + + # Custom attribute writer method with validation + # @param [Object] ids Value to be assigned + def ids=(ids) + if !ids.nil? && ids.length > 150 + fail ArgumentError, 'invalid value for "ids", number of items must be less than or equal to 150.' + end + + if !ids.nil? && ids.length < 1 + fail ArgumentError, 'invalid value for "ids", number of items must be greater than or equal to 1.' + end + + @ids = ids + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -96,18 +163,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [emails, ids, all].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -115,7 +191,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -127,8 +203,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -137,7 +213,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -158,8 +234,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -181,7 +258,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -206,4 +287,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/remove_credits.rb b/lib/sib-api-v3-sdk/models/remove_credits.rb index ff0dbd2..078d325 100644 --- a/lib/sib-api-v3-sdk/models/remove_credits.rb +++ b/lib/sib-api-v3-sdk/models/remove_credits.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class RemoveCredits @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'sms' => :'Integer', :'email' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::RemoveCredits` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::RemoveCredits`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'sms') + if attributes.key?(:'sms') self.sms = attributes[:'sms'] end - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end end @@ -82,18 +101,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [sms, email].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -101,7 +129,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -113,8 +141,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -123,7 +151,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -144,8 +172,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -167,7 +196,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -192,4 +225,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/request_contact_export.rb b/lib/sib-api-v3-sdk/models/request_contact_export.rb index c3d4c22..8253f0f 100644 --- a/lib/sib-api-v3-sdk/models/request_contact_export.rb +++ b/lib/sib-api-v3-sdk/models/request_contact_export.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class RequestContactExport @@ -35,8 +36,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'export_attributes' => :'Array', :'contact_filter' => :'Object', @@ -45,30 +51,43 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::RequestContactExport` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::RequestContactExport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'exportAttributes') - if (value = attributes[:'exportAttributes']).is_a?(Array) + if attributes.key?(:'export_attributes') + if (value = attributes[:'export_attributes']).is_a?(Array) self.export_attributes = value end end - if attributes.has_key?(:'contactFilter') - self.contact_filter = attributes[:'contactFilter'] + if attributes.key?(:'contact_filter') + self.contact_filter = attributes[:'contact_filter'] end - if attributes.has_key?(:'customContactFilter') - self.custom_contact_filter = attributes[:'customContactFilter'] + if attributes.key?(:'custom_contact_filter') + self.custom_contact_filter = attributes[:'custom_contact_filter'] end - if attributes.has_key?(:'notifyUrl') - self.notify_url = attributes[:'notifyUrl'] + if attributes.key?(:'notify_url') + self.notify_url = attributes[:'notify_url'] end end @@ -103,18 +122,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [export_attributes, contact_filter, custom_contact_filter, notify_url].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -122,7 +150,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -134,8 +162,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -144,7 +172,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -165,8 +193,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -188,7 +217,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -213,4 +246,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/request_contact_export_custom_contact_filter.rb b/lib/sib-api-v3-sdk/models/request_contact_export_custom_contact_filter.rb index 67292ff..14d4b9e 100644 --- a/lib/sib-api-v3-sdk/models/request_contact_export_custom_contact_filter.rb +++ b/lib/sib-api-v3-sdk/models/request_contact_export_custom_contact_filter.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Only one of the two filter options (contactFilter or customContactFilter) can be passed in the request. Set the filter for the contacts to be exported. @@ -67,8 +68,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'action_for_contacts' => :'String', :'action_for_email_campaigns' => :'String', @@ -79,36 +85,49 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::RequestContactExportCustomContactFilter` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::RequestContactExportCustomContactFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'actionForContacts') - self.action_for_contacts = attributes[:'actionForContacts'] + if attributes.key?(:'action_for_contacts') + self.action_for_contacts = attributes[:'action_for_contacts'] end - if attributes.has_key?(:'actionForEmailCampaigns') - self.action_for_email_campaigns = attributes[:'actionForEmailCampaigns'] + if attributes.key?(:'action_for_email_campaigns') + self.action_for_email_campaigns = attributes[:'action_for_email_campaigns'] end - if attributes.has_key?(:'actionForSmsCampaigns') - self.action_for_sms_campaigns = attributes[:'actionForSmsCampaigns'] + if attributes.key?(:'action_for_sms_campaigns') + self.action_for_sms_campaigns = attributes[:'action_for_sms_campaigns'] end - if attributes.has_key?(:'listId') - self.list_id = attributes[:'listId'] + if attributes.key?(:'list_id') + self.list_id = attributes[:'list_id'] end - if attributes.has_key?(:'emailCampaignId') - self.email_campaign_id = attributes[:'emailCampaignId'] + if attributes.key?(:'email_campaign_id') + self.email_campaign_id = attributes[:'email_campaign_id'] end - if attributes.has_key?(:'smsCampaignId') - self.sms_campaign_id = attributes[:'smsCampaignId'] + if attributes.key?(:'sms_campaign_id') + self.sms_campaign_id = attributes[:'sms_campaign_id'] end end @@ -122,11 +141,11 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - action_for_contacts_validator = EnumAttributeValidator.new('String', ['allContacts', 'subscribed', 'unsubscribed', 'unsubscribedPerList']) + action_for_contacts_validator = EnumAttributeValidator.new('String', ["allContacts", "subscribed", "unsubscribed", "unsubscribedPerList"]) return false unless action_for_contacts_validator.valid?(@action_for_contacts) - action_for_email_campaigns_validator = EnumAttributeValidator.new('String', ['openers', 'nonOpeners', 'clickers', 'nonClickers', 'unsubscribed', 'hardBounces', 'softBounces']) + action_for_email_campaigns_validator = EnumAttributeValidator.new('String', ["openers", "nonOpeners", "clickers", "nonClickers", "unsubscribed", "hardBounces", "softBounces"]) return false unless action_for_email_campaigns_validator.valid?(@action_for_email_campaigns) - action_for_sms_campaigns_validator = EnumAttributeValidator.new('String', ['hardBounces', 'softBounces', 'unsubscribed']) + action_for_sms_campaigns_validator = EnumAttributeValidator.new('String', ["hardBounces", "softBounces", "unsubscribed"]) return false unless action_for_sms_campaigns_validator.valid?(@action_for_sms_campaigns) true end @@ -134,9 +153,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] action_for_contacts Object to be assigned def action_for_contacts=(action_for_contacts) - validator = EnumAttributeValidator.new('String', ['allContacts', 'subscribed', 'unsubscribed', 'unsubscribedPerList']) + validator = EnumAttributeValidator.new('String', ["allContacts", "subscribed", "unsubscribed", "unsubscribedPerList"]) unless validator.valid?(action_for_contacts) - fail ArgumentError, 'invalid value for "action_for_contacts", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"action_for_contacts\", must be one of #{validator.allowable_values}." end @action_for_contacts = action_for_contacts end @@ -144,9 +163,9 @@ def action_for_contacts=(action_for_contacts) # Custom attribute writer method checking allowed values (enum). # @param [Object] action_for_email_campaigns Object to be assigned def action_for_email_campaigns=(action_for_email_campaigns) - validator = EnumAttributeValidator.new('String', ['openers', 'nonOpeners', 'clickers', 'nonClickers', 'unsubscribed', 'hardBounces', 'softBounces']) + validator = EnumAttributeValidator.new('String', ["openers", "nonOpeners", "clickers", "nonClickers", "unsubscribed", "hardBounces", "softBounces"]) unless validator.valid?(action_for_email_campaigns) - fail ArgumentError, 'invalid value for "action_for_email_campaigns", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"action_for_email_campaigns\", must be one of #{validator.allowable_values}." end @action_for_email_campaigns = action_for_email_campaigns end @@ -154,9 +173,9 @@ def action_for_email_campaigns=(action_for_email_campaigns) # Custom attribute writer method checking allowed values (enum). # @param [Object] action_for_sms_campaigns Object to be assigned def action_for_sms_campaigns=(action_for_sms_campaigns) - validator = EnumAttributeValidator.new('String', ['hardBounces', 'softBounces', 'unsubscribed']) + validator = EnumAttributeValidator.new('String', ["hardBounces", "softBounces", "unsubscribed"]) unless validator.valid?(action_for_sms_campaigns) - fail ArgumentError, 'invalid value for "action_for_sms_campaigns", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"action_for_sms_campaigns\", must be one of #{validator.allowable_values}." end @action_for_sms_campaigns = action_for_sms_campaigns end @@ -181,18 +200,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [action_for_contacts, action_for_email_campaigns, action_for_sms_campaigns, list_id, email_campaign_id, sms_campaign_id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -200,7 +228,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -212,8 +240,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -222,7 +250,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -243,8 +271,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -266,7 +295,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -291,4 +324,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/request_contact_import.rb b/lib/sib-api-v3-sdk/models/request_contact_import.rb index c9ac577..7f92c87 100644 --- a/lib/sib-api-v3-sdk/models/request_contact_import.rb +++ b/lib/sib-api-v3-sdk/models/request_contact_import.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class RequestContactImport @@ -55,71 +56,89 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'file_url' => :'String', :'file_body' => :'String', :'list_ids' => :'Array', :'notify_url' => :'String', :'new_list' => :'RequestContactImportNewList', - :'email_blacklist' => :'BOOLEAN', - :'sms_blacklist' => :'BOOLEAN', - :'update_existing_contacts' => :'BOOLEAN', - :'empty_contacts_attributes' => :'BOOLEAN' + :'email_blacklist' => :'Boolean', + :'sms_blacklist' => :'Boolean', + :'update_existing_contacts' => :'Boolean', + :'empty_contacts_attributes' => :'Boolean' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::RequestContactImport` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::RequestContactImport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'fileUrl') - self.file_url = attributes[:'fileUrl'] + if attributes.key?(:'file_url') + self.file_url = attributes[:'file_url'] end - if attributes.has_key?(:'fileBody') - self.file_body = attributes[:'fileBody'] + if attributes.key?(:'file_body') + self.file_body = attributes[:'file_body'] end - if attributes.has_key?(:'listIds') - if (value = attributes[:'listIds']).is_a?(Array) + if attributes.key?(:'list_ids') + if (value = attributes[:'list_ids']).is_a?(Array) self.list_ids = value end end - if attributes.has_key?(:'notifyUrl') - self.notify_url = attributes[:'notifyUrl'] + if attributes.key?(:'notify_url') + self.notify_url = attributes[:'notify_url'] end - if attributes.has_key?(:'newList') - self.new_list = attributes[:'newList'] + if attributes.key?(:'new_list') + self.new_list = attributes[:'new_list'] end - if attributes.has_key?(:'emailBlacklist') - self.email_blacklist = attributes[:'emailBlacklist'] + if attributes.key?(:'email_blacklist') + self.email_blacklist = attributes[:'email_blacklist'] else self.email_blacklist = false end - if attributes.has_key?(:'smsBlacklist') - self.sms_blacklist = attributes[:'smsBlacklist'] + if attributes.key?(:'sms_blacklist') + self.sms_blacklist = attributes[:'sms_blacklist'] else self.sms_blacklist = false end - if attributes.has_key?(:'updateExistingContacts') - self.update_existing_contacts = attributes[:'updateExistingContacts'] + if attributes.key?(:'update_existing_contacts') + self.update_existing_contacts = attributes[:'update_existing_contacts'] else self.update_existing_contacts = true end - if attributes.has_key?(:'emptyContactsAttributes') - self.empty_contacts_attributes = attributes[:'emptyContactsAttributes'] + if attributes.key?(:'empty_contacts_attributes') + self.empty_contacts_attributes = attributes[:'empty_contacts_attributes'] else self.empty_contacts_attributes = false end @@ -161,18 +180,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [file_url, file_body, list_ids, notify_url, new_list, email_blacklist, sms_blacklist, update_existing_contacts, empty_contacts_attributes].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -180,7 +208,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -192,8 +220,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -202,7 +230,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -223,8 +251,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -246,7 +275,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -271,4 +304,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/request_contact_import_new_list.rb b/lib/sib-api-v3-sdk/models/request_contact_import_new_list.rb index 3fb14ea..d282637 100644 --- a/lib/sib-api-v3-sdk/models/request_contact_import_new_list.rb +++ b/lib/sib-api-v3-sdk/models/request_contact_import_new_list.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # To create a new list and import the contacts into it, pass the listName and an optional folderId. @@ -29,28 +30,46 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'list_name' => :'String', :'folder_id' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::RequestContactImportNewList` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::RequestContactImportNewList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'listName') - self.list_name = attributes[:'listName'] + if attributes.key?(:'list_name') + self.list_name = attributes[:'list_name'] end - if attributes.has_key?(:'folderId') - self.folder_id = attributes[:'folderId'] + if attributes.key?(:'folder_id') + self.folder_id = attributes[:'folder_id'] end end @@ -83,18 +102,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [list_name, folder_id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -102,7 +130,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -114,8 +142,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -124,7 +152,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -145,8 +173,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -168,7 +197,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -193,4 +226,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/request_sms_recipient_export.rb b/lib/sib-api-v3-sdk/models/request_sms_recipient_export.rb index 6debb4d..2611358 100644 --- a/lib/sib-api-v3-sdk/models/request_sms_recipient_export.rb +++ b/lib/sib-api-v3-sdk/models/request_sms_recipient_export.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class RequestSmsRecipientExport @@ -50,28 +51,46 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'notify_url' => :'String', :'recipients_type' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::RequestSmsRecipientExport` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::RequestSmsRecipientExport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'notifyURL') - self.notify_url = attributes[:'notifyURL'] + if attributes.key?(:'notify_url') + self.notify_url = attributes[:'notify_url'] end - if attributes.has_key?(:'recipientsType') - self.recipients_type = attributes[:'recipientsType'] + if attributes.key?(:'recipients_type') + self.recipients_type = attributes[:'recipients_type'] end end @@ -90,7 +109,7 @@ def list_invalid_properties # @return true if the model is valid def valid? return false if @recipients_type.nil? - recipients_type_validator = EnumAttributeValidator.new('String', ['all', 'delivered', 'answered', 'softBounces', 'hardBounces', 'unsubscribed']) + recipients_type_validator = EnumAttributeValidator.new('String', ["all", "delivered", "answered", "softBounces", "hardBounces", "unsubscribed"]) return false unless recipients_type_validator.valid?(@recipients_type) true end @@ -98,9 +117,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] recipients_type Object to be assigned def recipients_type=(recipients_type) - validator = EnumAttributeValidator.new('String', ['all', 'delivered', 'answered', 'softBounces', 'hardBounces', 'unsubscribed']) + validator = EnumAttributeValidator.new('String', ["all", "delivered", "answered", "softBounces", "hardBounces", "unsubscribed"]) unless validator.valid?(recipients_type) - fail ArgumentError, 'invalid value for "recipients_type", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"recipients_type\", must be one of #{validator.allowable_values}." end @recipients_type = recipients_type end @@ -121,18 +140,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [notify_url, recipients_type].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -140,7 +168,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -152,8 +180,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -162,7 +190,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -183,8 +211,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -206,7 +235,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -231,4 +264,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_email.rb b/lib/sib-api-v3-sdk/models/send_email.rb index 2366be6..b5464af 100644 --- a/lib/sib-api-v3-sdk/models/send_email.rb +++ b/lib/sib-api-v3-sdk/models/send_email.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class SendEmail @@ -56,8 +57,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email_to' => :'Array', :'email_bcc' => :'Array', @@ -71,55 +77,68 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendEmail` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendEmail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'emailTo') - if (value = attributes[:'emailTo']).is_a?(Array) + if attributes.key?(:'email_to') + if (value = attributes[:'email_to']).is_a?(Array) self.email_to = value end end - if attributes.has_key?(:'emailBcc') - if (value = attributes[:'emailBcc']).is_a?(Array) + if attributes.key?(:'email_bcc') + if (value = attributes[:'email_bcc']).is_a?(Array) self.email_bcc = value end end - if attributes.has_key?(:'emailCc') - if (value = attributes[:'emailCc']).is_a?(Array) + if attributes.key?(:'email_cc') + if (value = attributes[:'email_cc']).is_a?(Array) self.email_cc = value end end - if attributes.has_key?(:'replyTo') - self.reply_to = attributes[:'replyTo'] + if attributes.key?(:'reply_to') + self.reply_to = attributes[:'reply_to'] end - if attributes.has_key?(:'attachmentUrl') - self.attachment_url = attributes[:'attachmentUrl'] + if attributes.key?(:'attachment_url') + self.attachment_url = attributes[:'attachment_url'] end - if attributes.has_key?(:'attachment') + if attributes.key?(:'attachment') if (value = attributes[:'attachment']).is_a?(Array) self.attachment = value end end - if attributes.has_key?(:'headers') + if attributes.key?(:'headers') self.headers = attributes[:'headers'] end - if attributes.has_key?(:'attributes') + if attributes.key?(:'attributes') self.attributes = attributes[:'attributes'] end - if attributes.has_key?(:'tags') + if attributes.key?(:'tags') if (value = attributes[:'tags']).is_a?(Array) self.tags = value end @@ -167,18 +186,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email_to, email_bcc, email_cc, reply_to, attachment_url, attachment, headers, attributes, tags].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -186,7 +214,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -198,8 +226,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -208,7 +236,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -229,8 +257,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -252,7 +281,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -277,4 +310,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_email_attachment.rb b/lib/sib-api-v3-sdk/models/send_email_attachment.rb index 8f0d9af..0da2ff6 100644 --- a/lib/sib-api-v3-sdk/models/send_email_attachment.rb +++ b/lib/sib-api-v3-sdk/models/send_email_attachment.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class SendEmailAttachment @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'content' => :'String', :'name' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendEmailAttachment` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendEmailAttachment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'content') + if attributes.key?(:'content') self.content = attributes[:'content'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end end @@ -61,8 +80,9 @@ def list_invalid_properties invalid_properties.push('invalid value for "content", content cannot be nil.') end - if @content !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) - invalid_properties.push('invalid value for "content", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.') + pattern = Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) + if @content !~ pattern + invalid_properties.push("invalid value for \"content\", must conform to the pattern #{pattern}.") end if @name.nil? @@ -88,8 +108,9 @@ def content=(content) fail ArgumentError, 'content cannot be nil' end - if content !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) - fail ArgumentError, 'invalid value for "content", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.' + pattern = Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) + if content !~ pattern + fail ArgumentError, "invalid value for \"content\", must conform to the pattern #{pattern}." end @content = content @@ -111,18 +132,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [content, name].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -130,7 +160,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -142,8 +172,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -152,7 +182,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -173,8 +203,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -196,7 +227,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -221,4 +256,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_report.rb b/lib/sib-api-v3-sdk/models/send_report.rb index e562c2f..f5c67a2 100644 --- a/lib/sib-api-v3-sdk/models/send_report.rb +++ b/lib/sib-api-v3-sdk/models/send_report.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class SendReport @@ -49,29 +50,47 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'language' => :'String', :'email' => :'SendReportEmail' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendReport` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'language') + if attributes.key?(:'language') self.language = attributes[:'language'] else self.language = 'fr' end - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end end @@ -90,7 +109,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - language_validator = EnumAttributeValidator.new('String', ['fr', 'es', 'pt', 'it', 'de', 'en']) + language_validator = EnumAttributeValidator.new('String', ["fr", "es", "pt", "it", "de", "en"]) return false unless language_validator.valid?(@language) return false if @email.nil? true @@ -99,9 +118,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] language Object to be assigned def language=(language) - validator = EnumAttributeValidator.new('String', ['fr', 'es', 'pt', 'it', 'de', 'en']) + validator = EnumAttributeValidator.new('String', ["fr", "es", "pt", "it", "de", "en"]) unless validator.valid?(language) - fail ArgumentError, 'invalid value for "language", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"language\", must be one of #{validator.allowable_values}." end @language = language end @@ -122,18 +141,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [language, email].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -141,7 +169,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -153,8 +181,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -163,7 +191,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -184,8 +212,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -207,7 +236,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -232,4 +265,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_report_email.rb b/lib/sib-api-v3-sdk/models/send_report_email.rb index 1a1caae..b633b41 100644 --- a/lib/sib-api-v3-sdk/models/send_report_email.rb +++ b/lib/sib-api-v3-sdk/models/send_report_email.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Custom attributes for the report email. @@ -29,29 +30,47 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'to' => :'Array', :'body' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendReportEmail` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendReportEmail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'to') + if attributes.key?(:'to') if (value = attributes[:'to']).is_a?(Array) self.to = value end end - if attributes.has_key?(:'body') + if attributes.key?(:'body') self.body = attributes[:'body'] end end @@ -95,18 +114,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [to, body].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -114,7 +142,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -126,8 +154,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -136,7 +164,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -157,8 +185,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -180,7 +209,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -205,4 +238,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_sms.rb b/lib/sib-api-v3-sdk/models/send_sms.rb index 29173ca..9d693ab 100644 --- a/lib/sib-api-v3-sdk/models/send_sms.rb +++ b/lib/sib-api-v3-sdk/models/send_sms.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class SendSms @@ -38,8 +39,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'reference' => :'String', :'message_id' => :'Integer', @@ -49,32 +55,45 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendSms` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendSms`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'reference') + if attributes.key?(:'reference') self.reference = attributes[:'reference'] end - if attributes.has_key?(:'messageId') - self.message_id = attributes[:'messageId'] + if attributes.key?(:'message_id') + self.message_id = attributes[:'message_id'] end - if attributes.has_key?(:'smsCount') - self.sms_count = attributes[:'smsCount'] + if attributes.key?(:'sms_count') + self.sms_count = attributes[:'sms_count'] end - if attributes.has_key?(:'usedCredits') - self.used_credits = attributes[:'usedCredits'] + if attributes.key?(:'used_credits') + self.used_credits = attributes[:'used_credits'] end - if attributes.has_key?(:'remainingCredits') - self.remaining_credits = attributes[:'remainingCredits'] + if attributes.key?(:'remaining_credits') + self.remaining_credits = attributes[:'remaining_credits'] end end @@ -120,18 +139,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [reference, message_id, sms_count, used_credits, remaining_credits].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -139,7 +167,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -151,8 +179,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -161,7 +189,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -182,8 +210,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -205,7 +234,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -230,4 +263,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_smtp_email.rb b/lib/sib-api-v3-sdk/models/send_smtp_email.rb index efa595f..205deea 100644 --- a/lib/sib-api-v3-sdk/models/send_smtp_email.rb +++ b/lib/sib-api-v3-sdk/models/send_smtp_email.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class SendSmtpEmail @@ -74,8 +75,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'sender' => :'SendSmtpEmailSender', :'to' => :'Array', @@ -94,77 +100,90 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendSmtpEmail` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendSmtpEmail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'sender') + if attributes.key?(:'sender') self.sender = attributes[:'sender'] end - if attributes.has_key?(:'to') + if attributes.key?(:'to') if (value = attributes[:'to']).is_a?(Array) self.to = value end end - if attributes.has_key?(:'bcc') + if attributes.key?(:'bcc') if (value = attributes[:'bcc']).is_a?(Array) self.bcc = value end end - if attributes.has_key?(:'cc') + if attributes.key?(:'cc') if (value = attributes[:'cc']).is_a?(Array) self.cc = value end end - if attributes.has_key?(:'htmlContent') - self.html_content = attributes[:'htmlContent'] + if attributes.key?(:'html_content') + self.html_content = attributes[:'html_content'] end - if attributes.has_key?(:'textContent') - self.text_content = attributes[:'textContent'] + if attributes.key?(:'text_content') + self.text_content = attributes[:'text_content'] end - if attributes.has_key?(:'subject') + if attributes.key?(:'subject') self.subject = attributes[:'subject'] end - if attributes.has_key?(:'replyTo') - self.reply_to = attributes[:'replyTo'] + if attributes.key?(:'reply_to') + self.reply_to = attributes[:'reply_to'] end - if attributes.has_key?(:'attachment') + if attributes.key?(:'attachment') if (value = attributes[:'attachment']).is_a?(Array) self.attachment = value end end - if attributes.has_key?(:'headers') + if attributes.key?(:'headers') self.headers = attributes[:'headers'] end - if attributes.has_key?(:'templateId') - self.template_id = attributes[:'templateId'] + if attributes.key?(:'template_id') + self.template_id = attributes[:'template_id'] end - if attributes.has_key?(:'params') + if attributes.key?(:'params') self.params = attributes[:'params'] end - if attributes.has_key?(:'messageVersions') - if (value = attributes[:'messageVersions']).is_a?(Array) + if attributes.key?(:'message_versions') + if (value = attributes[:'message_versions']).is_a?(Array) self.message_versions = value end end - if attributes.has_key?(:'tags') + if attributes.key?(:'tags') if (value = attributes[:'tags']).is_a?(Array) self.tags = value end @@ -212,18 +231,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [sender, to, bcc, cc, html_content, text_content, subject, reply_to, attachment, headers, template_id, params, message_versions, tags].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -231,7 +259,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -243,8 +271,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -253,7 +281,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -274,8 +302,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -297,7 +326,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -322,4 +355,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_smtp_email_attachment.rb b/lib/sib-api-v3-sdk/models/send_smtp_email_attachment.rb index 93a3cc7..2ec8319 100644 --- a/lib/sib-api-v3-sdk/models/send_smtp_email_attachment.rb +++ b/lib/sib-api-v3-sdk/models/send_smtp_email_attachment.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class SendSmtpEmailAttachment @@ -32,8 +33,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'url' => :'String', :'content' => :'String', @@ -41,23 +47,36 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendSmtpEmailAttachment` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendSmtpEmailAttachment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'url') + if attributes.key?(:'url') self.url = attributes[:'url'] end - if attributes.has_key?(:'content') + if attributes.key?(:'content') self.content = attributes[:'content'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end end @@ -66,8 +85,9 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new - if !@content.nil? && @content !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) - invalid_properties.push('invalid value for "content", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.') + pattern = Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) + if !@content.nil? && @content !~ pattern + invalid_properties.push("invalid value for \"content\", must conform to the pattern #{pattern}.") end invalid_properties @@ -83,8 +103,9 @@ def valid? # Custom attribute writer method with validation # @param [Object] content Value to be assigned def content=(content) - if !content.nil? && content !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) - fail ArgumentError, 'invalid value for "content", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.' + pattern = Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) + if !content.nil? && content !~ pattern + fail ArgumentError, "invalid value for \"content\", must conform to the pattern #{pattern}." end @content = content @@ -107,18 +128,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [url, content, name].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -126,7 +156,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -138,8 +168,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -148,7 +178,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -169,8 +199,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -192,7 +223,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -217,4 +252,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_smtp_email_bcc.rb b/lib/sib-api-v3-sdk/models/send_smtp_email_bcc.rb index e5ef0c4..68dfcda 100644 --- a/lib/sib-api-v3-sdk/models/send_smtp_email_bcc.rb +++ b/lib/sib-api-v3-sdk/models/send_smtp_email_bcc.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class SendSmtpEmailBcc @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'name' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendSmtpEmailBcc` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendSmtpEmailBcc`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end end @@ -87,18 +106,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, name].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -106,7 +134,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -118,8 +146,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -128,7 +156,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -149,8 +177,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -172,7 +201,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -197,4 +230,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_smtp_email_cc.rb b/lib/sib-api-v3-sdk/models/send_smtp_email_cc.rb index a9be5b1..f92bac9 100644 --- a/lib/sib-api-v3-sdk/models/send_smtp_email_cc.rb +++ b/lib/sib-api-v3-sdk/models/send_smtp_email_cc.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class SendSmtpEmailCc @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'name' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendSmtpEmailCc` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendSmtpEmailCc`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end end @@ -87,18 +106,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, name].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -106,7 +134,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -118,8 +146,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -128,7 +156,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -149,8 +177,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -172,7 +201,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -197,4 +230,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_smtp_email_message_versions.rb b/lib/sib-api-v3-sdk/models/send_smtp_email_message_versions.rb index c5a1137..2ef8faa 100644 --- a/lib/sib-api-v3-sdk/models/send_smtp_email_message_versions.rb +++ b/lib/sib-api-v3-sdk/models/send_smtp_email_message_versions.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class SendSmtpEmailMessageVersions @@ -43,8 +44,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'to' => :'Array', :'params' => :'Hash', @@ -55,43 +61,56 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendSmtpEmailMessageVersions` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendSmtpEmailMessageVersions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'to') + if attributes.key?(:'to') if (value = attributes[:'to']).is_a?(Array) self.to = value end end - if attributes.has_key?(:'params') + if attributes.key?(:'params') if (value = attributes[:'params']).is_a?(Hash) self.params = value end end - if attributes.has_key?(:'bcc') + if attributes.key?(:'bcc') if (value = attributes[:'bcc']).is_a?(Array) self.bcc = value end end - if attributes.has_key?(:'cc') + if attributes.key?(:'cc') if (value = attributes[:'cc']).is_a?(Array) self.cc = value end end - if attributes.has_key?(:'replyTo') - self.reply_to = attributes[:'replyTo'] + if attributes.key?(:'reply_to') + self.reply_to = attributes[:'reply_to'] end - if attributes.has_key?(:'subject') + if attributes.key?(:'subject') self.subject = attributes[:'subject'] end end @@ -134,18 +153,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [to, params, bcc, cc, reply_to, subject].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -153,7 +181,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -165,8 +193,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -175,7 +203,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -196,8 +224,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -219,7 +248,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -244,4 +277,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_smtp_email_reply_to.rb b/lib/sib-api-v3-sdk/models/send_smtp_email_reply_to.rb index df9eaf1..8943d2e 100644 --- a/lib/sib-api-v3-sdk/models/send_smtp_email_reply_to.rb +++ b/lib/sib-api-v3-sdk/models/send_smtp_email_reply_to.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Email (required), along with name (optional), on which transactional mail recipients will be able to reply back. For example, {\"email\":\"ann6533@example.com\", \"name\":\"Ann\"}. @@ -29,27 +30,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'name' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendSmtpEmailReplyTo` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendSmtpEmailReplyTo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end end @@ -88,18 +107,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, name].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -107,7 +135,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -119,8 +147,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -129,7 +157,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -150,8 +178,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -173,7 +202,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -198,4 +231,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_smtp_email_reply_to_1.rb b/lib/sib-api-v3-sdk/models/send_smtp_email_reply_to1.rb similarity index 74% rename from lib/sib-api-v3-sdk/models/send_smtp_email_reply_to_1.rb rename to lib/sib-api-v3-sdk/models/send_smtp_email_reply_to1.rb index 85f97ca..e73eefa 100644 --- a/lib/sib-api-v3-sdk/models/send_smtp_email_reply_to_1.rb +++ b/lib/sib-api-v3-sdk/models/send_smtp_email_reply_to1.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Email (required), along with name (optional), on which transactional mail recipients will be able to reply back. For example, {\"email\":\"ann6533@example.com\", \"name\":\"Ann\"} @@ -29,27 +30,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'name' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendSmtpEmailReplyTo1` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendSmtpEmailReplyTo1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end end @@ -88,18 +107,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, name].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -107,7 +135,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -119,8 +147,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -129,7 +157,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -150,8 +178,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -173,7 +202,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -198,4 +231,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_smtp_email_sender.rb b/lib/sib-api-v3-sdk/models/send_smtp_email_sender.rb index e0d1b1d..182ecbd 100644 --- a/lib/sib-api-v3-sdk/models/send_smtp_email_sender.rb +++ b/lib/sib-api-v3-sdk/models/send_smtp_email_sender.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Mandatory if `templateId` is not passed. Pass `name` (optional) and `email` OR `id` of sender from which emails will be sent. `name` will be ignored if passed along with sender `id`. For example, {\"name\":\"Mary from MyShop\", \"email\":\"no-reply@myshop.com\"} or {\"id\":2} @@ -33,8 +34,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'String', :'email' => :'String', @@ -42,23 +48,36 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendSmtpEmailSender` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendSmtpEmailSender`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end end @@ -93,18 +112,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, email, id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -112,7 +140,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -124,8 +152,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -134,7 +162,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -155,8 +183,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -178,7 +207,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -203,4 +236,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_smtp_email_to.rb b/lib/sib-api-v3-sdk/models/send_smtp_email_to.rb index addb9de..970b8c2 100644 --- a/lib/sib-api-v3-sdk/models/send_smtp_email_to.rb +++ b/lib/sib-api-v3-sdk/models/send_smtp_email_to.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class SendSmtpEmailTo @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'name' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendSmtpEmailTo` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendSmtpEmailTo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end end @@ -87,18 +106,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, name].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -106,7 +134,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -118,8 +146,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -128,7 +156,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -149,8 +177,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -172,7 +201,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -197,4 +230,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_smtp_email_to_1.rb b/lib/sib-api-v3-sdk/models/send_smtp_email_to1.rb similarity index 74% rename from lib/sib-api-v3-sdk/models/send_smtp_email_to_1.rb rename to lib/sib-api-v3-sdk/models/send_smtp_email_to1.rb index 666cb88..bb0f644 100644 --- a/lib/sib-api-v3-sdk/models/send_smtp_email_to_1.rb +++ b/lib/sib-api-v3-sdk/models/send_smtp_email_to1.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class SendSmtpEmailTo1 @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'name' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendSmtpEmailTo1` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendSmtpEmailTo1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end end @@ -87,18 +106,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, name].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -106,7 +134,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -118,8 +146,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -128,7 +156,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -149,8 +177,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -172,7 +201,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -197,4 +230,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_template_email.rb b/lib/sib-api-v3-sdk/models/send_template_email.rb index 2f6eca6..2164b22 100644 --- a/lib/sib-api-v3-sdk/models/send_template_email.rb +++ b/lib/sib-api-v3-sdk/models/send_template_email.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class SendTemplateEmail @@ -24,23 +25,41 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'message_id' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendTemplateEmail` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendTemplateEmail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'messageId') - self.message_id = attributes[:'messageId'] + if attributes.key?(:'message_id') + self.message_id = attributes[:'message_id'] end end @@ -77,18 +96,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [message_id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -96,7 +124,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -108,8 +136,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -118,7 +146,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -139,8 +167,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -162,7 +191,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -187,4 +220,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_test_email.rb b/lib/sib-api-v3-sdk/models/send_test_email.rb index a7f8090..7d2b7a4 100644 --- a/lib/sib-api-v3-sdk/models/send_test_email.rb +++ b/lib/sib-api-v3-sdk/models/send_test_email.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class SendTestEmail @@ -24,23 +25,41 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email_to' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendTestEmail` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendTestEmail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'emailTo') - if (value = attributes[:'emailTo']).is_a?(Array) + if attributes.key?(:'email_to') + if (value = attributes[:'email_to']).is_a?(Array) self.email_to = value end end @@ -74,18 +93,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email_to].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -93,7 +121,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -105,8 +133,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -115,7 +143,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -136,8 +164,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -159,7 +188,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -184,4 +217,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_test_sms.rb b/lib/sib-api-v3-sdk/models/send_test_sms.rb index d1b08a8..9783b03 100644 --- a/lib/sib-api-v3-sdk/models/send_test_sms.rb +++ b/lib/sib-api-v3-sdk/models/send_test_sms.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class SendTestSms @@ -24,23 +25,41 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'phone_number' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendTestSms` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendTestSms`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'phoneNumber') - self.phone_number = attributes[:'phoneNumber'] + if attributes.key?(:'phone_number') + self.phone_number = attributes[:'phone_number'] end end @@ -72,18 +91,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [phone_number].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -91,7 +119,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -103,8 +131,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -113,7 +141,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -134,8 +162,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -157,7 +186,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -182,4 +215,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/send_transac_sms.rb b/lib/sib-api-v3-sdk/models/send_transac_sms.rb index e2715f2..c9da3f2 100644 --- a/lib/sib-api-v3-sdk/models/send_transac_sms.rb +++ b/lib/sib-api-v3-sdk/models/send_transac_sms.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class SendTransacSms @@ -66,8 +67,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'sender' => :'String', :'recipient' => :'String', @@ -78,38 +84,51 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::SendTransacSms` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::SendTransacSms`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'sender') + if attributes.key?(:'sender') self.sender = attributes[:'sender'] end - if attributes.has_key?(:'recipient') + if attributes.key?(:'recipient') self.recipient = attributes[:'recipient'] end - if attributes.has_key?(:'content') + if attributes.key?(:'content') self.content = attributes[:'content'] end - if attributes.has_key?(:'type') + if attributes.key?(:'type') self.type = attributes[:'type'] else self.type = 'transactional' end - if attributes.has_key?(:'tag') + if attributes.key?(:'tag') self.tag = attributes[:'tag'] end - if attributes.has_key?(:'webUrl') - self.web_url = attributes[:'webUrl'] + if attributes.key?(:'web_url') + self.web_url = attributes[:'web_url'] end end @@ -143,7 +162,7 @@ def valid? return false if @sender.to_s.length > 15 return false if @recipient.nil? return false if @content.nil? - type_validator = EnumAttributeValidator.new('String', ['transactional', 'marketing']) + type_validator = EnumAttributeValidator.new('String', ["transactional", "marketing"]) return false unless type_validator.valid?(@type) true end @@ -165,9 +184,9 @@ def sender=(sender) # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('String', ['transactional', 'marketing']) + validator = EnumAttributeValidator.new('String', ["transactional", "marketing"]) unless validator.valid?(type) - fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." end @type = type end @@ -192,18 +211,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [sender, recipient, content, type, tag, web_url].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -211,7 +239,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -223,8 +251,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -233,7 +261,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -254,8 +282,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -277,7 +306,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -302,4 +335,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/update_attribute.rb b/lib/sib-api-v3-sdk/models/update_attribute.rb index 39d3894..453f430 100644 --- a/lib/sib-api-v3-sdk/models/update_attribute.rb +++ b/lib/sib-api-v3-sdk/models/update_attribute.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class UpdateAttribute @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'value' => :'String', :'enumeration' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::UpdateAttribute` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::UpdateAttribute`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'value') + if attributes.key?(:'value') self.value = attributes[:'value'] end - if attributes.has_key?(:'enumeration') + if attributes.key?(:'enumeration') if (value = attributes[:'enumeration']).is_a?(Array) self.enumeration = value end @@ -84,18 +103,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [value, enumeration].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -103,7 +131,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -115,8 +143,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -125,7 +153,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -146,8 +174,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -169,7 +198,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -194,4 +227,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/update_attribute_enumeration.rb b/lib/sib-api-v3-sdk/models/update_attribute_enumeration.rb index 09244ca..8bf9f64 100644 --- a/lib/sib-api-v3-sdk/models/update_attribute_enumeration.rb +++ b/lib/sib-api-v3-sdk/models/update_attribute_enumeration.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class UpdateAttributeEnumeration @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'value' => :'Integer', :'label' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::UpdateAttributeEnumeration` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::UpdateAttributeEnumeration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'value') + if attributes.key?(:'value') self.value = attributes[:'value'] end - if attributes.has_key?(:'label') + if attributes.key?(:'label') self.label = attributes[:'label'] end end @@ -92,18 +111,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [value, label].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -111,7 +139,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -123,8 +151,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -133,7 +161,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,8 +182,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -177,7 +206,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -202,4 +235,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/update_campaign_status.rb b/lib/sib-api-v3-sdk/models/update_campaign_status.rb index 12ea14c..5ba0932 100644 --- a/lib/sib-api-v3-sdk/models/update_campaign_status.rb +++ b/lib/sib-api-v3-sdk/models/update_campaign_status.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Status of the campaign @@ -47,22 +48,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'status' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::UpdateCampaignStatus` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::UpdateCampaignStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'status') + if attributes.key?(:'status') self.status = attributes[:'status'] end end @@ -77,7 +96,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - status_validator = EnumAttributeValidator.new('String', ['suspended', 'archive', 'darchive', 'sent', 'queued', 'replicate', 'replicateTemplate', 'draft']) + status_validator = EnumAttributeValidator.new('String', ["suspended", "archive", "darchive", "sent", "queued", "replicate", "replicateTemplate", "draft"]) return false unless status_validator.valid?(@status) true end @@ -85,9 +104,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] status Object to be assigned def status=(status) - validator = EnumAttributeValidator.new('String', ['suspended', 'archive', 'darchive', 'sent', 'queued', 'replicate', 'replicateTemplate', 'draft']) + validator = EnumAttributeValidator.new('String', ["suspended", "archive", "darchive", "sent", "queued", "replicate", "replicateTemplate", "draft"]) unless validator.valid?(status) - fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." end @status = status end @@ -107,18 +126,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [status].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -126,7 +154,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -138,8 +166,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -148,7 +176,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -169,8 +197,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -192,7 +221,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -217,4 +250,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/update_child.rb b/lib/sib-api-v3-sdk/models/update_child.rb index 0b94732..225affd 100644 --- a/lib/sib-api-v3-sdk/models/update_child.rb +++ b/lib/sib-api-v3-sdk/models/update_child.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class UpdateChild @@ -40,8 +41,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'email' => :'String', :'first_name' => :'String', @@ -51,31 +57,44 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::UpdateChild` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::UpdateChild`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'firstName') - self.first_name = attributes[:'firstName'] + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] end - if attributes.has_key?(:'lastName') - self.last_name = attributes[:'lastName'] + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] end - if attributes.has_key?(:'companyName') - self.company_name = attributes[:'companyName'] + if attributes.key?(:'company_name') + self.company_name = attributes[:'company_name'] end - if attributes.has_key?(:'password') + if attributes.key?(:'password') self.password = attributes[:'password'] end end @@ -112,18 +131,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [email, first_name, last_name, company_name, password].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -131,7 +159,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -143,8 +171,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -153,7 +181,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -174,8 +202,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -197,7 +226,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -222,4 +255,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/update_child_account_status.rb b/lib/sib-api-v3-sdk/models/update_child_account_status.rb index b894eba..c83bf08 100644 --- a/lib/sib-api-v3-sdk/models/update_child_account_status.rb +++ b/lib/sib-api-v3-sdk/models/update_child_account_status.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class UpdateChildAccountStatus @@ -36,38 +37,56 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { - :'transactional_email' => :'BOOLEAN', - :'transactional_sms' => :'BOOLEAN', - :'marketing_automation' => :'BOOLEAN', - :'sms_campaign' => :'BOOLEAN' + :'transactional_email' => :'Boolean', + :'transactional_sms' => :'Boolean', + :'marketing_automation' => :'Boolean', + :'sms_campaign' => :'Boolean' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::UpdateChildAccountStatus` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::UpdateChildAccountStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'transactionalEmail') - self.transactional_email = attributes[:'transactionalEmail'] + if attributes.key?(:'transactional_email') + self.transactional_email = attributes[:'transactional_email'] end - if attributes.has_key?(:'transactionalSms') - self.transactional_sms = attributes[:'transactionalSms'] + if attributes.key?(:'transactional_sms') + self.transactional_sms = attributes[:'transactional_sms'] end - if attributes.has_key?(:'marketingAutomation') - self.marketing_automation = attributes[:'marketingAutomation'] + if attributes.key?(:'marketing_automation') + self.marketing_automation = attributes[:'marketing_automation'] end - if attributes.has_key?(:'smsCampaign') - self.sms_campaign = attributes[:'smsCampaign'] + if attributes.key?(:'sms_campaign') + self.sms_campaign = attributes[:'sms_campaign'] end end @@ -102,18 +121,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [transactional_email, transactional_sms, marketing_automation, sms_campaign].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -121,7 +149,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -133,8 +161,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -143,7 +171,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -164,8 +192,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -187,7 +216,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -212,4 +245,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/update_child_domain.rb b/lib/sib-api-v3-sdk/models/update_child_domain.rb index d9e437f..2ccbf13 100644 --- a/lib/sib-api-v3-sdk/models/update_child_domain.rb +++ b/lib/sib-api-v3-sdk/models/update_child_domain.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class UpdateChildDomain @@ -24,22 +25,40 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'domain' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::UpdateChildDomain` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::UpdateChildDomain`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'domain') + if attributes.key?(:'domain') self.domain = attributes[:'domain'] end end @@ -72,18 +91,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [domain].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -91,7 +119,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -103,8 +131,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -113,7 +141,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -134,8 +162,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -157,7 +186,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -182,4 +215,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/update_contact.rb b/lib/sib-api-v3-sdk/models/update_contact.rb index d99655a..82c7ee2 100644 --- a/lib/sib-api-v3-sdk/models/update_contact.rb +++ b/lib/sib-api-v3-sdk/models/update_contact.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class UpdateContact @@ -44,52 +45,70 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'attributes' => :'Object', - :'email_blacklisted' => :'BOOLEAN', - :'sms_blacklisted' => :'BOOLEAN', + :'email_blacklisted' => :'Boolean', + :'sms_blacklisted' => :'Boolean', :'list_ids' => :'Array', :'unlink_list_ids' => :'Array', :'smtp_blacklist_sender' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::UpdateContact` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::UpdateContact`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'attributes') + if attributes.key?(:'attributes') self.attributes = attributes[:'attributes'] end - if attributes.has_key?(:'emailBlacklisted') - self.email_blacklisted = attributes[:'emailBlacklisted'] + if attributes.key?(:'email_blacklisted') + self.email_blacklisted = attributes[:'email_blacklisted'] end - if attributes.has_key?(:'smsBlacklisted') - self.sms_blacklisted = attributes[:'smsBlacklisted'] + if attributes.key?(:'sms_blacklisted') + self.sms_blacklisted = attributes[:'sms_blacklisted'] end - if attributes.has_key?(:'listIds') - if (value = attributes[:'listIds']).is_a?(Array) + if attributes.key?(:'list_ids') + if (value = attributes[:'list_ids']).is_a?(Array) self.list_ids = value end end - if attributes.has_key?(:'unlinkListIds') - if (value = attributes[:'unlinkListIds']).is_a?(Array) + if attributes.key?(:'unlink_list_ids') + if (value = attributes[:'unlink_list_ids']).is_a?(Array) self.unlink_list_ids = value end end - if attributes.has_key?(:'smtpBlacklistSender') - if (value = attributes[:'smtpBlacklistSender']).is_a?(Array) + if attributes.key?(:'smtp_blacklist_sender') + if (value = attributes[:'smtp_blacklist_sender']).is_a?(Array) self.smtp_blacklist_sender = value end end @@ -128,18 +147,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [attributes, email_blacklisted, sms_blacklisted, list_ids, unlink_list_ids, smtp_blacklist_sender].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -147,7 +175,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -159,8 +187,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -169,7 +197,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -190,8 +218,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -213,7 +242,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -238,4 +271,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/update_email_campaign.rb b/lib/sib-api-v3-sdk/models/update_email_campaign.rb index a8bee59..4e356a0 100644 --- a/lib/sib-api-v3-sdk/models/update_email_campaign.rb +++ b/lib/sib-api-v3-sdk/models/update_email_campaign.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class UpdateEmailCampaign @@ -152,8 +153,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'tag' => :'String', :'sender' => :'UpdateEmailCampaignSender', @@ -166,152 +172,165 @@ def self.swagger_types :'to_field' => :'String', :'recipients' => :'UpdateEmailCampaignRecipients', :'attachment_url' => :'String', - :'inline_image_activation' => :'BOOLEAN', - :'mirror_active' => :'BOOLEAN', - :'recurring' => :'BOOLEAN', + :'inline_image_activation' => :'Boolean', + :'mirror_active' => :'Boolean', + :'recurring' => :'Boolean', :'footer' => :'String', :'header' => :'String', :'utm_campaign' => :'String', :'params' => :'Object', - :'send_at_best_time' => :'BOOLEAN', - :'ab_testing' => :'BOOLEAN', + :'send_at_best_time' => :'Boolean', + :'ab_testing' => :'Boolean', :'subject_a' => :'String', :'subject_b' => :'String', :'split_rule' => :'Integer', :'winner_criteria' => :'String', :'winner_delay' => :'Integer', - :'ip_warmup_enable' => :'BOOLEAN', + :'ip_warmup_enable' => :'Boolean', :'initial_quota' => :'Integer', :'increase_rate' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::UpdateEmailCampaign` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::UpdateEmailCampaign`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'tag') + if attributes.key?(:'tag') self.tag = attributes[:'tag'] end - if attributes.has_key?(:'sender') + if attributes.key?(:'sender') self.sender = attributes[:'sender'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'htmlContent') - self.html_content = attributes[:'htmlContent'] + if attributes.key?(:'html_content') + self.html_content = attributes[:'html_content'] end - if attributes.has_key?(:'htmlUrl') - self.html_url = attributes[:'htmlUrl'] + if attributes.key?(:'html_url') + self.html_url = attributes[:'html_url'] end - if attributes.has_key?(:'scheduledAt') - self.scheduled_at = attributes[:'scheduledAt'] + if attributes.key?(:'scheduled_at') + self.scheduled_at = attributes[:'scheduled_at'] end - if attributes.has_key?(:'subject') + if attributes.key?(:'subject') self.subject = attributes[:'subject'] end - if attributes.has_key?(:'replyTo') - self.reply_to = attributes[:'replyTo'] + if attributes.key?(:'reply_to') + self.reply_to = attributes[:'reply_to'] end - if attributes.has_key?(:'toField') - self.to_field = attributes[:'toField'] + if attributes.key?(:'to_field') + self.to_field = attributes[:'to_field'] end - if attributes.has_key?(:'recipients') + if attributes.key?(:'recipients') self.recipients = attributes[:'recipients'] end - if attributes.has_key?(:'attachmentUrl') - self.attachment_url = attributes[:'attachmentUrl'] + if attributes.key?(:'attachment_url') + self.attachment_url = attributes[:'attachment_url'] end - if attributes.has_key?(:'inlineImageActivation') - self.inline_image_activation = attributes[:'inlineImageActivation'] + if attributes.key?(:'inline_image_activation') + self.inline_image_activation = attributes[:'inline_image_activation'] else self.inline_image_activation = false end - if attributes.has_key?(:'mirrorActive') - self.mirror_active = attributes[:'mirrorActive'] + if attributes.key?(:'mirror_active') + self.mirror_active = attributes[:'mirror_active'] end - if attributes.has_key?(:'recurring') + if attributes.key?(:'recurring') self.recurring = attributes[:'recurring'] else self.recurring = false end - if attributes.has_key?(:'footer') + if attributes.key?(:'footer') self.footer = attributes[:'footer'] end - if attributes.has_key?(:'header') + if attributes.key?(:'header') self.header = attributes[:'header'] end - if attributes.has_key?(:'utmCampaign') - self.utm_campaign = attributes[:'utmCampaign'] + if attributes.key?(:'utm_campaign') + self.utm_campaign = attributes[:'utm_campaign'] end - if attributes.has_key?(:'params') + if attributes.key?(:'params') self.params = attributes[:'params'] end - if attributes.has_key?(:'sendAtBestTime') - self.send_at_best_time = attributes[:'sendAtBestTime'] + if attributes.key?(:'send_at_best_time') + self.send_at_best_time = attributes[:'send_at_best_time'] end - if attributes.has_key?(:'abTesting') - self.ab_testing = attributes[:'abTesting'] + if attributes.key?(:'ab_testing') + self.ab_testing = attributes[:'ab_testing'] else self.ab_testing = false end - if attributes.has_key?(:'subjectA') - self.subject_a = attributes[:'subjectA'] + if attributes.key?(:'subject_a') + self.subject_a = attributes[:'subject_a'] end - if attributes.has_key?(:'subjectB') - self.subject_b = attributes[:'subjectB'] + if attributes.key?(:'subject_b') + self.subject_b = attributes[:'subject_b'] end - if attributes.has_key?(:'splitRule') - self.split_rule = attributes[:'splitRule'] + if attributes.key?(:'split_rule') + self.split_rule = attributes[:'split_rule'] end - if attributes.has_key?(:'winnerCriteria') - self.winner_criteria = attributes[:'winnerCriteria'] + if attributes.key?(:'winner_criteria') + self.winner_criteria = attributes[:'winner_criteria'] end - if attributes.has_key?(:'winnerDelay') - self.winner_delay = attributes[:'winnerDelay'] + if attributes.key?(:'winner_delay') + self.winner_delay = attributes[:'winner_delay'] end - if attributes.has_key?(:'ipWarmupEnable') - self.ip_warmup_enable = attributes[:'ipWarmupEnable'] + if attributes.key?(:'ip_warmup_enable') + self.ip_warmup_enable = attributes[:'ip_warmup_enable'] else self.ip_warmup_enable = false end - if attributes.has_key?(:'initialQuota') - self.initial_quota = attributes[:'initialQuota'] + if attributes.key?(:'initial_quota') + self.initial_quota = attributes[:'initial_quota'] end - if attributes.has_key?(:'increaseRate') - self.increase_rate = attributes[:'increaseRate'] + if attributes.key?(:'increase_rate') + self.increase_rate = attributes[:'increase_rate'] end end @@ -351,7 +370,7 @@ def list_invalid_properties def valid? return false if !@split_rule.nil? && @split_rule > 50 return false if !@split_rule.nil? && @split_rule < 1 - winner_criteria_validator = EnumAttributeValidator.new('String', ['open', 'click']) + winner_criteria_validator = EnumAttributeValidator.new('String', ["open", "click"]) return false unless winner_criteria_validator.valid?(@winner_criteria) return false if !@winner_delay.nil? && @winner_delay > 168 return false if !@winner_delay.nil? && @winner_delay < 1 @@ -377,9 +396,9 @@ def split_rule=(split_rule) # Custom attribute writer method checking allowed values (enum). # @param [Object] winner_criteria Object to be assigned def winner_criteria=(winner_criteria) - validator = EnumAttributeValidator.new('String', ['open', 'click']) + validator = EnumAttributeValidator.new('String', ["open", "click"]) unless validator.valid?(winner_criteria) - fail ArgumentError, 'invalid value for "winner_criteria", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"winner_criteria\", must be one of #{validator.allowable_values}." end @winner_criteria = winner_criteria end @@ -454,18 +473,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [tag, sender, name, html_content, html_url, scheduled_at, subject, reply_to, to_field, recipients, attachment_url, inline_image_activation, mirror_active, recurring, footer, header, utm_campaign, params, send_at_best_time, ab_testing, subject_a, subject_b, split_rule, winner_criteria, winner_delay, ip_warmup_enable, initial_quota, increase_rate].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -473,7 +501,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -485,8 +513,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -495,7 +523,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -516,8 +544,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -539,7 +568,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -564,4 +597,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/update_email_campaign_recipients.rb b/lib/sib-api-v3-sdk/models/update_email_campaign_recipients.rb index fddc4ea..70c6ce6 100644 --- a/lib/sib-api-v3-sdk/models/update_email_campaign_recipients.rb +++ b/lib/sib-api-v3-sdk/models/update_email_campaign_recipients.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # List ids to include/exclude from campaign @@ -29,30 +30,48 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'exclusion_list_ids' => :'Array', :'list_ids' => :'Array' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::UpdateEmailCampaignRecipients` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::UpdateEmailCampaignRecipients`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'exclusionListIds') - if (value = attributes[:'exclusionListIds']).is_a?(Array) + if attributes.key?(:'exclusion_list_ids') + if (value = attributes[:'exclusion_list_ids']).is_a?(Array) self.exclusion_list_ids = value end end - if attributes.has_key?(:'listIds') - if (value = attributes[:'listIds']).is_a?(Array) + if attributes.key?(:'list_ids') + if (value = attributes[:'list_ids']).is_a?(Array) self.list_ids = value end end @@ -87,18 +106,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [exclusion_list_ids, list_ids].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -106,7 +134,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -118,8 +146,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -128,7 +156,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -149,8 +177,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -172,7 +201,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -197,4 +230,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/update_email_campaign_sender.rb b/lib/sib-api-v3-sdk/models/update_email_campaign_sender.rb index 56d7d9b..b6bb939 100644 --- a/lib/sib-api-v3-sdk/models/update_email_campaign_sender.rb +++ b/lib/sib-api-v3-sdk/models/update_email_campaign_sender.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` @@ -33,8 +34,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'String', :'email' => :'String', @@ -42,23 +48,36 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::UpdateEmailCampaignSender` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::UpdateEmailCampaignSender`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end end @@ -93,18 +112,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, email, id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -112,7 +140,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -124,8 +152,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -134,7 +162,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -155,8 +183,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -178,7 +207,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -203,4 +236,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/update_list.rb b/lib/sib-api-v3-sdk/models/update_list.rb index 1a00b6d..64272cf 100644 --- a/lib/sib-api-v3-sdk/models/update_list.rb +++ b/lib/sib-api-v3-sdk/models/update_list.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class UpdateList @@ -28,28 +29,46 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'String', :'folder_id' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::UpdateList` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::UpdateList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'folderId') - self.folder_id = attributes[:'folderId'] + if attributes.key?(:'folder_id') + self.folder_id = attributes[:'folder_id'] end end @@ -82,18 +101,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, folder_id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -101,7 +129,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -113,8 +141,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -123,7 +151,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -144,8 +172,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -167,7 +196,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -192,4 +225,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/update_sender.rb b/lib/sib-api-v3-sdk/models/update_sender.rb index ba0c891..b6a920e 100644 --- a/lib/sib-api-v3-sdk/models/update_sender.rb +++ b/lib/sib-api-v3-sdk/models/update_sender.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class UpdateSender @@ -32,8 +33,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'String', :'email' => :'String', @@ -41,23 +47,36 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::UpdateSender` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::UpdateSender`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'ips') + if attributes.key?(:'ips') if (value = attributes[:'ips']).is_a?(Array) self.ips = value end @@ -94,18 +113,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, email, ips].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -113,7 +141,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -125,8 +153,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -135,7 +163,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -156,8 +184,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -179,7 +208,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -204,4 +237,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/update_sms_campaign.rb b/lib/sib-api-v3-sdk/models/update_sms_campaign.rb index bcc4d0a..4744a60 100644 --- a/lib/sib-api-v3-sdk/models/update_sms_campaign.rb +++ b/lib/sib-api-v3-sdk/models/update_sms_campaign.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class UpdateSmsCampaign @@ -39,8 +40,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'String', :'sender' => :'String', @@ -50,32 +56,45 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::UpdateSmsCampaign` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::UpdateSmsCampaign`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'sender') + if attributes.key?(:'sender') self.sender = attributes[:'sender'] end - if attributes.has_key?(:'content') + if attributes.key?(:'content') self.content = attributes[:'content'] end - if attributes.has_key?(:'recipients') + if attributes.key?(:'recipients') self.recipients = attributes[:'recipients'] end - if attributes.has_key?(:'scheduledAt') - self.scheduled_at = attributes[:'scheduledAt'] + if attributes.key?(:'scheduled_at') + self.scheduled_at = attributes[:'scheduled_at'] end end @@ -126,18 +145,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, sender, content, recipients, scheduled_at].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -145,7 +173,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -157,8 +185,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -167,7 +195,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -188,8 +216,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -211,7 +240,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -236,4 +269,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/update_smtp_template.rb b/lib/sib-api-v3-sdk/models/update_smtp_template.rb index cc256be..ac8970b 100644 --- a/lib/sib-api-v3-sdk/models/update_smtp_template.rb +++ b/lib/sib-api-v3-sdk/models/update_smtp_template.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class UpdateSmtpTemplate @@ -59,8 +60,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'tag' => :'String', :'sender' => :'UpdateSmtpTemplateSender', @@ -71,56 +77,69 @@ def self.swagger_types :'reply_to' => :'String', :'to_field' => :'String', :'attachment_url' => :'String', - :'is_active' => :'BOOLEAN' + :'is_active' => :'Boolean' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::UpdateSmtpTemplate` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::UpdateSmtpTemplate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'tag') + if attributes.key?(:'tag') self.tag = attributes[:'tag'] end - if attributes.has_key?(:'sender') + if attributes.key?(:'sender') self.sender = attributes[:'sender'] end - if attributes.has_key?(:'templateName') - self.template_name = attributes[:'templateName'] + if attributes.key?(:'template_name') + self.template_name = attributes[:'template_name'] end - if attributes.has_key?(:'htmlContent') - self.html_content = attributes[:'htmlContent'] + if attributes.key?(:'html_content') + self.html_content = attributes[:'html_content'] end - if attributes.has_key?(:'htmlUrl') - self.html_url = attributes[:'htmlUrl'] + if attributes.key?(:'html_url') + self.html_url = attributes[:'html_url'] end - if attributes.has_key?(:'subject') + if attributes.key?(:'subject') self.subject = attributes[:'subject'] end - if attributes.has_key?(:'replyTo') - self.reply_to = attributes[:'replyTo'] + if attributes.key?(:'reply_to') + self.reply_to = attributes[:'reply_to'] end - if attributes.has_key?(:'toField') - self.to_field = attributes[:'toField'] + if attributes.key?(:'to_field') + self.to_field = attributes[:'to_field'] end - if attributes.has_key?(:'attachmentUrl') - self.attachment_url = attributes[:'attachmentUrl'] + if attributes.key?(:'attachment_url') + self.attachment_url = attributes[:'attachment_url'] end - if attributes.has_key?(:'isActive') - self.is_active = attributes[:'isActive'] + if attributes.key?(:'is_active') + self.is_active = attributes[:'is_active'] end end @@ -161,18 +180,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [tag, sender, template_name, html_content, html_url, subject, reply_to, to_field, attachment_url, is_active].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -180,7 +208,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -192,8 +220,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -202,7 +230,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -223,8 +251,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -246,7 +275,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -271,4 +304,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/update_smtp_template_sender.rb b/lib/sib-api-v3-sdk/models/update_smtp_template_sender.rb index d5f6fb4..f7a2b98 100644 --- a/lib/sib-api-v3-sdk/models/update_smtp_template_sender.rb +++ b/lib/sib-api-v3-sdk/models/update_smtp_template_sender.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk # Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example `{\"name\":\"xyz\", \"email\":\"example@abc.com\"}` , `{\"name\":\"xyz\", \"id\":123}` @@ -33,8 +34,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'name' => :'String', :'email' => :'String', @@ -42,23 +48,36 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::UpdateSmtpTemplateSender` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::UpdateSmtpTemplateSender`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end - if attributes.has_key?(:'email') + if attributes.key?(:'email') self.email = attributes[:'email'] end - if attributes.has_key?(:'id') + if attributes.key?(:'id') self.id = attributes[:'id'] end end @@ -93,18 +112,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [name, email, id].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -112,7 +140,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -124,8 +152,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -134,7 +162,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -155,8 +183,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -178,7 +207,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -203,4 +236,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/update_webhook.rb b/lib/sib-api-v3-sdk/models/update_webhook.rb index a6ca2e6..8e720bd 100644 --- a/lib/sib-api-v3-sdk/models/update_webhook.rb +++ b/lib/sib-api-v3-sdk/models/update_webhook.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class UpdateWebhook @@ -54,8 +55,13 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'url' => :'String', :'description' => :'String', @@ -63,23 +69,36 @@ def self.swagger_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::UpdateWebhook` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::UpdateWebhook`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'url') + if attributes.key?(:'url') self.url = attributes[:'url'] end - if attributes.has_key?(:'description') + if attributes.key?(:'description') self.description = attributes[:'description'] end - if attributes.has_key?(:'events') + if attributes.key?(:'events') if (value = attributes[:'events']).is_a?(Array) self.events = value end @@ -116,18 +135,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [url, description, events].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -135,7 +163,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -147,8 +175,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -157,7 +185,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -178,8 +206,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -201,7 +230,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -226,4 +259,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/models/upload_image_to_gallery.rb b/lib/sib-api-v3-sdk/models/upload_image_to_gallery.rb index fd56bee..8930942 100644 --- a/lib/sib-api-v3-sdk/models/upload_image_to_gallery.rb +++ b/lib/sib-api-v3-sdk/models/upload_image_to_gallery.rb @@ -3,14 +3,15 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end require 'date' +require 'time' module SibApiV3Sdk class UploadImageToGallery @@ -28,27 +29,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. - def self.swagger_types + def self.openapi_types { :'image_url' => :'String', :'name' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `SibApiV3Sdk::UploadImageToGallery` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `SibApiV3Sdk::UploadImageToGallery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'imageUrl') - self.image_url = attributes[:'imageUrl'] + if attributes.key?(:'image_url') + self.image_url = attributes[:'image_url'] end - if attributes.has_key?(:'name') + if attributes.key?(:'name') self.name = attributes[:'name'] end end @@ -87,18 +106,27 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [image_url, name].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) @@ -106,7 +134,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -118,8 +146,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -128,7 +156,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -149,8 +177,9 @@ def _deserialize(type, value) end end else # model - temp_model = SibApiV3Sdk.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = SibApiV3Sdk.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -172,7 +201,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -197,4 +230,5 @@ def _to_hash(value) end end + end diff --git a/lib/sib-api-v3-sdk/version.rb b/lib/sib-api-v3-sdk/version.rb index 1aa561a..342314d 100644 --- a/lib/sib-api-v3-sdk/version.rb +++ b/lib/sib-api-v3-sdk/version.rb @@ -3,13 +3,13 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end module SibApiV3Sdk - VERSION = "7.4.0" + VERSION = '1.0.0' end diff --git a/sib-api-v3-sdk.gemspec b/sib-api-v3-sdk.gemspec index 7ff0fe7..42ff284 100644 --- a/sib-api-v3-sdk.gemspec +++ b/sib-api-v3-sdk.gemspec @@ -5,10 +5,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.12 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -24,19 +24,12 @@ Gem::Specification.new do |s| s.homepage = "https://www.sendinblue.com/" s.summary = "SendinBlue API V3 Ruby Gem" s.description = "Official SendinBlue provided RESTFul API V3 ruby library" - s.license = 'MIT' - s.required_ruby_version = ">= 1.9" + s.license = "MIT" + s.required_ruby_version = ">= 2.4" s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' - s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' - s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6' - s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2' - s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16' - s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12' s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } s.test_files = `find spec/*`.split("\n") diff --git a/spec/api/account_api_spec.rb b/spec/api/account_api_spec.rb index ceca37e..d14178b 100644 --- a/spec/api/account_api_spec.rb +++ b/spec/api/account_api_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,12 +14,12 @@ require 'json' # Unit tests for SibApiV3Sdk::AccountApi -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'AccountApi' do before do # run before each test - @instance = SibApiV3Sdk::AccountApi.new + @api_instance = SibApiV3Sdk::AccountApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of AccountApi' do it 'should create an instance of AccountApi' do - expect(@instance).to be_instance_of(SibApiV3Sdk::AccountApi) + expect(@api_instance).to be_instance_of(SibApiV3Sdk::AccountApi) end end diff --git a/spec/api/attributes_api_spec.rb b/spec/api/attributes_api_spec.rb index 46392dc..dd8c3e6 100644 --- a/spec/api/attributes_api_spec.rb +++ b/spec/api/attributes_api_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,12 +14,12 @@ require 'json' # Unit tests for SibApiV3Sdk::AttributesApi -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'AttributesApi' do before do # run before each test - @instance = SibApiV3Sdk::AttributesApi.new + @api_instance = SibApiV3Sdk::AttributesApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of AttributesApi' do it 'should create an instance of AttributesApi' do - expect(@instance).to be_instance_of(SibApiV3Sdk::AttributesApi) + expect(@api_instance).to be_instance_of(SibApiV3Sdk::AttributesApi) end end diff --git a/spec/api/contacts_api_spec.rb b/spec/api/contacts_api_spec.rb index bfaa672..31e2af3 100644 --- a/spec/api/contacts_api_spec.rb +++ b/spec/api/contacts_api_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,12 +14,12 @@ require 'json' # Unit tests for SibApiV3Sdk::ContactsApi -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'ContactsApi' do before do # run before each test - @instance = SibApiV3Sdk::ContactsApi.new + @api_instance = SibApiV3Sdk::ContactsApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of ContactsApi' do it 'should create an instance of ContactsApi' do - expect(@instance).to be_instance_of(SibApiV3Sdk::ContactsApi) + expect(@api_instance).to be_instance_of(SibApiV3Sdk::ContactsApi) end end @@ -171,8 +171,8 @@ # Get email campaigns' statistics for a contact # @param identifier Email (urlencoded) OR ID of the contact # @param [Hash] opts the optional parameters - # @option opts [Date] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate - # @option opts [Date] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate + # @option opts [String] :start_date Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate + # @option opts [String] :end_date Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate # @return [GetContactCampaignStats] describe 'get_contact_stats test' do it 'should work' do diff --git a/spec/api/email_campaigns_api_spec.rb b/spec/api/email_campaigns_api_spec.rb index 0bdf229..5d9de13 100644 --- a/spec/api/email_campaigns_api_spec.rb +++ b/spec/api/email_campaigns_api_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,12 +14,12 @@ require 'json' # Unit tests for SibApiV3Sdk::EmailCampaignsApi -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'EmailCampaignsApi' do before do # run before each test - @instance = SibApiV3Sdk::EmailCampaignsApi.new + @api_instance = SibApiV3Sdk::EmailCampaignsApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of EmailCampaignsApi' do it 'should create an instance of EmailCampaignsApi' do - expect(@instance).to be_instance_of(SibApiV3Sdk::EmailCampaignsApi) + expect(@api_instance).to be_instance_of(SibApiV3Sdk::EmailCampaignsApi) end end diff --git a/spec/api/folders_api_spec.rb b/spec/api/folders_api_spec.rb index 9926121..409ca06 100644 --- a/spec/api/folders_api_spec.rb +++ b/spec/api/folders_api_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,12 +14,12 @@ require 'json' # Unit tests for SibApiV3Sdk::FoldersApi -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'FoldersApi' do before do # run before each test - @instance = SibApiV3Sdk::FoldersApi.new + @api_instance = SibApiV3Sdk::FoldersApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of FoldersApi' do it 'should create an instance of FoldersApi' do - expect(@instance).to be_instance_of(SibApiV3Sdk::FoldersApi) + expect(@api_instance).to be_instance_of(SibApiV3Sdk::FoldersApi) end end diff --git a/spec/api/lists_api_spec.rb b/spec/api/lists_api_spec.rb index 686766d..20b2dd7 100644 --- a/spec/api/lists_api_spec.rb +++ b/spec/api/lists_api_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,12 +14,12 @@ require 'json' # Unit tests for SibApiV3Sdk::ListsApi -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'ListsApi' do before do # run before each test - @instance = SibApiV3Sdk::ListsApi.new + @api_instance = SibApiV3Sdk::ListsApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of ListsApi' do it 'should create an instance of ListsApi' do - expect(@instance).to be_instance_of(SibApiV3Sdk::ListsApi) + expect(@api_instance).to be_instance_of(SibApiV3Sdk::ListsApi) end end diff --git a/spec/api/process_api_spec.rb b/spec/api/process_api_spec.rb index d918511..63f2a19 100644 --- a/spec/api/process_api_spec.rb +++ b/spec/api/process_api_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,12 +14,12 @@ require 'json' # Unit tests for SibApiV3Sdk::ProcessApi -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'ProcessApi' do before do # run before each test - @instance = SibApiV3Sdk::ProcessApi.new + @api_instance = SibApiV3Sdk::ProcessApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of ProcessApi' do it 'should create an instance of ProcessApi' do - expect(@instance).to be_instance_of(SibApiV3Sdk::ProcessApi) + expect(@api_instance).to be_instance_of(SibApiV3Sdk::ProcessApi) end end diff --git a/spec/api/reseller_api_spec.rb b/spec/api/reseller_api_spec.rb index 09d419f..b3d83c5 100644 --- a/spec/api/reseller_api_spec.rb +++ b/spec/api/reseller_api_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,12 +14,12 @@ require 'json' # Unit tests for SibApiV3Sdk::ResellerApi -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'ResellerApi' do before do # run before each test - @instance = SibApiV3Sdk::ResellerApi.new + @api_instance = SibApiV3Sdk::ResellerApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of ResellerApi' do it 'should create an instance of ResellerApi' do - expect(@instance).to be_instance_of(SibApiV3Sdk::ResellerApi) + expect(@api_instance).to be_instance_of(SibApiV3Sdk::ResellerApi) end end @@ -129,7 +129,7 @@ # Get all sender domains for a specific child account # @param child_identifier Either auth key or id of reseller's child # @param [Hash] opts the optional parameters - # @return [GetChildDomains] + # @return [Array] describe 'get_child_domains test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/spec/api/senders_api_spec.rb b/spec/api/senders_api_spec.rb index c0d0fa2..c2933fb 100644 --- a/spec/api/senders_api_spec.rb +++ b/spec/api/senders_api_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,12 +14,12 @@ require 'json' # Unit tests for SibApiV3Sdk::SendersApi -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'SendersApi' do before do # run before each test - @instance = SibApiV3Sdk::SendersApi.new + @api_instance = SibApiV3Sdk::SendersApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of SendersApi' do it 'should create an instance of SendersApi' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendersApi) + expect(@api_instance).to be_instance_of(SibApiV3Sdk::SendersApi) end end diff --git a/spec/api/sms_campaigns_api_spec.rb b/spec/api/sms_campaigns_api_spec.rb index b314258..5e16b47 100644 --- a/spec/api/sms_campaigns_api_spec.rb +++ b/spec/api/sms_campaigns_api_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,12 +14,12 @@ require 'json' # Unit tests for SibApiV3Sdk::SMSCampaignsApi -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'SMSCampaignsApi' do before do # run before each test - @instance = SibApiV3Sdk::SMSCampaignsApi.new + @api_instance = SibApiV3Sdk::SMSCampaignsApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of SMSCampaignsApi' do it 'should create an instance of SMSCampaignsApi' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SMSCampaignsApi) + expect(@api_instance).to be_instance_of(SibApiV3Sdk::SMSCampaignsApi) end end diff --git a/spec/api/transactional_emails_api_spec.rb b/spec/api/transactional_emails_api_spec.rb index 56b2658..e24d14f 100644 --- a/spec/api/transactional_emails_api_spec.rb +++ b/spec/api/transactional_emails_api_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,12 +14,12 @@ require 'json' # Unit tests for SibApiV3Sdk::TransactionalEmailsApi -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'TransactionalEmailsApi' do before do # run before each test - @instance = SibApiV3Sdk::TransactionalEmailsApi.new + @api_instance = SibApiV3Sdk::TransactionalEmailsApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of TransactionalEmailsApi' do it 'should create an instance of TransactionalEmailsApi' do - expect(@instance).to be_instance_of(SibApiV3Sdk::TransactionalEmailsApi) + expect(@api_instance).to be_instance_of(SibApiV3Sdk::TransactionalEmailsApi) end end @@ -167,7 +167,7 @@ # unit tests for get_smtp_templates # Get the list of email templates # @param [Hash] opts the optional parameters - # @option opts [BOOLEAN] :template_status Filter on the status of the template. Active = true, inactive = false + # @option opts [Boolean] :template_status Filter on the status of the template. Active = true, inactive = false # @option opts [Integer] :limit Number of documents returned per page # @option opts [Integer] :offset Index of the first document in the page # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed @@ -212,9 +212,11 @@ # @option opts [String] :email Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent. # @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. # @option opts [String] :message_id Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent. - # @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. - # @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. + # @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. + # @option opts [String] :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. # @option opts [String] :sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed + # @option opts [Integer] :limit Number of documents returned per page + # @option opts [Integer] :offset Index of the first document in the page # @return [GetTransacEmailsList] describe 'get_transac_emails_list test' do it 'should work' do diff --git a/spec/api/transactional_sms_api_spec.rb b/spec/api/transactional_sms_api_spec.rb index 252071f..44d6d44 100644 --- a/spec/api/transactional_sms_api_spec.rb +++ b/spec/api/transactional_sms_api_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,12 +14,12 @@ require 'json' # Unit tests for SibApiV3Sdk::TransactionalSMSApi -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'TransactionalSMSApi' do before do # run before each test - @instance = SibApiV3Sdk::TransactionalSMSApi.new + @api_instance = SibApiV3Sdk::TransactionalSMSApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of TransactionalSMSApi' do it 'should create an instance of TransactionalSMSApi' do - expect(@instance).to be_instance_of(SibApiV3Sdk::TransactionalSMSApi) + expect(@api_instance).to be_instance_of(SibApiV3Sdk::TransactionalSMSApi) end end diff --git a/spec/api/webhooks_api_spec.rb b/spec/api/webhooks_api_spec.rb index 16121f3..d925f0a 100644 --- a/spec/api/webhooks_api_spec.rb +++ b/spec/api/webhooks_api_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,12 +14,12 @@ require 'json' # Unit tests for SibApiV3Sdk::WebhooksApi -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'WebhooksApi' do before do # run before each test - @instance = SibApiV3Sdk::WebhooksApi.new + @api_instance = SibApiV3Sdk::WebhooksApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of WebhooksApi' do it 'should create an instance of WebhooksApi' do - expect(@instance).to be_instance_of(SibApiV3Sdk::WebhooksApi) + expect(@api_instance).to be_instance_of(SibApiV3Sdk::WebhooksApi) end end @@ -69,6 +69,7 @@ # Get all webhooks # @param [Hash] opts the optional parameters # @option opts [String] :type Filter on webhook type + # @option opts [String] :sort Sort the results in the ascending/descending order of webhook creation # @return [GetWebhooks] describe 'get_webhooks test' do it 'should work' do diff --git a/spec/api_client_spec.rb b/spec/api_client_spec.rb index 903f398..a2ad152 100644 --- a/spec/api_client_spec.rb +++ b/spec/api_client_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -89,23 +89,6 @@ end end - describe '#build_request' do - let(:config) { SibApiV3Sdk::Configuration.new } - let(:api_client) { SibApiV3Sdk::ApiClient.new(config) } - - it 'does not send multipart to request' do - expect(Typhoeus::Request).to receive(:new).with(anything, hash_not_including(:multipart)) - api_client.build_request(:get, '/test') - end - - context 'when the content type is multipart' do - it 'sends multipart to request' do - expect(Typhoeus::Request).to receive(:new).with(anything, hash_including(multipart: true)) - api_client.build_request(:get, '/test', {header_params: { 'Content-Type' => 'multipart/form-data'}}) - end - end - end - describe '#deserialize' do it "handles Array" do api_client = SibApiV3Sdk::ApiClient.new @@ -173,7 +156,7 @@ end it 'fails for invalid collection format' do - expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID') + expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID') end end diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb index 5ba53cd..b8dc092 100644 --- a/spec/configuration_spec.rb +++ b/spec/configuration_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end diff --git a/spec/models/ab_test_campaign_result_clicked_links_spec.rb b/spec/models/ab_test_campaign_result_clicked_links_spec.rb index ff5ab18..01bd2fb 100644 --- a/spec/models/ab_test_campaign_result_clicked_links_spec.rb +++ b/spec/models/ab_test_campaign_result_clicked_links_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::AbTestCampaignResultClickedLinks -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'AbTestCampaignResultClickedLinks' do - before do - # run before each test - @instance = SibApiV3Sdk::AbTestCampaignResultClickedLinks.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::AbTestCampaignResultClickedLinks do + let(:instance) { SibApiV3Sdk::AbTestCampaignResultClickedLinks.new } describe 'test an instance of AbTestCampaignResultClickedLinks' do it 'should create an instance of AbTestCampaignResultClickedLinks' do - expect(@instance).to be_instance_of(SibApiV3Sdk::AbTestCampaignResultClickedLinks) + expect(instance).to be_instance_of(SibApiV3Sdk::AbTestCampaignResultClickedLinks) end end describe 'test attribute "version_a"' do diff --git a/spec/models/ab_test_campaign_result_spec.rb b/spec/models/ab_test_campaign_result_spec.rb index a321711..ec0ac7a 100644 --- a/spec/models/ab_test_campaign_result_spec.rb +++ b/spec/models/ab_test_campaign_result_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::AbTestCampaignResult -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'AbTestCampaignResult' do - before do - # run before each test - @instance = SibApiV3Sdk::AbTestCampaignResult.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::AbTestCampaignResult do + let(:instance) { SibApiV3Sdk::AbTestCampaignResult.new } describe 'test an instance of AbTestCampaignResult' do it 'should create an instance of AbTestCampaignResult' do - expect(@instance).to be_instance_of(SibApiV3Sdk::AbTestCampaignResult) + expect(instance).to be_instance_of(SibApiV3Sdk::AbTestCampaignResult) end end describe 'test attribute "winning_version"' do @@ -37,7 +30,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["notAvailable", "pending", "tie", "A", "B"]) # validator.allowable_values.each do |value| - # expect { @instance.winning_version = value }.not_to raise_error + # expect { instance.winning_version = value }.not_to raise_error # end end end @@ -47,7 +40,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["Open", "Click"]) # validator.allowable_values.each do |value| - # expect { @instance.winning_criteria = value }.not_to raise_error + # expect { instance.winning_criteria = value }.not_to raise_error # end end end diff --git a/spec/models/ab_test_campaign_result_statistics_spec.rb b/spec/models/ab_test_campaign_result_statistics_spec.rb index 9b02ccf..edf9af4 100644 --- a/spec/models/ab_test_campaign_result_statistics_spec.rb +++ b/spec/models/ab_test_campaign_result_statistics_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::AbTestCampaignResultStatistics -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'AbTestCampaignResultStatistics' do - before do - # run before each test - @instance = SibApiV3Sdk::AbTestCampaignResultStatistics.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::AbTestCampaignResultStatistics do + let(:instance) { SibApiV3Sdk::AbTestCampaignResultStatistics.new } describe 'test an instance of AbTestCampaignResultStatistics' do it 'should create an instance of AbTestCampaignResultStatistics' do - expect(@instance).to be_instance_of(SibApiV3Sdk::AbTestCampaignResultStatistics) + expect(instance).to be_instance_of(SibApiV3Sdk::AbTestCampaignResultStatistics) end end describe 'test attribute "openers"' do diff --git a/spec/models/ab_test_version_clicks_spec.rb b/spec/models/ab_test_version_clicks_spec.rb deleted file mode 100644 index e0688b1..0000000 --- a/spec/models/ab_test_version_clicks_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -=begin -#SendinBlue API - -#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 | - -OpenAPI spec version: 3.0.0 -Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for SibApiV3Sdk::AbTestVersionClicks -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) -# Please update as you see appropriate -describe 'AbTestVersionClicks' do - before do - # run before each test - @instance = SibApiV3Sdk::AbTestVersionClicks.new - end - - after do - # run after each test - end - - describe 'test an instance of AbTestVersionClicks' do - it 'should create an instance of AbTestVersionClicks' do - expect(@instance).to be_instance_of(SibApiV3Sdk::AbTestVersionClicks) - end - end -end diff --git a/spec/models/ab_test_version_stats_spec.rb b/spec/models/ab_test_version_stats_spec.rb index a7b1cf3..0825801 100644 --- a/spec/models/ab_test_version_stats_spec.rb +++ b/spec/models/ab_test_version_stats_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::AbTestVersionStats -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'AbTestVersionStats' do - before do - # run before each test - @instance = SibApiV3Sdk::AbTestVersionStats.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::AbTestVersionStats do + let(:instance) { SibApiV3Sdk::AbTestVersionStats.new } describe 'test an instance of AbTestVersionStats' do it 'should create an instance of AbTestVersionStats' do - expect(@instance).to be_instance_of(SibApiV3Sdk::AbTestVersionStats) + expect(instance).to be_instance_of(SibApiV3Sdk::AbTestVersionStats) end end describe 'test attribute "version_a"' do diff --git a/spec/models/add_child_domain_spec.rb b/spec/models/add_child_domain_spec.rb index 62d046e..4805798 100644 --- a/spec/models/add_child_domain_spec.rb +++ b/spec/models/add_child_domain_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::AddChildDomain -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'AddChildDomain' do - before do - # run before each test - @instance = SibApiV3Sdk::AddChildDomain.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::AddChildDomain do + let(:instance) { SibApiV3Sdk::AddChildDomain.new } describe 'test an instance of AddChildDomain' do it 'should create an instance of AddChildDomain' do - expect(@instance).to be_instance_of(SibApiV3Sdk::AddChildDomain) + expect(instance).to be_instance_of(SibApiV3Sdk::AddChildDomain) end end describe 'test attribute "domain"' do diff --git a/spec/models/add_contact_to_list_spec.rb b/spec/models/add_contact_to_list_spec.rb index edc5ba6..e373696 100644 --- a/spec/models/add_contact_to_list_spec.rb +++ b/spec/models/add_contact_to_list_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::AddContactToList -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'AddContactToList' do - before do - # run before each test - @instance = SibApiV3Sdk::AddContactToList.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::AddContactToList do + let(:instance) { SibApiV3Sdk::AddContactToList.new } describe 'test an instance of AddContactToList' do it 'should create an instance of AddContactToList' do - expect(@instance).to be_instance_of(SibApiV3Sdk::AddContactToList) + expect(instance).to be_instance_of(SibApiV3Sdk::AddContactToList) end end describe 'test attribute "emails"' do diff --git a/spec/models/add_credits_spec.rb b/spec/models/add_credits_spec.rb index 6fcddc0..ab26d12 100644 --- a/spec/models/add_credits_spec.rb +++ b/spec/models/add_credits_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::AddCredits -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'AddCredits' do - before do - # run before each test - @instance = SibApiV3Sdk::AddCredits.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::AddCredits do + let(:instance) { SibApiV3Sdk::AddCredits.new } describe 'test an instance of AddCredits' do it 'should create an instance of AddCredits' do - expect(@instance).to be_instance_of(SibApiV3Sdk::AddCredits) + expect(instance).to be_instance_of(SibApiV3Sdk::AddCredits) end end describe 'test attribute "sms"' do diff --git a/spec/models/block_domain_spec.rb b/spec/models/block_domain_spec.rb index f8e1bcc..daf0be3 100644 --- a/spec/models/block_domain_spec.rb +++ b/spec/models/block_domain_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::BlockDomain -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'BlockDomain' do - before do - # run before each test - @instance = SibApiV3Sdk::BlockDomain.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::BlockDomain do + let(:instance) { SibApiV3Sdk::BlockDomain.new } describe 'test an instance of BlockDomain' do it 'should create an instance of BlockDomain' do - expect(@instance).to be_instance_of(SibApiV3Sdk::BlockDomain) + expect(instance).to be_instance_of(SibApiV3Sdk::BlockDomain) end end describe 'test attribute "domain"' do diff --git a/spec/models/create_attribute_enumeration_spec.rb b/spec/models/create_attribute_enumeration_spec.rb index 5294193..c60c95a 100644 --- a/spec/models/create_attribute_enumeration_spec.rb +++ b/spec/models/create_attribute_enumeration_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateAttributeEnumeration -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateAttributeEnumeration' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateAttributeEnumeration.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateAttributeEnumeration do + let(:instance) { SibApiV3Sdk::CreateAttributeEnumeration.new } describe 'test an instance of CreateAttributeEnumeration' do it 'should create an instance of CreateAttributeEnumeration' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateAttributeEnumeration) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateAttributeEnumeration) end end describe 'test attribute "value"' do diff --git a/spec/models/create_attribute_spec.rb b/spec/models/create_attribute_spec.rb index cbd877d..24b2cb1 100644 --- a/spec/models/create_attribute_spec.rb +++ b/spec/models/create_attribute_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateAttribute -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateAttribute' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateAttribute.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateAttribute do + let(:instance) { SibApiV3Sdk::CreateAttribute.new } describe 'test an instance of CreateAttribute' do it 'should create an instance of CreateAttribute' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateAttribute) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateAttribute) end end describe 'test attribute "value"' do @@ -49,7 +42,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["text", "date", "float", "boolean", "id", "category"]) # validator.allowable_values.each do |value| - # expect { @instance.type = value }.not_to raise_error + # expect { instance.type = value }.not_to raise_error # end end end diff --git a/spec/models/create_child_spec.rb b/spec/models/create_child_spec.rb index 208446b..9b3a35b 100644 --- a/spec/models/create_child_spec.rb +++ b/spec/models/create_child_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateChild -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateChild' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateChild.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateChild do + let(:instance) { SibApiV3Sdk::CreateChild.new } describe 'test an instance of CreateChild' do it 'should create an instance of CreateChild' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateChild) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateChild) end end describe 'test attribute "email"' do @@ -67,7 +60,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["fr", "es", "pt", "it", "de", "en"]) # validator.allowable_values.each do |value| - # expect { @instance.language = value }.not_to raise_error + # expect { instance.language = value }.not_to raise_error # end end end diff --git a/spec/models/create_contact_spec.rb b/spec/models/create_contact_spec.rb index 804a973..4bd95c2 100644 --- a/spec/models/create_contact_spec.rb +++ b/spec/models/create_contact_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateContact -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateContact' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateContact.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateContact do + let(:instance) { SibApiV3Sdk::CreateContact.new } describe 'test an instance of CreateContact' do it 'should create an instance of CreateContact' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateContact) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateContact) end end describe 'test attribute "email"' do diff --git a/spec/models/create_doi_contact_spec.rb b/spec/models/create_doi_contact_spec.rb index 0a9adc4..c1d8878 100644 --- a/spec/models/create_doi_contact_spec.rb +++ b/spec/models/create_doi_contact_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateDoiContact -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateDoiContact' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateDoiContact.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateDoiContact do + let(:instance) { SibApiV3Sdk::CreateDoiContact.new } describe 'test an instance of CreateDoiContact' do it 'should create an instance of CreateDoiContact' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateDoiContact) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateDoiContact) end end describe 'test attribute "email"' do diff --git a/spec/models/create_email_campaign_recipients_spec.rb b/spec/models/create_email_campaign_recipients_spec.rb index d9839cd..0661288 100644 --- a/spec/models/create_email_campaign_recipients_spec.rb +++ b/spec/models/create_email_campaign_recipients_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateEmailCampaignRecipients -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateEmailCampaignRecipients' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateEmailCampaignRecipients.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateEmailCampaignRecipients do + let(:instance) { SibApiV3Sdk::CreateEmailCampaignRecipients.new } describe 'test an instance of CreateEmailCampaignRecipients' do it 'should create an instance of CreateEmailCampaignRecipients' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateEmailCampaignRecipients) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateEmailCampaignRecipients) end end describe 'test attribute "exclusion_list_ids"' do diff --git a/spec/models/create_email_campaign_sender_spec.rb b/spec/models/create_email_campaign_sender_spec.rb index 3563bf3..31223f7 100644 --- a/spec/models/create_email_campaign_sender_spec.rb +++ b/spec/models/create_email_campaign_sender_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateEmailCampaignSender -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateEmailCampaignSender' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateEmailCampaignSender.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateEmailCampaignSender do + let(:instance) { SibApiV3Sdk::CreateEmailCampaignSender.new } describe 'test an instance of CreateEmailCampaignSender' do it 'should create an instance of CreateEmailCampaignSender' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateEmailCampaignSender) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateEmailCampaignSender) end end describe 'test attribute "name"' do diff --git a/spec/models/create_email_campaign_spec.rb b/spec/models/create_email_campaign_spec.rb index 033a8af..aee0bda 100644 --- a/spec/models/create_email_campaign_spec.rb +++ b/spec/models/create_email_campaign_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateEmailCampaign -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateEmailCampaign' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateEmailCampaign.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateEmailCampaign do + let(:instance) { SibApiV3Sdk::CreateEmailCampaign.new } describe 'test an instance of CreateEmailCampaign' do it 'should create an instance of CreateEmailCampaign' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateEmailCampaign) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateEmailCampaign) end end describe 'test attribute "tag"' do @@ -175,7 +168,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["open", "click"]) # validator.allowable_values.each do |value| - # expect { @instance.winner_criteria = value }.not_to raise_error + # expect { instance.winner_criteria = value }.not_to raise_error # end end end diff --git a/spec/models/create_list_spec.rb b/spec/models/create_list_spec.rb index a4e46ae..b88d963 100644 --- a/spec/models/create_list_spec.rb +++ b/spec/models/create_list_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateList -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateList' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateList.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateList do + let(:instance) { SibApiV3Sdk::CreateList.new } describe 'test an instance of CreateList' do it 'should create an instance of CreateList' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateList) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateList) end end describe 'test attribute "name"' do diff --git a/spec/models/create_model_spec.rb b/spec/models/create_model_spec.rb index 5499838..4ca3a2c 100644 --- a/spec/models/create_model_spec.rb +++ b/spec/models/create_model_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateModel -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateModel' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateModel.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateModel do + let(:instance) { SibApiV3Sdk::CreateModel.new } describe 'test an instance of CreateModel' do it 'should create an instance of CreateModel' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateModel) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateModel) end end describe 'test attribute "id"' do diff --git a/spec/models/create_reseller_spec.rb b/spec/models/create_reseller_spec.rb index 8169959..e293e62 100644 --- a/spec/models/create_reseller_spec.rb +++ b/spec/models/create_reseller_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateReseller -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateReseller' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateReseller.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateReseller do + let(:instance) { SibApiV3Sdk::CreateReseller.new } describe 'test an instance of CreateReseller' do it 'should create an instance of CreateReseller' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateReseller) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateReseller) end end describe 'test attribute "auth_key"' do diff --git a/spec/models/create_sender_ips_spec.rb b/spec/models/create_sender_ips_spec.rb index 2e9fc9b..9f12791 100644 --- a/spec/models/create_sender_ips_spec.rb +++ b/spec/models/create_sender_ips_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateSenderIps -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateSenderIps' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateSenderIps.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateSenderIps do + let(:instance) { SibApiV3Sdk::CreateSenderIps.new } describe 'test an instance of CreateSenderIps' do it 'should create an instance of CreateSenderIps' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateSenderIps) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateSenderIps) end end describe 'test attribute "ip"' do diff --git a/spec/models/create_sender_model_spec.rb b/spec/models/create_sender_model_spec.rb index ab10ce1..7830834 100644 --- a/spec/models/create_sender_model_spec.rb +++ b/spec/models/create_sender_model_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateSenderModel -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateSenderModel' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateSenderModel.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateSenderModel do + let(:instance) { SibApiV3Sdk::CreateSenderModel.new } describe 'test an instance of CreateSenderModel' do it 'should create an instance of CreateSenderModel' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateSenderModel) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateSenderModel) end end describe 'test attribute "id"' do diff --git a/spec/models/create_sender_spec.rb b/spec/models/create_sender_spec.rb index e185271..918a290 100644 --- a/spec/models/create_sender_spec.rb +++ b/spec/models/create_sender_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateSender -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateSender' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateSender.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateSender do + let(:instance) { SibApiV3Sdk::CreateSender.new } describe 'test an instance of CreateSender' do it 'should create an instance of CreateSender' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateSender) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateSender) end end describe 'test attribute "name"' do diff --git a/spec/models/create_sms_campaign_recipients_spec.rb b/spec/models/create_sms_campaign_recipients_spec.rb index b526583..bbcfc52 100644 --- a/spec/models/create_sms_campaign_recipients_spec.rb +++ b/spec/models/create_sms_campaign_recipients_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateSmsCampaignRecipients -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateSmsCampaignRecipients' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateSmsCampaignRecipients.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateSmsCampaignRecipients do + let(:instance) { SibApiV3Sdk::CreateSmsCampaignRecipients.new } describe 'test an instance of CreateSmsCampaignRecipients' do it 'should create an instance of CreateSmsCampaignRecipients' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateSmsCampaignRecipients) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateSmsCampaignRecipients) end end describe 'test attribute "list_ids"' do diff --git a/spec/models/create_sms_campaign_spec.rb b/spec/models/create_sms_campaign_spec.rb index e47673a..88adee5 100644 --- a/spec/models/create_sms_campaign_spec.rb +++ b/spec/models/create_sms_campaign_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateSmsCampaign -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateSmsCampaign' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateSmsCampaign.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateSmsCampaign do + let(:instance) { SibApiV3Sdk::CreateSmsCampaign.new } describe 'test an instance of CreateSmsCampaign' do it 'should create an instance of CreateSmsCampaign' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateSmsCampaign) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateSmsCampaign) end end describe 'test attribute "name"' do diff --git a/spec/models/create_smtp_email_spec.rb b/spec/models/create_smtp_email_spec.rb index 0e99472..676ed16 100644 --- a/spec/models/create_smtp_email_spec.rb +++ b/spec/models/create_smtp_email_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateSmtpEmail -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateSmtpEmail' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateSmtpEmail.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateSmtpEmail do + let(:instance) { SibApiV3Sdk::CreateSmtpEmail.new } describe 'test an instance of CreateSmtpEmail' do it 'should create an instance of CreateSmtpEmail' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateSmtpEmail) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateSmtpEmail) end end describe 'test attribute "message_id"' do diff --git a/spec/models/create_smtp_template_sender_spec.rb b/spec/models/create_smtp_template_sender_spec.rb index e765a74..b33d285 100644 --- a/spec/models/create_smtp_template_sender_spec.rb +++ b/spec/models/create_smtp_template_sender_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateSmtpTemplateSender -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateSmtpTemplateSender' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateSmtpTemplateSender.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateSmtpTemplateSender do + let(:instance) { SibApiV3Sdk::CreateSmtpTemplateSender.new } describe 'test an instance of CreateSmtpTemplateSender' do it 'should create an instance of CreateSmtpTemplateSender' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateSmtpTemplateSender) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateSmtpTemplateSender) end end describe 'test attribute "name"' do diff --git a/spec/models/create_smtp_template_spec.rb b/spec/models/create_smtp_template_spec.rb index 9f3d557..e331dbf 100644 --- a/spec/models/create_smtp_template_spec.rb +++ b/spec/models/create_smtp_template_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateSmtpTemplate -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateSmtpTemplate' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateSmtpTemplate.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateSmtpTemplate do + let(:instance) { SibApiV3Sdk::CreateSmtpTemplate.new } describe 'test an instance of CreateSmtpTemplate' do it 'should create an instance of CreateSmtpTemplate' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateSmtpTemplate) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateSmtpTemplate) end end describe 'test attribute "tag"' do diff --git a/spec/models/create_update_contact_model_spec.rb b/spec/models/create_update_contact_model_spec.rb index b845a0d..6d34309 100644 --- a/spec/models/create_update_contact_model_spec.rb +++ b/spec/models/create_update_contact_model_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateUpdateContactModel -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateUpdateContactModel' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateUpdateContactModel.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateUpdateContactModel do + let(:instance) { SibApiV3Sdk::CreateUpdateContactModel.new } describe 'test an instance of CreateUpdateContactModel' do it 'should create an instance of CreateUpdateContactModel' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateUpdateContactModel) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateUpdateContactModel) end end describe 'test attribute "id"' do diff --git a/spec/models/create_update_folder_spec.rb b/spec/models/create_update_folder_spec.rb index 380e788..8beb37c 100644 --- a/spec/models/create_update_folder_spec.rb +++ b/spec/models/create_update_folder_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateUpdateFolder -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateUpdateFolder' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateUpdateFolder.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateUpdateFolder do + let(:instance) { SibApiV3Sdk::CreateUpdateFolder.new } describe 'test an instance of CreateUpdateFolder' do it 'should create an instance of CreateUpdateFolder' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateUpdateFolder) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateUpdateFolder) end end describe 'test attribute "name"' do diff --git a/spec/models/create_webhook_spec.rb b/spec/models/create_webhook_spec.rb index de7ff85..eb87fe6 100644 --- a/spec/models/create_webhook_spec.rb +++ b/spec/models/create_webhook_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreateWebhook -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreateWebhook' do - before do - # run before each test - @instance = SibApiV3Sdk::CreateWebhook.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreateWebhook do + let(:instance) { SibApiV3Sdk::CreateWebhook.new } describe 'test an instance of CreateWebhook' do it 'should create an instance of CreateWebhook' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreateWebhook) + expect(instance).to be_instance_of(SibApiV3Sdk::CreateWebhook) end end describe 'test attribute "url"' do @@ -49,7 +42,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', ["sent", "hardBounce", "softBounce", "blocked", "spam", "delivered", "request", "click", "invalid", "deferred", "opened", "uniqueOpened", "unsubscribed", "listAddition", "contactUpdated", "contactDeleted"]) # validator.allowable_values.each do |value| - # expect { @instance.events = value }.not_to raise_error + # expect { instance.events = value }.not_to raise_error # end end end @@ -59,7 +52,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["transactional", "marketing"]) # validator.allowable_values.each do |value| - # expect { @instance.type = value }.not_to raise_error + # expect { instance.type = value }.not_to raise_error # end end end diff --git a/spec/models/created_process_id_spec.rb b/spec/models/created_process_id_spec.rb index 7ebce51..b78cb95 100644 --- a/spec/models/created_process_id_spec.rb +++ b/spec/models/created_process_id_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::CreatedProcessId -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'CreatedProcessId' do - before do - # run before each test - @instance = SibApiV3Sdk::CreatedProcessId.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::CreatedProcessId do + let(:instance) { SibApiV3Sdk::CreatedProcessId.new } describe 'test an instance of CreatedProcessId' do it 'should create an instance of CreatedProcessId' do - expect(@instance).to be_instance_of(SibApiV3Sdk::CreatedProcessId) + expect(instance).to be_instance_of(SibApiV3Sdk::CreatedProcessId) end end describe 'test attribute "process_id"' do diff --git a/spec/models/delete_hardbounces_spec.rb b/spec/models/delete_hardbounces_spec.rb index e035b56..1864c0b 100644 --- a/spec/models/delete_hardbounces_spec.rb +++ b/spec/models/delete_hardbounces_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::DeleteHardbounces -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'DeleteHardbounces' do - before do - # run before each test - @instance = SibApiV3Sdk::DeleteHardbounces.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::DeleteHardbounces do + let(:instance) { SibApiV3Sdk::DeleteHardbounces.new } describe 'test an instance of DeleteHardbounces' do it 'should create an instance of DeleteHardbounces' do - expect(@instance).to be_instance_of(SibApiV3Sdk::DeleteHardbounces) + expect(instance).to be_instance_of(SibApiV3Sdk::DeleteHardbounces) end end describe 'test attribute "start_date"' do diff --git a/spec/models/email_export_recipients_spec.rb b/spec/models/email_export_recipients_spec.rb index c686360..d4cba54 100644 --- a/spec/models/email_export_recipients_spec.rb +++ b/spec/models/email_export_recipients_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::EmailExportRecipients -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'EmailExportRecipients' do - before do - # run before each test - @instance = SibApiV3Sdk::EmailExportRecipients.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::EmailExportRecipients do + let(:instance) { SibApiV3Sdk::EmailExportRecipients.new } describe 'test an instance of EmailExportRecipients' do it 'should create an instance of EmailExportRecipients' do - expect(@instance).to be_instance_of(SibApiV3Sdk::EmailExportRecipients) + expect(instance).to be_instance_of(SibApiV3Sdk::EmailExportRecipients) end end describe 'test attribute "notify_url"' do @@ -43,7 +36,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["all", "nonClickers", "nonOpeners", "clickers", "openers", "softBounces", "hardBounces", "unsubscribed"]) # validator.allowable_values.each do |value| - # expect { @instance.recipients_type = value }.not_to raise_error + # expect { instance.recipients_type = value }.not_to raise_error # end end end diff --git a/spec/models/error_model_spec.rb b/spec/models/error_model_spec.rb index 93ba8f5..acf8324 100644 --- a/spec/models/error_model_spec.rb +++ b/spec/models/error_model_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::ErrorModel -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'ErrorModel' do - before do - # run before each test - @instance = SibApiV3Sdk::ErrorModel.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::ErrorModel do + let(:instance) { SibApiV3Sdk::ErrorModel.new } describe 'test an instance of ErrorModel' do it 'should create an instance of ErrorModel' do - expect(@instance).to be_instance_of(SibApiV3Sdk::ErrorModel) + expect(instance).to be_instance_of(SibApiV3Sdk::ErrorModel) end end describe 'test attribute "code"' do @@ -37,7 +30,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["invalid_parameter", "missing_parameter", "out_of_range", "campaign_processing", "campaign_sent", "document_not_found", "reseller_permission_denied", "not_enough_credits", "permission_denied", "duplicate_parameter", "duplicate_request", "method_not_allowed", "unauthorized", "account_under_validation", "not_acceptable"]) # validator.allowable_values.each do |value| - # expect { @instance.code = value }.not_to raise_error + # expect { instance.code = value }.not_to raise_error # end end end diff --git a/spec/models/get_account_marketing_automation_spec.rb b/spec/models/get_account_all_of_marketing_automation_spec.rb similarity index 67% rename from spec/models/get_account_marketing_automation_spec.rb rename to spec/models/get_account_all_of_marketing_automation_spec.rb index b73ee5a..aeb0bc5 100644 --- a/spec/models/get_account_marketing_automation_spec.rb +++ b/spec/models/get_account_all_of_marketing_automation_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetAccountMarketingAutomation -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetAccountAllOfMarketingAutomation +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetAccountMarketingAutomation' do - before do - # run before each test - @instance = SibApiV3Sdk::GetAccountMarketingAutomation.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetAccountAllOfMarketingAutomation do + let(:instance) { SibApiV3Sdk::GetAccountAllOfMarketingAutomation.new } - describe 'test an instance of GetAccountMarketingAutomation' do - it 'should create an instance of GetAccountMarketingAutomation' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetAccountMarketingAutomation) + describe 'test an instance of GetAccountAllOfMarketingAutomation' do + it 'should create an instance of GetAccountAllOfMarketingAutomation' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetAccountAllOfMarketingAutomation) end end describe 'test attribute "key"' do diff --git a/spec/models/get_account_plan_spec.rb b/spec/models/get_account_all_of_plan_spec.rb similarity index 77% rename from spec/models/get_account_plan_spec.rb rename to spec/models/get_account_all_of_plan_spec.rb index 4bd6360..64df142 100644 --- a/spec/models/get_account_plan_spec.rb +++ b/spec/models/get_account_all_of_plan_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetAccountPlan -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetAccountAllOfPlan +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetAccountPlan' do - before do - # run before each test - @instance = SibApiV3Sdk::GetAccountPlan.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetAccountAllOfPlan do + let(:instance) { SibApiV3Sdk::GetAccountAllOfPlan.new } - describe 'test an instance of GetAccountPlan' do - it 'should create an instance of GetAccountPlan' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetAccountPlan) + describe 'test an instance of GetAccountAllOfPlan' do + it 'should create an instance of GetAccountAllOfPlan' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetAccountAllOfPlan) end end describe 'test attribute "type"' do @@ -37,7 +30,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["payAsYouGo", "free", "subscription", "sms", "reseller"]) # validator.allowable_values.each do |value| - # expect { @instance.type = value }.not_to raise_error + # expect { instance.type = value }.not_to raise_error # end end end @@ -47,7 +40,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["sendLimit"]) # validator.allowable_values.each do |value| - # expect { @instance.credits_type = value }.not_to raise_error + # expect { instance.credits_type = value }.not_to raise_error # end end end diff --git a/spec/models/get_account_relay_data_spec.rb b/spec/models/get_account_all_of_relay_data_spec.rb similarity index 71% rename from spec/models/get_account_relay_data_spec.rb rename to spec/models/get_account_all_of_relay_data_spec.rb index a1bda07..ba925a7 100644 --- a/spec/models/get_account_relay_data_spec.rb +++ b/spec/models/get_account_all_of_relay_data_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetAccountRelayData -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetAccountAllOfRelayData +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetAccountRelayData' do - before do - # run before each test - @instance = SibApiV3Sdk::GetAccountRelayData.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetAccountAllOfRelayData do + let(:instance) { SibApiV3Sdk::GetAccountAllOfRelayData.new } - describe 'test an instance of GetAccountRelayData' do - it 'should create an instance of GetAccountRelayData' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetAccountRelayData) + describe 'test an instance of GetAccountAllOfRelayData' do + it 'should create an instance of GetAccountAllOfRelayData' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetAccountAllOfRelayData) end end describe 'test attribute "user_name"' do diff --git a/spec/models/get_account_relay_spec.rb b/spec/models/get_account_all_of_relay_spec.rb similarity index 69% rename from spec/models/get_account_relay_spec.rb rename to spec/models/get_account_all_of_relay_spec.rb index 17eb38a..a191888 100644 --- a/spec/models/get_account_relay_spec.rb +++ b/spec/models/get_account_all_of_relay_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetAccountRelay -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetAccountAllOfRelay +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetAccountRelay' do - before do - # run before each test - @instance = SibApiV3Sdk::GetAccountRelay.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetAccountAllOfRelay do + let(:instance) { SibApiV3Sdk::GetAccountAllOfRelay.new } - describe 'test an instance of GetAccountRelay' do - it 'should create an instance of GetAccountRelay' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetAccountRelay) + describe 'test an instance of GetAccountAllOfRelay' do + it 'should create an instance of GetAccountAllOfRelay' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetAccountAllOfRelay) end end describe 'test attribute "enabled"' do diff --git a/spec/models/ab_test_version_clicks_inner_spec.rb b/spec/models/get_account_all_of_spec.rb similarity index 64% rename from spec/models/ab_test_version_clicks_inner_spec.rb rename to spec/models/get_account_all_of_spec.rb index 92f0826..6afd528 100644 --- a/spec/models/ab_test_version_clicks_inner_spec.rb +++ b/spec/models/get_account_all_of_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,37 +14,30 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::AbTestVersionClicksInner -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetAccountAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'AbTestVersionClicksInner' do - before do - # run before each test - @instance = SibApiV3Sdk::AbTestVersionClicksInner.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetAccountAllOf do + let(:instance) { SibApiV3Sdk::GetAccountAllOf.new } - describe 'test an instance of AbTestVersionClicksInner' do - it 'should create an instance of AbTestVersionClicksInner' do - expect(@instance).to be_instance_of(SibApiV3Sdk::AbTestVersionClicksInner) + describe 'test an instance of GetAccountAllOf' do + it 'should create an instance of GetAccountAllOf' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetAccountAllOf) end end - describe 'test attribute "link"' do + describe 'test attribute "plan"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "clicks_count"' do + describe 'test attribute "relay"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "click_rate"' do + describe 'test attribute "marketing_automation"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end diff --git a/spec/models/get_account_spec.rb b/spec/models/get_account_spec.rb index 3d10b04..2117173 100644 --- a/spec/models/get_account_spec.rb +++ b/spec/models/get_account_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetAccount -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetAccount' do - before do - # run before each test - @instance = SibApiV3Sdk::GetAccount.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetAccount do + let(:instance) { SibApiV3Sdk::GetAccount.new } describe 'test an instance of GetAccount' do it 'should create an instance of GetAccount' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetAccount) + expect(instance).to be_instance_of(SibApiV3Sdk::GetAccount) end end describe 'test attribute "email"' do diff --git a/spec/models/get_aggregated_report_spec.rb b/spec/models/get_aggregated_report_spec.rb index 43bc251..1a25ae3 100644 --- a/spec/models/get_aggregated_report_spec.rb +++ b/spec/models/get_aggregated_report_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetAggregatedReport -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetAggregatedReport' do - before do - # run before each test - @instance = SibApiV3Sdk::GetAggregatedReport.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetAggregatedReport do + let(:instance) { SibApiV3Sdk::GetAggregatedReport.new } describe 'test an instance of GetAggregatedReport' do it 'should create an instance of GetAggregatedReport' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetAggregatedReport) + expect(instance).to be_instance_of(SibApiV3Sdk::GetAggregatedReport) end end describe 'test attribute "range"' do diff --git a/spec/models/get_attributes_attributes_spec.rb b/spec/models/get_attributes_attributes_spec.rb index e01853c..2221530 100644 --- a/spec/models/get_attributes_attributes_spec.rb +++ b/spec/models/get_attributes_attributes_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetAttributesAttributes -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetAttributesAttributes' do - before do - # run before each test - @instance = SibApiV3Sdk::GetAttributesAttributes.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetAttributesAttributes do + let(:instance) { SibApiV3Sdk::GetAttributesAttributes.new } describe 'test an instance of GetAttributesAttributes' do it 'should create an instance of GetAttributesAttributes' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetAttributesAttributes) + expect(instance).to be_instance_of(SibApiV3Sdk::GetAttributesAttributes) end end describe 'test attribute "name"' do @@ -43,7 +36,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["normal", "transactional", "category", "calculated", "global"]) # validator.allowable_values.each do |value| - # expect { @instance.category = value }.not_to raise_error + # expect { instance.category = value }.not_to raise_error # end end end @@ -53,7 +46,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["text", "date", "float", "id", "boolean"]) # validator.allowable_values.each do |value| - # expect { @instance.type = value }.not_to raise_error + # expect { instance.type = value }.not_to raise_error # end end end diff --git a/spec/models/get_attributes_enumeration_spec.rb b/spec/models/get_attributes_enumeration_spec.rb index df8b6c0..ad269e6 100644 --- a/spec/models/get_attributes_enumeration_spec.rb +++ b/spec/models/get_attributes_enumeration_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetAttributesEnumeration -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetAttributesEnumeration' do - before do - # run before each test - @instance = SibApiV3Sdk::GetAttributesEnumeration.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetAttributesEnumeration do + let(:instance) { SibApiV3Sdk::GetAttributesEnumeration.new } describe 'test an instance of GetAttributesEnumeration' do it 'should create an instance of GetAttributesEnumeration' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetAttributesEnumeration) + expect(instance).to be_instance_of(SibApiV3Sdk::GetAttributesEnumeration) end end describe 'test attribute "value"' do diff --git a/spec/models/get_attributes_spec.rb b/spec/models/get_attributes_spec.rb index 842f789..d9a0a02 100644 --- a/spec/models/get_attributes_spec.rb +++ b/spec/models/get_attributes_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetAttributes -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetAttributes' do - before do - # run before each test - @instance = SibApiV3Sdk::GetAttributes.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetAttributes do + let(:instance) { SibApiV3Sdk::GetAttributes.new } describe 'test an instance of GetAttributes' do it 'should create an instance of GetAttributes' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetAttributes) + expect(instance).to be_instance_of(SibApiV3Sdk::GetAttributes) end end describe 'test attribute "attributes"' do diff --git a/spec/models/get_blocked_domains_spec.rb b/spec/models/get_blocked_domains_spec.rb index 1b27824..f328fea 100644 --- a/spec/models/get_blocked_domains_spec.rb +++ b/spec/models/get_blocked_domains_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetBlockedDomains -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetBlockedDomains' do - before do - # run before each test - @instance = SibApiV3Sdk::GetBlockedDomains.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetBlockedDomains do + let(:instance) { SibApiV3Sdk::GetBlockedDomains.new } describe 'test an instance of GetBlockedDomains' do it 'should create an instance of GetBlockedDomains' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetBlockedDomains) + expect(instance).to be_instance_of(SibApiV3Sdk::GetBlockedDomains) end end describe 'test attribute "domains"' do diff --git a/spec/models/get_campaign_overview_spec.rb b/spec/models/get_campaign_overview_spec.rb index 102116b..53e68b3 100644 --- a/spec/models/get_campaign_overview_spec.rb +++ b/spec/models/get_campaign_overview_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetCampaignOverview -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetCampaignOverview' do - before do - # run before each test - @instance = SibApiV3Sdk::GetCampaignOverview.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetCampaignOverview do + let(:instance) { SibApiV3Sdk::GetCampaignOverview.new } describe 'test an instance of GetCampaignOverview' do it 'should create an instance of GetCampaignOverview' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetCampaignOverview) + expect(instance).to be_instance_of(SibApiV3Sdk::GetCampaignOverview) end end describe 'test attribute "id"' do @@ -55,7 +48,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["classic", "trigger"]) # validator.allowable_values.each do |value| - # expect { @instance.type = value }.not_to raise_error + # expect { instance.type = value }.not_to raise_error # end end end @@ -65,7 +58,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["draft", "sent", "archive", "queued", "suspended", "in_process"]) # validator.allowable_values.each do |value| - # expect { @instance.status = value }.not_to raise_error + # expect { instance.status = value }.not_to raise_error # end end end diff --git a/spec/models/get_campaign_recipients_spec.rb b/spec/models/get_campaign_recipients_spec.rb index c73564b..bf75e2f 100644 --- a/spec/models/get_campaign_recipients_spec.rb +++ b/spec/models/get_campaign_recipients_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetCampaignRecipients -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetCampaignRecipients' do - before do - # run before each test - @instance = SibApiV3Sdk::GetCampaignRecipients.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetCampaignRecipients do + let(:instance) { SibApiV3Sdk::GetCampaignRecipients.new } describe 'test an instance of GetCampaignRecipients' do it 'should create an instance of GetCampaignRecipients' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetCampaignRecipients) + expect(instance).to be_instance_of(SibApiV3Sdk::GetCampaignRecipients) end end describe 'test attribute "lists"' do diff --git a/spec/models/get_campaign_stats_spec.rb b/spec/models/get_campaign_stats_spec.rb index ad7a775..7b66974 100644 --- a/spec/models/get_campaign_stats_spec.rb +++ b/spec/models/get_campaign_stats_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetCampaignStats -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetCampaignStats' do - before do - # run before each test - @instance = SibApiV3Sdk::GetCampaignStats.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetCampaignStats do + let(:instance) { SibApiV3Sdk::GetCampaignStats.new } describe 'test an instance of GetCampaignStats' do it 'should create an instance of GetCampaignStats' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetCampaignStats) + expect(instance).to be_instance_of(SibApiV3Sdk::GetCampaignStats) end end describe 'test attribute "list_id"' do diff --git a/spec/models/get_child_account_creation_status_spec.rb b/spec/models/get_child_account_creation_status_spec.rb index 2ccba37..adc6f1a 100644 --- a/spec/models/get_child_account_creation_status_spec.rb +++ b/spec/models/get_child_account_creation_status_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetChildAccountCreationStatus -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetChildAccountCreationStatus' do - before do - # run before each test - @instance = SibApiV3Sdk::GetChildAccountCreationStatus.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetChildAccountCreationStatus do + let(:instance) { SibApiV3Sdk::GetChildAccountCreationStatus.new } describe 'test an instance of GetChildAccountCreationStatus' do it 'should create an instance of GetChildAccountCreationStatus' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetChildAccountCreationStatus) + expect(instance).to be_instance_of(SibApiV3Sdk::GetChildAccountCreationStatus) end end describe 'test attribute "child_account_created"' do diff --git a/spec/models/get_child_domain_spec.rb b/spec/models/get_child_domain_spec.rb index 46a104a..0572c2e 100644 --- a/spec/models/get_child_domain_spec.rb +++ b/spec/models/get_child_domain_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetChildDomain -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetChildDomain' do - before do - # run before each test - @instance = SibApiV3Sdk::GetChildDomain.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetChildDomain do + let(:instance) { SibApiV3Sdk::GetChildDomain.new } describe 'test an instance of GetChildDomain' do it 'should create an instance of GetChildDomain' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetChildDomain) + expect(instance).to be_instance_of(SibApiV3Sdk::GetChildDomain) end end describe 'test attribute "domain"' do diff --git a/spec/models/get_child_domains_spec.rb b/spec/models/get_child_domains_spec.rb deleted file mode 100644 index 072cec1..0000000 --- a/spec/models/get_child_domains_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -=begin -#SendinBlue API - -#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 | - -OpenAPI spec version: 3.0.0 -Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for SibApiV3Sdk::GetChildDomains -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) -# Please update as you see appropriate -describe 'GetChildDomains' do - before do - # run before each test - @instance = SibApiV3Sdk::GetChildDomains.new - end - - after do - # run after each test - end - - describe 'test an instance of GetChildDomains' do - it 'should create an instance of GetChildDomains' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetChildDomains) - end - end -end diff --git a/spec/models/get_child_info_api_keys_spec.rb b/spec/models/get_child_info_all_of_api_keys_spec.rb similarity index 68% rename from spec/models/get_child_info_api_keys_spec.rb rename to spec/models/get_child_info_all_of_api_keys_spec.rb index d301843..aa0f043 100644 --- a/spec/models/get_child_info_api_keys_spec.rb +++ b/spec/models/get_child_info_all_of_api_keys_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetChildInfoApiKeys -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetChildInfoAllOfApiKeys +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetChildInfoApiKeys' do - before do - # run before each test - @instance = SibApiV3Sdk::GetChildInfoApiKeys.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetChildInfoAllOfApiKeys do + let(:instance) { SibApiV3Sdk::GetChildInfoAllOfApiKeys.new } - describe 'test an instance of GetChildInfoApiKeys' do - it 'should create an instance of GetChildInfoApiKeys' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetChildInfoApiKeys) + describe 'test an instance of GetChildInfoAllOfApiKeys' do + it 'should create an instance of GetChildInfoAllOfApiKeys' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetChildInfoAllOfApiKeys) end end describe 'test attribute "v2"' do diff --git a/spec/models/get_child_info_api_keys_v2_spec.rb b/spec/models/get_child_info_all_of_api_keys_v2_spec.rb similarity index 68% rename from spec/models/get_child_info_api_keys_v2_spec.rb rename to spec/models/get_child_info_all_of_api_keys_v2_spec.rb index 8b3dde6..4253ffe 100644 --- a/spec/models/get_child_info_api_keys_v2_spec.rb +++ b/spec/models/get_child_info_all_of_api_keys_v2_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetChildInfoApiKeysV2 -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetChildInfoAllOfApiKeysV2 +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetChildInfoApiKeysV2' do - before do - # run before each test - @instance = SibApiV3Sdk::GetChildInfoApiKeysV2.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetChildInfoAllOfApiKeysV2 do + let(:instance) { SibApiV3Sdk::GetChildInfoAllOfApiKeysV2.new } - describe 'test an instance of GetChildInfoApiKeysV2' do - it 'should create an instance of GetChildInfoApiKeysV2' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetChildInfoApiKeysV2) + describe 'test an instance of GetChildInfoAllOfApiKeysV2' do + it 'should create an instance of GetChildInfoAllOfApiKeysV2' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetChildInfoAllOfApiKeysV2) end end describe 'test attribute "name"' do diff --git a/spec/models/get_child_info_api_keys_v3_spec.rb b/spec/models/get_child_info_all_of_api_keys_v3_spec.rb similarity index 68% rename from spec/models/get_child_info_api_keys_v3_spec.rb rename to spec/models/get_child_info_all_of_api_keys_v3_spec.rb index 7945446..bf6b5ab 100644 --- a/spec/models/get_child_info_api_keys_v3_spec.rb +++ b/spec/models/get_child_info_all_of_api_keys_v3_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetChildInfoApiKeysV3 -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetChildInfoAllOfApiKeysV3 +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetChildInfoApiKeysV3' do - before do - # run before each test - @instance = SibApiV3Sdk::GetChildInfoApiKeysV3.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetChildInfoAllOfApiKeysV3 do + let(:instance) { SibApiV3Sdk::GetChildInfoAllOfApiKeysV3.new } - describe 'test an instance of GetChildInfoApiKeysV3' do - it 'should create an instance of GetChildInfoApiKeysV3' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetChildInfoApiKeysV3) + describe 'test an instance of GetChildInfoAllOfApiKeysV3' do + it 'should create an instance of GetChildInfoAllOfApiKeysV3' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetChildInfoAllOfApiKeysV3) end end describe 'test attribute "name"' do diff --git a/spec/models/get_child_info_credits_spec.rb b/spec/models/get_child_info_all_of_credits_spec.rb similarity index 68% rename from spec/models/get_child_info_credits_spec.rb rename to spec/models/get_child_info_all_of_credits_spec.rb index 97efa44..f395a10 100644 --- a/spec/models/get_child_info_credits_spec.rb +++ b/spec/models/get_child_info_all_of_credits_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetChildInfoCredits -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetChildInfoAllOfCredits +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetChildInfoCredits' do - before do - # run before each test - @instance = SibApiV3Sdk::GetChildInfoCredits.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetChildInfoAllOfCredits do + let(:instance) { SibApiV3Sdk::GetChildInfoAllOfCredits.new } - describe 'test an instance of GetChildInfoCredits' do - it 'should create an instance of GetChildInfoCredits' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetChildInfoCredits) + describe 'test an instance of GetChildInfoAllOfCredits' do + it 'should create an instance of GetChildInfoAllOfCredits' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetChildInfoAllOfCredits) end end describe 'test attribute "email_credits"' do diff --git a/spec/models/get_child_info_all_of_spec.rb b/spec/models/get_child_info_all_of_spec.rb new file mode 100644 index 0000000..5c174e5 --- /dev/null +++ b/spec/models/get_child_info_all_of_spec.rb @@ -0,0 +1,58 @@ +=begin +#SendinBlue API + +#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 | + +The version of the OpenAPI document: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SibApiV3Sdk::GetChildInfoAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe SibApiV3Sdk::GetChildInfoAllOf do + let(:instance) { SibApiV3Sdk::GetChildInfoAllOf.new } + + describe 'test an instance of GetChildInfoAllOf' do + it 'should create an instance of GetChildInfoAllOf' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetChildInfoAllOf) + end + end + describe 'test attribute "credits"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statistics"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "password"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "ips"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "api_keys"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/get_child_info_statistics_spec.rb b/spec/models/get_child_info_all_of_statistics_spec.rb similarity index 71% rename from spec/models/get_child_info_statistics_spec.rb rename to spec/models/get_child_info_all_of_statistics_spec.rb index e116f33..e47530d 100644 --- a/spec/models/get_child_info_statistics_spec.rb +++ b/spec/models/get_child_info_all_of_statistics_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetChildInfoStatistics -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetChildInfoAllOfStatistics +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetChildInfoStatistics' do - before do - # run before each test - @instance = SibApiV3Sdk::GetChildInfoStatistics.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetChildInfoAllOfStatistics do + let(:instance) { SibApiV3Sdk::GetChildInfoAllOfStatistics.new } - describe 'test an instance of GetChildInfoStatistics' do - it 'should create an instance of GetChildInfoStatistics' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetChildInfoStatistics) + describe 'test an instance of GetChildInfoAllOfStatistics' do + it 'should create an instance of GetChildInfoAllOfStatistics' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetChildInfoAllOfStatistics) end end describe 'test attribute "previous_month_total_sent"' do diff --git a/spec/models/get_child_info_spec.rb b/spec/models/get_child_info_spec.rb index f7fb8f7..e60b08d 100644 --- a/spec/models/get_child_info_spec.rb +++ b/spec/models/get_child_info_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetChildInfo -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetChildInfo' do - before do - # run before each test - @instance = SibApiV3Sdk::GetChildInfo.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetChildInfo do + let(:instance) { SibApiV3Sdk::GetChildInfo.new } describe 'test an instance of GetChildInfo' do it 'should create an instance of GetChildInfo' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetChildInfo) + expect(instance).to be_instance_of(SibApiV3Sdk::GetChildInfo) end end describe 'test attribute "email"' do diff --git a/spec/models/get_children_list_spec.rb b/spec/models/get_children_list_spec.rb index 5b57316..b9f953e 100644 --- a/spec/models/get_children_list_spec.rb +++ b/spec/models/get_children_list_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetChildrenList -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetChildrenList' do - before do - # run before each test - @instance = SibApiV3Sdk::GetChildrenList.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetChildrenList do + let(:instance) { SibApiV3Sdk::GetChildrenList.new } describe 'test an instance of GetChildrenList' do it 'should create an instance of GetChildrenList' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetChildrenList) + expect(instance).to be_instance_of(SibApiV3Sdk::GetChildrenList) end end describe 'test attribute "children"' do diff --git a/spec/models/get_client_spec.rb b/spec/models/get_client_spec.rb index 52b3440..f4f3bc2 100644 --- a/spec/models/get_client_spec.rb +++ b/spec/models/get_client_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetClient -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetClient' do - before do - # run before each test - @instance = SibApiV3Sdk::GetClient.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetClient do + let(:instance) { SibApiV3Sdk::GetClient.new } describe 'test an instance of GetClient' do it 'should create an instance of GetClient' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetClient) + expect(instance).to be_instance_of(SibApiV3Sdk::GetClient) end end describe 'test attribute "email"' do diff --git a/spec/models/get_contact_campaign_stats_clicked_spec.rb b/spec/models/get_contact_campaign_stats_clicked_spec.rb index 717b090..f4406fd 100644 --- a/spec/models/get_contact_campaign_stats_clicked_spec.rb +++ b/spec/models/get_contact_campaign_stats_clicked_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetContactCampaignStatsClicked -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetContactCampaignStatsClicked' do - before do - # run before each test - @instance = SibApiV3Sdk::GetContactCampaignStatsClicked.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetContactCampaignStatsClicked do + let(:instance) { SibApiV3Sdk::GetContactCampaignStatsClicked.new } describe 'test an instance of GetContactCampaignStatsClicked' do it 'should create an instance of GetContactCampaignStatsClicked' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetContactCampaignStatsClicked) + expect(instance).to be_instance_of(SibApiV3Sdk::GetContactCampaignStatsClicked) end end describe 'test attribute "campaign_id"' do diff --git a/spec/models/get_contact_campaign_stats_opened_spec.rb b/spec/models/get_contact_campaign_stats_opened_spec.rb index c97d720..31e0e4c 100644 --- a/spec/models/get_contact_campaign_stats_opened_spec.rb +++ b/spec/models/get_contact_campaign_stats_opened_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetContactCampaignStatsOpened -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetContactCampaignStatsOpened' do - before do - # run before each test - @instance = SibApiV3Sdk::GetContactCampaignStatsOpened.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetContactCampaignStatsOpened do + let(:instance) { SibApiV3Sdk::GetContactCampaignStatsOpened.new } describe 'test an instance of GetContactCampaignStatsOpened' do it 'should create an instance of GetContactCampaignStatsOpened' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetContactCampaignStatsOpened) + expect(instance).to be_instance_of(SibApiV3Sdk::GetContactCampaignStatsOpened) end end describe 'test attribute "campaign_id"' do diff --git a/spec/models/get_contact_campaign_stats_spec.rb b/spec/models/get_contact_campaign_stats_spec.rb index c34e403..d5207ed 100644 --- a/spec/models/get_contact_campaign_stats_spec.rb +++ b/spec/models/get_contact_campaign_stats_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetContactCampaignStats -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetContactCampaignStats' do - before do - # run before each test - @instance = SibApiV3Sdk::GetContactCampaignStats.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetContactCampaignStats do + let(:instance) { SibApiV3Sdk::GetContactCampaignStats.new } describe 'test an instance of GetContactCampaignStats' do it 'should create an instance of GetContactCampaignStats' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetContactCampaignStats) + expect(instance).to be_instance_of(SibApiV3Sdk::GetContactCampaignStats) end end describe 'test attribute "messages_sent"' do diff --git a/spec/models/get_contact_campaign_stats_transac_attributes_spec.rb b/spec/models/get_contact_campaign_stats_transac_attributes_spec.rb index cf04d04..3d8f7da 100644 --- a/spec/models/get_contact_campaign_stats_transac_attributes_spec.rb +++ b/spec/models/get_contact_campaign_stats_transac_attributes_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetContactCampaignStatsTransacAttributes -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetContactCampaignStatsTransacAttributes' do - before do - # run before each test - @instance = SibApiV3Sdk::GetContactCampaignStatsTransacAttributes.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetContactCampaignStatsTransacAttributes do + let(:instance) { SibApiV3Sdk::GetContactCampaignStatsTransacAttributes.new } describe 'test an instance of GetContactCampaignStatsTransacAttributes' do it 'should create an instance of GetContactCampaignStatsTransacAttributes' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetContactCampaignStatsTransacAttributes) + expect(instance).to be_instance_of(SibApiV3Sdk::GetContactCampaignStatsTransacAttributes) end end describe 'test attribute "order_date"' do diff --git a/spec/models/get_contact_campaign_stats_unsubscriptions_spec.rb b/spec/models/get_contact_campaign_stats_unsubscriptions_spec.rb index 620c18b..91bb808 100644 --- a/spec/models/get_contact_campaign_stats_unsubscriptions_spec.rb +++ b/spec/models/get_contact_campaign_stats_unsubscriptions_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetContactCampaignStatsUnsubscriptions -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetContactCampaignStatsUnsubscriptions' do - before do - # run before each test - @instance = SibApiV3Sdk::GetContactCampaignStatsUnsubscriptions.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetContactCampaignStatsUnsubscriptions do + let(:instance) { SibApiV3Sdk::GetContactCampaignStatsUnsubscriptions.new } describe 'test an instance of GetContactCampaignStatsUnsubscriptions' do it 'should create an instance of GetContactCampaignStatsUnsubscriptions' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetContactCampaignStatsUnsubscriptions) + expect(instance).to be_instance_of(SibApiV3Sdk::GetContactCampaignStatsUnsubscriptions) end end describe 'test attribute "user_unsubscription"' do diff --git a/spec/models/get_contact_details_spec.rb b/spec/models/get_contact_details_spec.rb index e537fa5..80a8484 100644 --- a/spec/models/get_contact_details_spec.rb +++ b/spec/models/get_contact_details_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetContactDetails -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetContactDetails' do - before do - # run before each test - @instance = SibApiV3Sdk::GetContactDetails.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetContactDetails do + let(:instance) { SibApiV3Sdk::GetContactDetails.new } describe 'test an instance of GetContactDetails' do it 'should create an instance of GetContactDetails' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetContactDetails) + expect(instance).to be_instance_of(SibApiV3Sdk::GetContactDetails) end end describe 'test attribute "email"' do diff --git a/spec/models/get_contacts_spec.rb b/spec/models/get_contacts_spec.rb index 6f82ba3..0ce7c8f 100644 --- a/spec/models/get_contacts_spec.rb +++ b/spec/models/get_contacts_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetContacts -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetContacts' do - before do - # run before each test - @instance = SibApiV3Sdk::GetContacts.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetContacts do + let(:instance) { SibApiV3Sdk::GetContacts.new } describe 'test an instance of GetContacts' do it 'should create an instance of GetContacts' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetContacts) + expect(instance).to be_instance_of(SibApiV3Sdk::GetContacts) end end describe 'test attribute "contacts"' do diff --git a/spec/models/get_device_browser_stats_spec.rb b/spec/models/get_device_browser_stats_spec.rb index b479e38..2cb95bf 100644 --- a/spec/models/get_device_browser_stats_spec.rb +++ b/spec/models/get_device_browser_stats_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetDeviceBrowserStats -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetDeviceBrowserStats' do - before do - # run before each test - @instance = SibApiV3Sdk::GetDeviceBrowserStats.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetDeviceBrowserStats do + let(:instance) { SibApiV3Sdk::GetDeviceBrowserStats.new } describe 'test an instance of GetDeviceBrowserStats' do it 'should create an instance of GetDeviceBrowserStats' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetDeviceBrowserStats) + expect(instance).to be_instance_of(SibApiV3Sdk::GetDeviceBrowserStats) end end describe 'test attribute "clickers"' do diff --git a/spec/models/get_email_campaign_all_of_spec.rb b/spec/models/get_email_campaign_all_of_spec.rb new file mode 100644 index 0000000..f7bcf56 --- /dev/null +++ b/spec/models/get_email_campaign_all_of_spec.rb @@ -0,0 +1,40 @@ +=begin +#SendinBlue API + +#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 | + +The version of the OpenAPI document: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SibApiV3Sdk::GetEmailCampaignAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe SibApiV3Sdk::GetEmailCampaignAllOf do + let(:instance) { SibApiV3Sdk::GetEmailCampaignAllOf.new } + + describe 'test an instance of GetEmailCampaignAllOf' do + it 'should create an instance of GetEmailCampaignAllOf' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetEmailCampaignAllOf) + end + end + describe 'test attribute "recipients"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statistics"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/get_email_campaign_spec.rb b/spec/models/get_email_campaign_spec.rb index 48d2098..acb7d12 100644 --- a/spec/models/get_email_campaign_spec.rb +++ b/spec/models/get_email_campaign_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetEmailCampaign -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetEmailCampaign' do - before do - # run before each test - @instance = SibApiV3Sdk::GetEmailCampaign.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetEmailCampaign do + let(:instance) { SibApiV3Sdk::GetEmailCampaign.new } describe 'test an instance of GetEmailCampaign' do it 'should create an instance of GetEmailCampaign' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetEmailCampaign) + expect(instance).to be_instance_of(SibApiV3Sdk::GetEmailCampaign) end end describe 'test attribute "id"' do @@ -55,7 +48,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["classic", "trigger"]) # validator.allowable_values.each do |value| - # expect { @instance.type = value }.not_to raise_error + # expect { instance.type = value }.not_to raise_error # end end end @@ -65,7 +58,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["draft", "sent", "archive", "queued", "suspended", "in_process"]) # validator.allowable_values.each do |value| - # expect { @instance.status = value }.not_to raise_error + # expect { instance.status = value }.not_to raise_error # end end end diff --git a/spec/models/get_email_campaigns_spec.rb b/spec/models/get_email_campaigns_spec.rb index 18e0d49..5604ac2 100644 --- a/spec/models/get_email_campaigns_spec.rb +++ b/spec/models/get_email_campaigns_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetEmailCampaigns -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetEmailCampaigns' do - before do - # run before each test - @instance = SibApiV3Sdk::GetEmailCampaigns.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetEmailCampaigns do + let(:instance) { SibApiV3Sdk::GetEmailCampaigns.new } describe 'test an instance of GetEmailCampaigns' do it 'should create an instance of GetEmailCampaigns' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetEmailCampaigns) + expect(instance).to be_instance_of(SibApiV3Sdk::GetEmailCampaigns) end end describe 'test attribute "campaigns"' do diff --git a/spec/models/get_email_event_report_events_spec.rb b/spec/models/get_email_event_report_events_spec.rb index 399b8ef..ecab52a 100644 --- a/spec/models/get_email_event_report_events_spec.rb +++ b/spec/models/get_email_event_report_events_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetEmailEventReportEvents -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetEmailEventReportEvents' do - before do - # run before each test - @instance = SibApiV3Sdk::GetEmailEventReportEvents.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetEmailEventReportEvents do + let(:instance) { SibApiV3Sdk::GetEmailEventReportEvents.new } describe 'test an instance of GetEmailEventReportEvents' do it 'should create an instance of GetEmailEventReportEvents' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetEmailEventReportEvents) + expect(instance).to be_instance_of(SibApiV3Sdk::GetEmailEventReportEvents) end end describe 'test attribute "email"' do @@ -61,7 +54,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["bounces", "hardBounces", "softBounces", "delivered", "spam", "requests", "opened", "clicks", "invalid", "deferred", "blocked", "unsubscribed", "error"]) # validator.allowable_values.each do |value| - # expect { @instance.event = value }.not_to raise_error + # expect { instance.event = value }.not_to raise_error # end end end diff --git a/spec/models/get_email_event_report_spec.rb b/spec/models/get_email_event_report_spec.rb index 6bb1ae3..cc2927b 100644 --- a/spec/models/get_email_event_report_spec.rb +++ b/spec/models/get_email_event_report_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetEmailEventReport -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetEmailEventReport' do - before do - # run before each test - @instance = SibApiV3Sdk::GetEmailEventReport.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetEmailEventReport do + let(:instance) { SibApiV3Sdk::GetEmailEventReport.new } describe 'test an instance of GetEmailEventReport' do it 'should create an instance of GetEmailEventReport' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetEmailEventReport) + expect(instance).to be_instance_of(SibApiV3Sdk::GetEmailEventReport) end end describe 'test attribute "events"' do diff --git a/spec/models/get_extended_campaign_overview_sender_spec.rb b/spec/models/get_extended_campaign_overview_all_of_sender_spec.rb similarity index 71% rename from spec/models/get_extended_campaign_overview_sender_spec.rb rename to spec/models/get_extended_campaign_overview_all_of_sender_spec.rb index 5fc5429..082a754 100644 --- a/spec/models/get_extended_campaign_overview_sender_spec.rb +++ b/spec/models/get_extended_campaign_overview_all_of_sender_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetExtendedCampaignOverviewSender -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetExtendedCampaignOverviewAllOfSender +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetExtendedCampaignOverviewSender' do - before do - # run before each test - @instance = SibApiV3Sdk::GetExtendedCampaignOverviewSender.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetExtendedCampaignOverviewAllOfSender do + let(:instance) { SibApiV3Sdk::GetExtendedCampaignOverviewAllOfSender.new } - describe 'test an instance of GetExtendedCampaignOverviewSender' do - it 'should create an instance of GetExtendedCampaignOverviewSender' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetExtendedCampaignOverviewSender) + describe 'test an instance of GetExtendedCampaignOverviewAllOfSender' do + it 'should create an instance of GetExtendedCampaignOverviewAllOfSender' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedCampaignOverviewAllOfSender) end end describe 'test attribute "name"' do diff --git a/spec/models/get_extended_campaign_overview_all_of_spec.rb b/spec/models/get_extended_campaign_overview_all_of_spec.rb new file mode 100644 index 0000000..4b2dd66 --- /dev/null +++ b/spec/models/get_extended_campaign_overview_all_of_spec.rb @@ -0,0 +1,124 @@ +=begin +#SendinBlue API + +#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 | + +The version of the OpenAPI document: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SibApiV3Sdk::GetExtendedCampaignOverviewAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe SibApiV3Sdk::GetExtendedCampaignOverviewAllOf do + let(:instance) { SibApiV3Sdk::GetExtendedCampaignOverviewAllOf.new } + + describe 'test an instance of GetExtendedCampaignOverviewAllOf' do + it 'should create an instance of GetExtendedCampaignOverviewAllOf' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedCampaignOverviewAllOf) + end + end + describe 'test attribute "test_sent"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "header"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "footer"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sender"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "reply_to"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "to_field"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "html_content"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "share_link"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "created_at"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "modified_at"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "inline_image_activation"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "mirror_active"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "recurring"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sent_date"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "return_bounce"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/get_extended_campaign_overview_spec.rb b/spec/models/get_extended_campaign_overview_spec.rb index d87b935..b0b60aa 100644 --- a/spec/models/get_extended_campaign_overview_spec.rb +++ b/spec/models/get_extended_campaign_overview_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetExtendedCampaignOverview -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetExtendedCampaignOverview' do - before do - # run before each test - @instance = SibApiV3Sdk::GetExtendedCampaignOverview.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetExtendedCampaignOverview do + let(:instance) { SibApiV3Sdk::GetExtendedCampaignOverview.new } describe 'test an instance of GetExtendedCampaignOverview' do it 'should create an instance of GetExtendedCampaignOverview' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetExtendedCampaignOverview) + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedCampaignOverview) end end describe 'test attribute "id"' do @@ -55,7 +48,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["classic", "trigger"]) # validator.allowable_values.each do |value| - # expect { @instance.type = value }.not_to raise_error + # expect { instance.type = value }.not_to raise_error # end end end @@ -65,7 +58,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["draft", "sent", "archive", "queued", "suspended", "in_process"]) # validator.allowable_values.each do |value| - # expect { @instance.status = value }.not_to raise_error + # expect { instance.status = value }.not_to raise_error # end end end diff --git a/spec/models/get_extended_campaign_stats_spec.rb b/spec/models/get_extended_campaign_stats_spec.rb index ee57cbb..dbd0c0a 100644 --- a/spec/models/get_extended_campaign_stats_spec.rb +++ b/spec/models/get_extended_campaign_stats_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetExtendedCampaignStats -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetExtendedCampaignStats' do - before do - # run before each test - @instance = SibApiV3Sdk::GetExtendedCampaignStats.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetExtendedCampaignStats do + let(:instance) { SibApiV3Sdk::GetExtendedCampaignStats.new } describe 'test an instance of GetExtendedCampaignStats' do it 'should create an instance of GetExtendedCampaignStats' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetExtendedCampaignStats) + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedCampaignStats) end end describe 'test attribute "global_stats"' do diff --git a/spec/models/get_extended_client_address_spec.rb b/spec/models/get_extended_client_all_of_address_spec.rb similarity index 72% rename from spec/models/get_extended_client_address_spec.rb rename to spec/models/get_extended_client_all_of_address_spec.rb index cdab139..5749eb8 100644 --- a/spec/models/get_extended_client_address_spec.rb +++ b/spec/models/get_extended_client_all_of_address_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetExtendedClientAddress -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetExtendedClientAllOfAddress +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetExtendedClientAddress' do - before do - # run before each test - @instance = SibApiV3Sdk::GetExtendedClientAddress.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetExtendedClientAllOfAddress do + let(:instance) { SibApiV3Sdk::GetExtendedClientAllOfAddress.new } - describe 'test an instance of GetExtendedClientAddress' do - it 'should create an instance of GetExtendedClientAddress' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetExtendedClientAddress) + describe 'test an instance of GetExtendedClientAllOfAddress' do + it 'should create an instance of GetExtendedClientAllOfAddress' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedClientAllOfAddress) end end describe 'test attribute "street"' do diff --git a/spec/models/get_extended_campaign_stats_global_stats_spec.rb b/spec/models/get_extended_client_all_of_spec.rb similarity index 58% rename from spec/models/get_extended_campaign_stats_global_stats_spec.rb rename to spec/models/get_extended_client_all_of_spec.rb index cf99c5b..3121674 100644 --- a/spec/models/get_extended_campaign_stats_global_stats_spec.rb +++ b/spec/models/get_extended_client_all_of_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,21 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetExtendedCampaignStatsGlobalStats -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetExtendedClientAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetExtendedCampaignStatsGlobalStats' do - before do - # run before each test - @instance = SibApiV3Sdk::GetExtendedCampaignStatsGlobalStats.new - end +describe SibApiV3Sdk::GetExtendedClientAllOf do + let(:instance) { SibApiV3Sdk::GetExtendedClientAllOf.new } - after do - # run after each test + describe 'test an instance of GetExtendedClientAllOf' do + it 'should create an instance of GetExtendedClientAllOf' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedClientAllOf) + end end - - describe 'test an instance of GetExtendedCampaignStatsGlobalStats' do - it 'should create an instance of GetExtendedCampaignStatsGlobalStats' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetExtendedCampaignStatsGlobalStats) + describe 'test attribute "address"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end + end diff --git a/spec/models/get_extended_client_spec.rb b/spec/models/get_extended_client_spec.rb index 7ecdf3e..826d686 100644 --- a/spec/models/get_extended_client_spec.rb +++ b/spec/models/get_extended_client_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetExtendedClient -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetExtendedClient' do - before do - # run before each test - @instance = SibApiV3Sdk::GetExtendedClient.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetExtendedClient do + let(:instance) { SibApiV3Sdk::GetExtendedClient.new } describe 'test an instance of GetExtendedClient' do it 'should create an instance of GetExtendedClient' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetExtendedClient) + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedClient) end end describe 'test attribute "email"' do diff --git a/spec/models/get_extended_contact_details_all_of_spec.rb b/spec/models/get_extended_contact_details_all_of_spec.rb new file mode 100644 index 0000000..ec3aaee --- /dev/null +++ b/spec/models/get_extended_contact_details_all_of_spec.rb @@ -0,0 +1,34 @@ +=begin +#SendinBlue API + +#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 | + +The version of the OpenAPI document: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SibApiV3Sdk::GetExtendedContactDetailsAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe SibApiV3Sdk::GetExtendedContactDetailsAllOf do + let(:instance) { SibApiV3Sdk::GetExtendedContactDetailsAllOf.new } + + describe 'test an instance of GetExtendedContactDetailsAllOf' do + it 'should create an instance of GetExtendedContactDetailsAllOf' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetailsAllOf) + end + end + describe 'test attribute "statistics"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/get_extended_contact_details_statistics_clicked_spec.rb b/spec/models/get_extended_contact_details_all_of_statistics_clicked_spec.rb similarity index 65% rename from spec/models/get_extended_contact_details_statistics_clicked_spec.rb rename to spec/models/get_extended_contact_details_all_of_statistics_clicked_spec.rb index 9101d2a..86bf2f5 100644 --- a/spec/models/get_extended_contact_details_statistics_clicked_spec.rb +++ b/spec/models/get_extended_contact_details_all_of_statistics_clicked_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetExtendedContactDetailsStatisticsClicked -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsClicked +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetExtendedContactDetailsStatisticsClicked' do - before do - # run before each test - @instance = SibApiV3Sdk::GetExtendedContactDetailsStatisticsClicked.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsClicked do + let(:instance) { SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsClicked.new } - describe 'test an instance of GetExtendedContactDetailsStatisticsClicked' do - it 'should create an instance of GetExtendedContactDetailsStatisticsClicked' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetailsStatisticsClicked) + describe 'test an instance of GetExtendedContactDetailsAllOfStatisticsClicked' do + it 'should create an instance of GetExtendedContactDetailsAllOfStatisticsClicked' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsClicked) end end describe 'test attribute "campaign_id"' do diff --git a/spec/models/get_extended_contact_details_statistics_links_spec.rb b/spec/models/get_extended_contact_details_all_of_statistics_links_spec.rb similarity index 70% rename from spec/models/get_extended_contact_details_statistics_links_spec.rb rename to spec/models/get_extended_contact_details_all_of_statistics_links_spec.rb index 2a75657..95e2ab6 100644 --- a/spec/models/get_extended_contact_details_statistics_links_spec.rb +++ b/spec/models/get_extended_contact_details_all_of_statistics_links_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetExtendedContactDetailsStatisticsLinks -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsLinks +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetExtendedContactDetailsStatisticsLinks' do - before do - # run before each test - @instance = SibApiV3Sdk::GetExtendedContactDetailsStatisticsLinks.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsLinks do + let(:instance) { SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsLinks.new } - describe 'test an instance of GetExtendedContactDetailsStatisticsLinks' do - it 'should create an instance of GetExtendedContactDetailsStatisticsLinks' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetailsStatisticsLinks) + describe 'test an instance of GetExtendedContactDetailsAllOfStatisticsLinks' do + it 'should create an instance of GetExtendedContactDetailsAllOfStatisticsLinks' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsLinks) end end describe 'test attribute "count"' do diff --git a/spec/models/get_extended_contact_details_statistics_messages_sent_spec.rb b/spec/models/get_extended_contact_details_all_of_statistics_messages_sent_spec.rb similarity index 64% rename from spec/models/get_extended_contact_details_statistics_messages_sent_spec.rb rename to spec/models/get_extended_contact_details_all_of_statistics_messages_sent_spec.rb index b5f5a86..439d496 100644 --- a/spec/models/get_extended_contact_details_statistics_messages_sent_spec.rb +++ b/spec/models/get_extended_contact_details_all_of_statistics_messages_sent_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetExtendedContactDetailsStatisticsMessagesSent -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsMessagesSent +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetExtendedContactDetailsStatisticsMessagesSent' do - before do - # run before each test - @instance = SibApiV3Sdk::GetExtendedContactDetailsStatisticsMessagesSent.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsMessagesSent do + let(:instance) { SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsMessagesSent.new } - describe 'test an instance of GetExtendedContactDetailsStatisticsMessagesSent' do - it 'should create an instance of GetExtendedContactDetailsStatisticsMessagesSent' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetailsStatisticsMessagesSent) + describe 'test an instance of GetExtendedContactDetailsAllOfStatisticsMessagesSent' do + it 'should create an instance of GetExtendedContactDetailsAllOfStatisticsMessagesSent' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsMessagesSent) end end describe 'test attribute "campaign_id"' do diff --git a/spec/models/get_extended_contact_details_statistics_opened_spec.rb b/spec/models/get_extended_contact_details_all_of_statistics_opened_spec.rb similarity index 70% rename from spec/models/get_extended_contact_details_statistics_opened_spec.rb rename to spec/models/get_extended_contact_details_all_of_statistics_opened_spec.rb index 1e3eaed..873b5f8 100644 --- a/spec/models/get_extended_contact_details_statistics_opened_spec.rb +++ b/spec/models/get_extended_contact_details_all_of_statistics_opened_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetExtendedContactDetailsStatisticsOpened -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsOpened +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetExtendedContactDetailsStatisticsOpened' do - before do - # run before each test - @instance = SibApiV3Sdk::GetExtendedContactDetailsStatisticsOpened.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsOpened do + let(:instance) { SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsOpened.new } - describe 'test an instance of GetExtendedContactDetailsStatisticsOpened' do - it 'should create an instance of GetExtendedContactDetailsStatisticsOpened' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetailsStatisticsOpened) + describe 'test an instance of GetExtendedContactDetailsAllOfStatisticsOpened' do + it 'should create an instance of GetExtendedContactDetailsAllOfStatisticsOpened' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsOpened) end end describe 'test attribute "campaign_id"' do diff --git a/spec/models/get_extended_contact_details_statistics_spec.rb b/spec/models/get_extended_contact_details_all_of_statistics_spec.rb similarity index 78% rename from spec/models/get_extended_contact_details_statistics_spec.rb rename to spec/models/get_extended_contact_details_all_of_statistics_spec.rb index 593f571..510afbf 100644 --- a/spec/models/get_extended_contact_details_statistics_spec.rb +++ b/spec/models/get_extended_contact_details_all_of_statistics_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetExtendedContactDetailsStatistics -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetExtendedContactDetailsAllOfStatistics +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetExtendedContactDetailsStatistics' do - before do - # run before each test - @instance = SibApiV3Sdk::GetExtendedContactDetailsStatistics.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetExtendedContactDetailsAllOfStatistics do + let(:instance) { SibApiV3Sdk::GetExtendedContactDetailsAllOfStatistics.new } - describe 'test an instance of GetExtendedContactDetailsStatistics' do - it 'should create an instance of GetExtendedContactDetailsStatistics' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetailsStatistics) + describe 'test an instance of GetExtendedContactDetailsAllOfStatistics' do + it 'should create an instance of GetExtendedContactDetailsAllOfStatistics' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetailsAllOfStatistics) end end describe 'test attribute "messages_sent"' do diff --git a/spec/models/get_extended_contact_details_statistics_unsubscriptions_admin_unsubscription_spec.rb b/spec/models/get_extended_contact_details_all_of_statistics_unsubscriptions_admin_unsubscription_spec.rb similarity index 61% rename from spec/models/get_extended_contact_details_statistics_unsubscriptions_admin_unsubscription_spec.rb rename to spec/models/get_extended_contact_details_all_of_statistics_unsubscriptions_admin_unsubscription_spec.rb index 19d940b..c297150 100644 --- a/spec/models/get_extended_contact_details_statistics_unsubscriptions_admin_unsubscription_spec.rb +++ b/spec/models/get_extended_contact_details_all_of_statistics_unsubscriptions_admin_unsubscription_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription' do - before do - # run before each test - @instance = SibApiV3Sdk::GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription do + let(:instance) { SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription.new } - describe 'test an instance of GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription' do - it 'should create an instance of GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetailsStatisticsUnsubscriptionsAdminUnsubscription) + describe 'test an instance of GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription' do + it 'should create an instance of GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsAdminUnsubscription) end end describe 'test attribute "event_time"' do diff --git a/spec/models/get_extended_contact_details_statistics_unsubscriptions_spec.rb b/spec/models/get_extended_contact_details_all_of_statistics_unsubscriptions_spec.rb similarity index 64% rename from spec/models/get_extended_contact_details_statistics_unsubscriptions_spec.rb rename to spec/models/get_extended_contact_details_all_of_statistics_unsubscriptions_spec.rb index 8dfbabb..cbc99de 100644 --- a/spec/models/get_extended_contact_details_statistics_unsubscriptions_spec.rb +++ b/spec/models/get_extended_contact_details_all_of_statistics_unsubscriptions_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetExtendedContactDetailsStatisticsUnsubscriptions -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptions +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetExtendedContactDetailsStatisticsUnsubscriptions' do - before do - # run before each test - @instance = SibApiV3Sdk::GetExtendedContactDetailsStatisticsUnsubscriptions.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptions do + let(:instance) { SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptions.new } - describe 'test an instance of GetExtendedContactDetailsStatisticsUnsubscriptions' do - it 'should create an instance of GetExtendedContactDetailsStatisticsUnsubscriptions' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetailsStatisticsUnsubscriptions) + describe 'test an instance of GetExtendedContactDetailsAllOfStatisticsUnsubscriptions' do + it 'should create an instance of GetExtendedContactDetailsAllOfStatisticsUnsubscriptions' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptions) end end describe 'test attribute "user_unsubscription"' do diff --git a/spec/models/get_extended_contact_details_statistics_unsubscriptions_user_unsubscription_spec.rb b/spec/models/get_extended_contact_details_all_of_statistics_unsubscriptions_user_unsubscription_spec.rb similarity index 64% rename from spec/models/get_extended_contact_details_statistics_unsubscriptions_user_unsubscription_spec.rb rename to spec/models/get_extended_contact_details_all_of_statistics_unsubscriptions_user_unsubscription_spec.rb index 88bc6f6..96cb7b3 100644 --- a/spec/models/get_extended_contact_details_statistics_unsubscriptions_user_unsubscription_spec.rb +++ b/spec/models/get_extended_contact_details_all_of_statistics_unsubscriptions_user_unsubscription_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription' do - before do - # run before each test - @instance = SibApiV3Sdk::GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription do + let(:instance) { SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription.new } - describe 'test an instance of GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription' do - it 'should create an instance of GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetailsStatisticsUnsubscriptionsUserUnsubscription) + describe 'test an instance of GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription' do + it 'should create an instance of GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetailsAllOfStatisticsUnsubscriptionsUserUnsubscription) end end describe 'test attribute "campaign_id"' do diff --git a/spec/models/get_extended_contact_details_spec.rb b/spec/models/get_extended_contact_details_spec.rb index ce05326..4da57b6 100644 --- a/spec/models/get_extended_contact_details_spec.rb +++ b/spec/models/get_extended_contact_details_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetExtendedContactDetails -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetExtendedContactDetails' do - before do - # run before each test - @instance = SibApiV3Sdk::GetExtendedContactDetails.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetExtendedContactDetails do + let(:instance) { SibApiV3Sdk::GetExtendedContactDetails.new } describe 'test an instance of GetExtendedContactDetails' do it 'should create an instance of GetExtendedContactDetails' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetails) + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedContactDetails) end end describe 'test attribute "email"' do diff --git a/spec/models/get_extended_list_campaign_stats_spec.rb b/spec/models/get_extended_list_all_of_campaign_stats_spec.rb similarity index 67% rename from spec/models/get_extended_list_campaign_stats_spec.rb rename to spec/models/get_extended_list_all_of_campaign_stats_spec.rb index 49dae32..bcc4f0d 100644 --- a/spec/models/get_extended_list_campaign_stats_spec.rb +++ b/spec/models/get_extended_list_all_of_campaign_stats_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -14,22 +14,15 @@ require 'json' require 'date' -# Unit tests for SibApiV3Sdk::GetExtendedListCampaignStats -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Unit tests for SibApiV3Sdk::GetExtendedListAllOfCampaignStats +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetExtendedListCampaignStats' do - before do - # run before each test - @instance = SibApiV3Sdk::GetExtendedListCampaignStats.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetExtendedListAllOfCampaignStats do + let(:instance) { SibApiV3Sdk::GetExtendedListAllOfCampaignStats.new } - describe 'test an instance of GetExtendedListCampaignStats' do - it 'should create an instance of GetExtendedListCampaignStats' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetExtendedListCampaignStats) + describe 'test an instance of GetExtendedListAllOfCampaignStats' do + it 'should create an instance of GetExtendedListAllOfCampaignStats' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedListAllOfCampaignStats) end end describe 'test attribute "campaign_id"' do diff --git a/spec/models/get_extended_list_all_of_spec.rb b/spec/models/get_extended_list_all_of_spec.rb new file mode 100644 index 0000000..9cd37cd --- /dev/null +++ b/spec/models/get_extended_list_all_of_spec.rb @@ -0,0 +1,52 @@ +=begin +#SendinBlue API + +#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 | + +The version of the OpenAPI document: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SibApiV3Sdk::GetExtendedListAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe SibApiV3Sdk::GetExtendedListAllOf do + let(:instance) { SibApiV3Sdk::GetExtendedListAllOf.new } + + describe 'test an instance of GetExtendedListAllOf' do + it 'should create an instance of GetExtendedListAllOf' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedListAllOf) + end + end + describe 'test attribute "folder_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "created_at"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "campaign_stats"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "dynamic_list"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/get_extended_list_spec.rb b/spec/models/get_extended_list_spec.rb index 7522d05..39711cb 100644 --- a/spec/models/get_extended_list_spec.rb +++ b/spec/models/get_extended_list_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetExtendedList -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetExtendedList' do - before do - # run before each test - @instance = SibApiV3Sdk::GetExtendedList.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetExtendedList do + let(:instance) { SibApiV3Sdk::GetExtendedList.new } describe 'test an instance of GetExtendedList' do it 'should create an instance of GetExtendedList' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetExtendedList) + expect(instance).to be_instance_of(SibApiV3Sdk::GetExtendedList) end end describe 'test attribute "id"' do @@ -56,6 +49,12 @@ end end + describe 'test attribute "unique_subscribers"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + describe 'test attribute "folder_id"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/spec/models/get_folder_lists_spec.rb b/spec/models/get_folder_lists_spec.rb index 3ccc8c9..6d4c367 100644 --- a/spec/models/get_folder_lists_spec.rb +++ b/spec/models/get_folder_lists_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetFolderLists -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetFolderLists' do - before do - # run before each test - @instance = SibApiV3Sdk::GetFolderLists.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetFolderLists do + let(:instance) { SibApiV3Sdk::GetFolderLists.new } describe 'test an instance of GetFolderLists' do it 'should create an instance of GetFolderLists' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetFolderLists) + expect(instance).to be_instance_of(SibApiV3Sdk::GetFolderLists) end end describe 'test attribute "lists"' do diff --git a/spec/models/get_folder_spec.rb b/spec/models/get_folder_spec.rb index ebfcbd7..f4199fc 100644 --- a/spec/models/get_folder_spec.rb +++ b/spec/models/get_folder_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetFolder -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetFolder' do - before do - # run before each test - @instance = SibApiV3Sdk::GetFolder.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetFolder do + let(:instance) { SibApiV3Sdk::GetFolder.new } describe 'test an instance of GetFolder' do it 'should create an instance of GetFolder' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetFolder) + expect(instance).to be_instance_of(SibApiV3Sdk::GetFolder) end end describe 'test attribute "id"' do diff --git a/spec/models/get_folders_spec.rb b/spec/models/get_folders_spec.rb index b39bbf8..63bbd0f 100644 --- a/spec/models/get_folders_spec.rb +++ b/spec/models/get_folders_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetFolders -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetFolders' do - before do - # run before each test - @instance = SibApiV3Sdk::GetFolders.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetFolders do + let(:instance) { SibApiV3Sdk::GetFolders.new } describe 'test an instance of GetFolders' do it 'should create an instance of GetFolders' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetFolders) + expect(instance).to be_instance_of(SibApiV3Sdk::GetFolders) end end describe 'test attribute "folders"' do diff --git a/spec/models/get_ip_from_sender_spec.rb b/spec/models/get_ip_from_sender_spec.rb index f5c2b6f..bbd3031 100644 --- a/spec/models/get_ip_from_sender_spec.rb +++ b/spec/models/get_ip_from_sender_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetIpFromSender -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetIpFromSender' do - before do - # run before each test - @instance = SibApiV3Sdk::GetIpFromSender.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetIpFromSender do + let(:instance) { SibApiV3Sdk::GetIpFromSender.new } describe 'test an instance of GetIpFromSender' do it 'should create an instance of GetIpFromSender' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetIpFromSender) + expect(instance).to be_instance_of(SibApiV3Sdk::GetIpFromSender) end end describe 'test attribute "id"' do diff --git a/spec/models/get_ip_spec.rb b/spec/models/get_ip_spec.rb index 9eae9f6..14eee0d 100644 --- a/spec/models/get_ip_spec.rb +++ b/spec/models/get_ip_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetIp -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetIp' do - before do - # run before each test - @instance = SibApiV3Sdk::GetIp.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetIp do + let(:instance) { SibApiV3Sdk::GetIp.new } describe 'test an instance of GetIp' do it 'should create an instance of GetIp' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetIp) + expect(instance).to be_instance_of(SibApiV3Sdk::GetIp) end end describe 'test attribute "id"' do diff --git a/spec/models/get_ips_from_sender_spec.rb b/spec/models/get_ips_from_sender_spec.rb index b397e3d..47ea340 100644 --- a/spec/models/get_ips_from_sender_spec.rb +++ b/spec/models/get_ips_from_sender_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetIpsFromSender -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetIpsFromSender' do - before do - # run before each test - @instance = SibApiV3Sdk::GetIpsFromSender.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetIpsFromSender do + let(:instance) { SibApiV3Sdk::GetIpsFromSender.new } describe 'test an instance of GetIpsFromSender' do it 'should create an instance of GetIpsFromSender' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetIpsFromSender) + expect(instance).to be_instance_of(SibApiV3Sdk::GetIpsFromSender) end end describe 'test attribute "ips"' do diff --git a/spec/models/get_ips_spec.rb b/spec/models/get_ips_spec.rb index ca9afd5..b438831 100644 --- a/spec/models/get_ips_spec.rb +++ b/spec/models/get_ips_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetIps -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetIps' do - before do - # run before each test - @instance = SibApiV3Sdk::GetIps.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetIps do + let(:instance) { SibApiV3Sdk::GetIps.new } describe 'test an instance of GetIps' do it 'should create an instance of GetIps' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetIps) + expect(instance).to be_instance_of(SibApiV3Sdk::GetIps) end end describe 'test attribute "ips"' do diff --git a/spec/models/get_list_spec.rb b/spec/models/get_list_spec.rb index ed1daf0..8ff5781 100644 --- a/spec/models/get_list_spec.rb +++ b/spec/models/get_list_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetList -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetList' do - before do - # run before each test - @instance = SibApiV3Sdk::GetList.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetList do + let(:instance) { SibApiV3Sdk::GetList.new } describe 'test an instance of GetList' do it 'should create an instance of GetList' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetList) + expect(instance).to be_instance_of(SibApiV3Sdk::GetList) end end describe 'test attribute "id"' do @@ -56,4 +49,10 @@ end end + describe 'test attribute "unique_subscribers"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/spec/models/get_lists_spec.rb b/spec/models/get_lists_spec.rb index 3c371a8..b4ed5fd 100644 --- a/spec/models/get_lists_spec.rb +++ b/spec/models/get_lists_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetLists -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetLists' do - before do - # run before each test - @instance = SibApiV3Sdk::GetLists.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetLists do + let(:instance) { SibApiV3Sdk::GetLists.new } describe 'test an instance of GetLists' do it 'should create an instance of GetLists' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetLists) + expect(instance).to be_instance_of(SibApiV3Sdk::GetLists) end end describe 'test attribute "lists"' do diff --git a/spec/models/get_process_spec.rb b/spec/models/get_process_spec.rb index 77df5b6..c1fcb16 100644 --- a/spec/models/get_process_spec.rb +++ b/spec/models/get_process_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetProcess -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetProcess' do - before do - # run before each test - @instance = SibApiV3Sdk::GetProcess.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetProcess do + let(:instance) { SibApiV3Sdk::GetProcess.new } describe 'test an instance of GetProcess' do it 'should create an instance of GetProcess' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetProcess) + expect(instance).to be_instance_of(SibApiV3Sdk::GetProcess) end end describe 'test attribute "id"' do @@ -43,7 +36,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["queued", "in_process", "completed"]) # validator.allowable_values.each do |value| - # expect { @instance.status = value }.not_to raise_error + # expect { instance.status = value }.not_to raise_error # end end end diff --git a/spec/models/get_processes_spec.rb b/spec/models/get_processes_spec.rb index ba1e595..3070c11 100644 --- a/spec/models/get_processes_spec.rb +++ b/spec/models/get_processes_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetProcesses -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetProcesses' do - before do - # run before each test - @instance = SibApiV3Sdk::GetProcesses.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetProcesses do + let(:instance) { SibApiV3Sdk::GetProcesses.new } describe 'test an instance of GetProcesses' do it 'should create an instance of GetProcesses' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetProcesses) + expect(instance).to be_instance_of(SibApiV3Sdk::GetProcesses) end end describe 'test attribute "processes"' do diff --git a/spec/models/get_reports_reports_spec.rb b/spec/models/get_reports_reports_spec.rb index b910f31..f16af85 100644 --- a/spec/models/get_reports_reports_spec.rb +++ b/spec/models/get_reports_reports_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetReportsReports -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetReportsReports' do - before do - # run before each test - @instance = SibApiV3Sdk::GetReportsReports.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetReportsReports do + let(:instance) { SibApiV3Sdk::GetReportsReports.new } describe 'test an instance of GetReportsReports' do it 'should create an instance of GetReportsReports' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetReportsReports) + expect(instance).to be_instance_of(SibApiV3Sdk::GetReportsReports) end end describe 'test attribute "date"' do diff --git a/spec/models/get_reports_spec.rb b/spec/models/get_reports_spec.rb index 57a9db9..3e96c16 100644 --- a/spec/models/get_reports_spec.rb +++ b/spec/models/get_reports_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetReports -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetReports' do - before do - # run before each test - @instance = SibApiV3Sdk::GetReports.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetReports do + let(:instance) { SibApiV3Sdk::GetReports.new } describe 'test an instance of GetReports' do it 'should create an instance of GetReports' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetReports) + expect(instance).to be_instance_of(SibApiV3Sdk::GetReports) end end describe 'test attribute "reports"' do diff --git a/spec/models/get_senders_list_ips_spec.rb b/spec/models/get_senders_list_ips_spec.rb index 5fb6866..582ea34 100644 --- a/spec/models/get_senders_list_ips_spec.rb +++ b/spec/models/get_senders_list_ips_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetSendersListIps -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetSendersListIps' do - before do - # run before each test - @instance = SibApiV3Sdk::GetSendersListIps.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetSendersListIps do + let(:instance) { SibApiV3Sdk::GetSendersListIps.new } describe 'test an instance of GetSendersListIps' do it 'should create an instance of GetSendersListIps' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetSendersListIps) + expect(instance).to be_instance_of(SibApiV3Sdk::GetSendersListIps) end end describe 'test attribute "ip"' do diff --git a/spec/models/get_senders_list_senders_spec.rb b/spec/models/get_senders_list_senders_spec.rb index c962fec..d6ed899 100644 --- a/spec/models/get_senders_list_senders_spec.rb +++ b/spec/models/get_senders_list_senders_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetSendersListSenders -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetSendersListSenders' do - before do - # run before each test - @instance = SibApiV3Sdk::GetSendersListSenders.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetSendersListSenders do + let(:instance) { SibApiV3Sdk::GetSendersListSenders.new } describe 'test an instance of GetSendersListSenders' do it 'should create an instance of GetSendersListSenders' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetSendersListSenders) + expect(instance).to be_instance_of(SibApiV3Sdk::GetSendersListSenders) end end describe 'test attribute "id"' do diff --git a/spec/models/get_senders_list_spec.rb b/spec/models/get_senders_list_spec.rb index ddcdbb9..02ed8fe 100644 --- a/spec/models/get_senders_list_spec.rb +++ b/spec/models/get_senders_list_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetSendersList -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetSendersList' do - before do - # run before each test - @instance = SibApiV3Sdk::GetSendersList.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetSendersList do + let(:instance) { SibApiV3Sdk::GetSendersList.new } describe 'test an instance of GetSendersList' do it 'should create an instance of GetSendersList' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetSendersList) + expect(instance).to be_instance_of(SibApiV3Sdk::GetSendersList) end end describe 'test attribute "senders"' do diff --git a/spec/models/get_shared_template_url_spec.rb b/spec/models/get_shared_template_url_spec.rb index 74bf991..6d60b70 100644 --- a/spec/models/get_shared_template_url_spec.rb +++ b/spec/models/get_shared_template_url_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetSharedTemplateUrl -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetSharedTemplateUrl' do - before do - # run before each test - @instance = SibApiV3Sdk::GetSharedTemplateUrl.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetSharedTemplateUrl do + let(:instance) { SibApiV3Sdk::GetSharedTemplateUrl.new } describe 'test an instance of GetSharedTemplateUrl' do it 'should create an instance of GetSharedTemplateUrl' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetSharedTemplateUrl) + expect(instance).to be_instance_of(SibApiV3Sdk::GetSharedTemplateUrl) end end describe 'test attribute "shared_url"' do diff --git a/spec/models/get_sms_campaign_all_of_spec.rb b/spec/models/get_sms_campaign_all_of_spec.rb new file mode 100644 index 0000000..96b11e7 --- /dev/null +++ b/spec/models/get_sms_campaign_all_of_spec.rb @@ -0,0 +1,40 @@ +=begin +#SendinBlue API + +#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 | + +The version of the OpenAPI document: 3.0.0 +Contact: contact@sendinblue.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for SibApiV3Sdk::GetSmsCampaignAllOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe SibApiV3Sdk::GetSmsCampaignAllOf do + let(:instance) { SibApiV3Sdk::GetSmsCampaignAllOf.new } + + describe 'test an instance of GetSmsCampaignAllOf' do + it 'should create an instance of GetSmsCampaignAllOf' do + expect(instance).to be_instance_of(SibApiV3Sdk::GetSmsCampaignAllOf) + end + end + describe 'test attribute "recipients"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "statistics"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/get_sms_campaign_overview_spec.rb b/spec/models/get_sms_campaign_overview_spec.rb index dbf8ef1..d524af5 100644 --- a/spec/models/get_sms_campaign_overview_spec.rb +++ b/spec/models/get_sms_campaign_overview_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetSmsCampaignOverview -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetSmsCampaignOverview' do - before do - # run before each test - @instance = SibApiV3Sdk::GetSmsCampaignOverview.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetSmsCampaignOverview do + let(:instance) { SibApiV3Sdk::GetSmsCampaignOverview.new } describe 'test an instance of GetSmsCampaignOverview' do it 'should create an instance of GetSmsCampaignOverview' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetSmsCampaignOverview) + expect(instance).to be_instance_of(SibApiV3Sdk::GetSmsCampaignOverview) end end describe 'test attribute "id"' do @@ -49,7 +42,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["draft", "sent", "archive", "queued", "suspended", "inProcess"]) # validator.allowable_values.each do |value| - # expect { @instance.status = value }.not_to raise_error + # expect { instance.status = value }.not_to raise_error # end end end diff --git a/spec/models/get_sms_campaign_recipients_spec.rb b/spec/models/get_sms_campaign_recipients_spec.rb deleted file mode 100644 index 1676317..0000000 --- a/spec/models/get_sms_campaign_recipients_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -=begin -#SendinBlue API - -#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 | - -OpenAPI spec version: 3.0.0 -Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for SibApiV3Sdk::GetSmsCampaignRecipients -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) -# Please update as you see appropriate -describe 'GetSmsCampaignRecipients' do - before do - # run before each test - @instance = SibApiV3Sdk::GetSmsCampaignRecipients.new - end - - after do - # run after each test - end - - describe 'test an instance of GetSmsCampaignRecipients' do - it 'should create an instance of GetSmsCampaignRecipients' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetSmsCampaignRecipients) - end - end -end diff --git a/spec/models/get_sms_campaign_spec.rb b/spec/models/get_sms_campaign_spec.rb index f32dfb9..b9dd91f 100644 --- a/spec/models/get_sms_campaign_spec.rb +++ b/spec/models/get_sms_campaign_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetSmsCampaign -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetSmsCampaign' do - before do - # run before each test - @instance = SibApiV3Sdk::GetSmsCampaign.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetSmsCampaign do + let(:instance) { SibApiV3Sdk::GetSmsCampaign.new } describe 'test an instance of GetSmsCampaign' do it 'should create an instance of GetSmsCampaign' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetSmsCampaign) + expect(instance).to be_instance_of(SibApiV3Sdk::GetSmsCampaign) end end describe 'test attribute "id"' do @@ -49,7 +42,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["draft", "sent", "archive", "queued", "suspended", "inProcess"]) # validator.allowable_values.each do |value| - # expect { @instance.status = value }.not_to raise_error + # expect { instance.status = value }.not_to raise_error # end end end diff --git a/spec/models/get_sms_campaign_stats_spec.rb b/spec/models/get_sms_campaign_stats_spec.rb index a6f20d3..bf98b17 100644 --- a/spec/models/get_sms_campaign_stats_spec.rb +++ b/spec/models/get_sms_campaign_stats_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetSmsCampaignStats -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetSmsCampaignStats' do - before do - # run before each test - @instance = SibApiV3Sdk::GetSmsCampaignStats.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetSmsCampaignStats do + let(:instance) { SibApiV3Sdk::GetSmsCampaignStats.new } describe 'test an instance of GetSmsCampaignStats' do it 'should create an instance of GetSmsCampaignStats' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetSmsCampaignStats) + expect(instance).to be_instance_of(SibApiV3Sdk::GetSmsCampaignStats) end end describe 'test attribute "delivered"' do diff --git a/spec/models/get_sms_campaigns_spec.rb b/spec/models/get_sms_campaigns_spec.rb index 930d558..d59ff59 100644 --- a/spec/models/get_sms_campaigns_spec.rb +++ b/spec/models/get_sms_campaigns_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetSmsCampaigns -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetSmsCampaigns' do - before do - # run before each test - @instance = SibApiV3Sdk::GetSmsCampaigns.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetSmsCampaigns do + let(:instance) { SibApiV3Sdk::GetSmsCampaigns.new } describe 'test an instance of GetSmsCampaigns' do it 'should create an instance of GetSmsCampaigns' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetSmsCampaigns) + expect(instance).to be_instance_of(SibApiV3Sdk::GetSmsCampaigns) end end describe 'test attribute "campaigns"' do diff --git a/spec/models/get_sms_event_report_events_spec.rb b/spec/models/get_sms_event_report_events_spec.rb index e1cac61..3c050d0 100644 --- a/spec/models/get_sms_event_report_events_spec.rb +++ b/spec/models/get_sms_event_report_events_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetSmsEventReportEvents -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetSmsEventReportEvents' do - before do - # run before each test - @instance = SibApiV3Sdk::GetSmsEventReportEvents.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetSmsEventReportEvents do + let(:instance) { SibApiV3Sdk::GetSmsEventReportEvents.new } describe 'test an instance of GetSmsEventReportEvents' do it 'should create an instance of GetSmsEventReportEvents' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetSmsEventReportEvents) + expect(instance).to be_instance_of(SibApiV3Sdk::GetSmsEventReportEvents) end end describe 'test attribute "phone_number"' do @@ -55,7 +48,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["bounces", "hardBounces", "softBounces", "delivered", "sent", "accepted", "unsubscription", "replies", "blocked"]) # validator.allowable_values.each do |value| - # expect { @instance.event = value }.not_to raise_error + # expect { instance.event = value }.not_to raise_error # end end end diff --git a/spec/models/get_sms_event_report_spec.rb b/spec/models/get_sms_event_report_spec.rb index 24b61a5..136882d 100644 --- a/spec/models/get_sms_event_report_spec.rb +++ b/spec/models/get_sms_event_report_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetSmsEventReport -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetSmsEventReport' do - before do - # run before each test - @instance = SibApiV3Sdk::GetSmsEventReport.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetSmsEventReport do + let(:instance) { SibApiV3Sdk::GetSmsEventReport.new } describe 'test an instance of GetSmsEventReport' do it 'should create an instance of GetSmsEventReport' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetSmsEventReport) + expect(instance).to be_instance_of(SibApiV3Sdk::GetSmsEventReport) end end describe 'test attribute "events"' do diff --git a/spec/models/get_smtp_template_overview_sender_spec.rb b/spec/models/get_smtp_template_overview_sender_spec.rb index 3a1cbec..dc078ae 100644 --- a/spec/models/get_smtp_template_overview_sender_spec.rb +++ b/spec/models/get_smtp_template_overview_sender_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetSmtpTemplateOverviewSender -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetSmtpTemplateOverviewSender' do - before do - # run before each test - @instance = SibApiV3Sdk::GetSmtpTemplateOverviewSender.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetSmtpTemplateOverviewSender do + let(:instance) { SibApiV3Sdk::GetSmtpTemplateOverviewSender.new } describe 'test an instance of GetSmtpTemplateOverviewSender' do it 'should create an instance of GetSmtpTemplateOverviewSender' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetSmtpTemplateOverviewSender) + expect(instance).to be_instance_of(SibApiV3Sdk::GetSmtpTemplateOverviewSender) end end describe 'test attribute "name"' do diff --git a/spec/models/get_smtp_template_overview_spec.rb b/spec/models/get_smtp_template_overview_spec.rb index 8eb63dd..173a0d3 100644 --- a/spec/models/get_smtp_template_overview_spec.rb +++ b/spec/models/get_smtp_template_overview_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetSmtpTemplateOverview -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetSmtpTemplateOverview' do - before do - # run before each test - @instance = SibApiV3Sdk::GetSmtpTemplateOverview.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetSmtpTemplateOverview do + let(:instance) { SibApiV3Sdk::GetSmtpTemplateOverview.new } describe 'test an instance of GetSmtpTemplateOverview' do it 'should create an instance of GetSmtpTemplateOverview' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetSmtpTemplateOverview) + expect(instance).to be_instance_of(SibApiV3Sdk::GetSmtpTemplateOverview) end end describe 'test attribute "id"' do diff --git a/spec/models/get_smtp_templates_spec.rb b/spec/models/get_smtp_templates_spec.rb index 0d72193..a29dd2a 100644 --- a/spec/models/get_smtp_templates_spec.rb +++ b/spec/models/get_smtp_templates_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetSmtpTemplates -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetSmtpTemplates' do - before do - # run before each test - @instance = SibApiV3Sdk::GetSmtpTemplates.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetSmtpTemplates do + let(:instance) { SibApiV3Sdk::GetSmtpTemplates.new } describe 'test an instance of GetSmtpTemplates' do it 'should create an instance of GetSmtpTemplates' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetSmtpTemplates) + expect(instance).to be_instance_of(SibApiV3Sdk::GetSmtpTemplates) end end describe 'test attribute "count"' do diff --git a/spec/models/get_sso_token_spec.rb b/spec/models/get_sso_token_spec.rb index ae15c5c..e90217a 100644 --- a/spec/models/get_sso_token_spec.rb +++ b/spec/models/get_sso_token_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetSsoToken -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetSsoToken' do - before do - # run before each test - @instance = SibApiV3Sdk::GetSsoToken.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetSsoToken do + let(:instance) { SibApiV3Sdk::GetSsoToken.new } describe 'test an instance of GetSsoToken' do it 'should create an instance of GetSsoToken' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetSsoToken) + expect(instance).to be_instance_of(SibApiV3Sdk::GetSsoToken) end end describe 'test attribute "token"' do diff --git a/spec/models/get_stats_by_browser_spec.rb b/spec/models/get_stats_by_browser_spec.rb deleted file mode 100644 index 3e54fc5..0000000 --- a/spec/models/get_stats_by_browser_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -=begin -#SendinBlue API - -#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 | - -OpenAPI spec version: 3.0.0 -Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for SibApiV3Sdk::GetStatsByBrowser -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) -# Please update as you see appropriate -describe 'GetStatsByBrowser' do - before do - # run before each test - @instance = SibApiV3Sdk::GetStatsByBrowser.new - end - - after do - # run after each test - end - - describe 'test an instance of GetStatsByBrowser' do - it 'should create an instance of GetStatsByBrowser' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetStatsByBrowser) - end - end -end diff --git a/spec/models/get_stats_by_device_spec.rb b/spec/models/get_stats_by_device_spec.rb index 5373620..041a010 100644 --- a/spec/models/get_stats_by_device_spec.rb +++ b/spec/models/get_stats_by_device_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetStatsByDevice -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetStatsByDevice' do - before do - # run before each test - @instance = SibApiV3Sdk::GetStatsByDevice.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetStatsByDevice do + let(:instance) { SibApiV3Sdk::GetStatsByDevice.new } describe 'test an instance of GetStatsByDevice' do it 'should create an instance of GetStatsByDevice' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetStatsByDevice) + expect(instance).to be_instance_of(SibApiV3Sdk::GetStatsByDevice) end end describe 'test attribute "desktop"' do diff --git a/spec/models/get_stats_by_domain_spec.rb b/spec/models/get_stats_by_domain_spec.rb deleted file mode 100644 index 1ff91f7..0000000 --- a/spec/models/get_stats_by_domain_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -=begin -#SendinBlue API - -#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 | - -OpenAPI spec version: 3.0.0 -Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for SibApiV3Sdk::GetStatsByDomain -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) -# Please update as you see appropriate -describe 'GetStatsByDomain' do - before do - # run before each test - @instance = SibApiV3Sdk::GetStatsByDomain.new - end - - after do - # run after each test - end - - describe 'test an instance of GetStatsByDomain' do - it 'should create an instance of GetStatsByDomain' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetStatsByDomain) - end - end -end diff --git a/spec/models/get_transac_aggregated_sms_report_spec.rb b/spec/models/get_transac_aggregated_sms_report_spec.rb index d587c05..4af61f2 100644 --- a/spec/models/get_transac_aggregated_sms_report_spec.rb +++ b/spec/models/get_transac_aggregated_sms_report_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetTransacAggregatedSmsReport -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetTransacAggregatedSmsReport' do - before do - # run before each test - @instance = SibApiV3Sdk::GetTransacAggregatedSmsReport.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetTransacAggregatedSmsReport do + let(:instance) { SibApiV3Sdk::GetTransacAggregatedSmsReport.new } describe 'test an instance of GetTransacAggregatedSmsReport' do it 'should create an instance of GetTransacAggregatedSmsReport' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetTransacAggregatedSmsReport) + expect(instance).to be_instance_of(SibApiV3Sdk::GetTransacAggregatedSmsReport) end end describe 'test attribute "range"' do diff --git a/spec/models/get_transac_blocked_contacts_contacts_spec.rb b/spec/models/get_transac_blocked_contacts_contacts_spec.rb index 28f465a..8879bf3 100644 --- a/spec/models/get_transac_blocked_contacts_contacts_spec.rb +++ b/spec/models/get_transac_blocked_contacts_contacts_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetTransacBlockedContactsContacts -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetTransacBlockedContactsContacts' do - before do - # run before each test - @instance = SibApiV3Sdk::GetTransacBlockedContactsContacts.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetTransacBlockedContactsContacts do + let(:instance) { SibApiV3Sdk::GetTransacBlockedContactsContacts.new } describe 'test an instance of GetTransacBlockedContactsContacts' do it 'should create an instance of GetTransacBlockedContactsContacts' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetTransacBlockedContactsContacts) + expect(instance).to be_instance_of(SibApiV3Sdk::GetTransacBlockedContactsContacts) end end describe 'test attribute "email"' do diff --git a/spec/models/get_transac_blocked_contacts_reason_spec.rb b/spec/models/get_transac_blocked_contacts_reason_spec.rb index 449292f..dbdc8f6 100644 --- a/spec/models/get_transac_blocked_contacts_reason_spec.rb +++ b/spec/models/get_transac_blocked_contacts_reason_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetTransacBlockedContactsReason -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetTransacBlockedContactsReason' do - before do - # run before each test - @instance = SibApiV3Sdk::GetTransacBlockedContactsReason.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetTransacBlockedContactsReason do + let(:instance) { SibApiV3Sdk::GetTransacBlockedContactsReason.new } describe 'test an instance of GetTransacBlockedContactsReason' do it 'should create an instance of GetTransacBlockedContactsReason' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetTransacBlockedContactsReason) + expect(instance).to be_instance_of(SibApiV3Sdk::GetTransacBlockedContactsReason) end end describe 'test attribute "code"' do @@ -37,7 +30,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["unsubscribedViaMA", "unsubscribedViaEmail", "adminBlocked", "unsubscribedViaApi", "hardBounce", "contactFlaggedAsSpam"]) # validator.allowable_values.each do |value| - # expect { @instance.code = value }.not_to raise_error + # expect { instance.code = value }.not_to raise_error # end end end diff --git a/spec/models/get_transac_blocked_contacts_spec.rb b/spec/models/get_transac_blocked_contacts_spec.rb index 68d57da..4c34278 100644 --- a/spec/models/get_transac_blocked_contacts_spec.rb +++ b/spec/models/get_transac_blocked_contacts_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetTransacBlockedContacts -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetTransacBlockedContacts' do - before do - # run before each test - @instance = SibApiV3Sdk::GetTransacBlockedContacts.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetTransacBlockedContacts do + let(:instance) { SibApiV3Sdk::GetTransacBlockedContacts.new } describe 'test an instance of GetTransacBlockedContacts' do it 'should create an instance of GetTransacBlockedContacts' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetTransacBlockedContacts) + expect(instance).to be_instance_of(SibApiV3Sdk::GetTransacBlockedContacts) end end describe 'test attribute "count"' do diff --git a/spec/models/get_transac_email_content_events_spec.rb b/spec/models/get_transac_email_content_events_spec.rb index e7d330d..772dc02 100644 --- a/spec/models/get_transac_email_content_events_spec.rb +++ b/spec/models/get_transac_email_content_events_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetTransacEmailContentEvents -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetTransacEmailContentEvents' do - before do - # run before each test - @instance = SibApiV3Sdk::GetTransacEmailContentEvents.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetTransacEmailContentEvents do + let(:instance) { SibApiV3Sdk::GetTransacEmailContentEvents.new } describe 'test an instance of GetTransacEmailContentEvents' do it 'should create an instance of GetTransacEmailContentEvents' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetTransacEmailContentEvents) + expect(instance).to be_instance_of(SibApiV3Sdk::GetTransacEmailContentEvents) end end describe 'test attribute "name"' do diff --git a/spec/models/get_transac_email_content_spec.rb b/spec/models/get_transac_email_content_spec.rb index fa76bb3..edeab06 100644 --- a/spec/models/get_transac_email_content_spec.rb +++ b/spec/models/get_transac_email_content_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetTransacEmailContent -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetTransacEmailContent' do - before do - # run before each test - @instance = SibApiV3Sdk::GetTransacEmailContent.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetTransacEmailContent do + let(:instance) { SibApiV3Sdk::GetTransacEmailContent.new } describe 'test an instance of GetTransacEmailContent' do it 'should create an instance of GetTransacEmailContent' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetTransacEmailContent) + expect(instance).to be_instance_of(SibApiV3Sdk::GetTransacEmailContent) end end describe 'test attribute "email"' do diff --git a/spec/models/get_transac_emails_list_spec.rb b/spec/models/get_transac_emails_list_spec.rb index 5f70b7a..f7ff45a 100644 --- a/spec/models/get_transac_emails_list_spec.rb +++ b/spec/models/get_transac_emails_list_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,23 +15,22 @@ require 'date' # Unit tests for SibApiV3Sdk::GetTransacEmailsList -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetTransacEmailsList' do - before do - # run before each test - @instance = SibApiV3Sdk::GetTransacEmailsList.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetTransacEmailsList do + let(:instance) { SibApiV3Sdk::GetTransacEmailsList.new } describe 'test an instance of GetTransacEmailsList' do it 'should create an instance of GetTransacEmailsList' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetTransacEmailsList) + expect(instance).to be_instance_of(SibApiV3Sdk::GetTransacEmailsList) + end + end + describe 'test attribute "count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end + describe 'test attribute "transactional_emails"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/spec/models/get_transac_emails_list_transactional_emails_spec.rb b/spec/models/get_transac_emails_list_transactional_emails_spec.rb index 6020bea..848320a 100644 --- a/spec/models/get_transac_emails_list_transactional_emails_spec.rb +++ b/spec/models/get_transac_emails_list_transactional_emails_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetTransacEmailsListTransactionalEmails -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetTransacEmailsListTransactionalEmails' do - before do - # run before each test - @instance = SibApiV3Sdk::GetTransacEmailsListTransactionalEmails.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetTransacEmailsListTransactionalEmails do + let(:instance) { SibApiV3Sdk::GetTransacEmailsListTransactionalEmails.new } describe 'test an instance of GetTransacEmailsListTransactionalEmails' do it 'should create an instance of GetTransacEmailsListTransactionalEmails' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetTransacEmailsListTransactionalEmails) + expect(instance).to be_instance_of(SibApiV3Sdk::GetTransacEmailsListTransactionalEmails) end end describe 'test attribute "email"' do diff --git a/spec/models/get_transac_sms_report_reports_spec.rb b/spec/models/get_transac_sms_report_reports_spec.rb index 5f07ce3..ab76d12 100644 --- a/spec/models/get_transac_sms_report_reports_spec.rb +++ b/spec/models/get_transac_sms_report_reports_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetTransacSmsReportReports -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetTransacSmsReportReports' do - before do - # run before each test - @instance = SibApiV3Sdk::GetTransacSmsReportReports.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetTransacSmsReportReports do + let(:instance) { SibApiV3Sdk::GetTransacSmsReportReports.new } describe 'test an instance of GetTransacSmsReportReports' do it 'should create an instance of GetTransacSmsReportReports' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetTransacSmsReportReports) + expect(instance).to be_instance_of(SibApiV3Sdk::GetTransacSmsReportReports) end end describe 'test attribute "date"' do diff --git a/spec/models/get_transac_sms_report_spec.rb b/spec/models/get_transac_sms_report_spec.rb index 5561556..754875c 100644 --- a/spec/models/get_transac_sms_report_spec.rb +++ b/spec/models/get_transac_sms_report_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetTransacSmsReport -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetTransacSmsReport' do - before do - # run before each test - @instance = SibApiV3Sdk::GetTransacSmsReport.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetTransacSmsReport do + let(:instance) { SibApiV3Sdk::GetTransacSmsReport.new } describe 'test an instance of GetTransacSmsReport' do it 'should create an instance of GetTransacSmsReport' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetTransacSmsReport) + expect(instance).to be_instance_of(SibApiV3Sdk::GetTransacSmsReport) end end describe 'test attribute "reports"' do diff --git a/spec/models/get_webhook_spec.rb b/spec/models/get_webhook_spec.rb index 4014a05..77fb1d0 100644 --- a/spec/models/get_webhook_spec.rb +++ b/spec/models/get_webhook_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetWebhook -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetWebhook' do - before do - # run before each test - @instance = SibApiV3Sdk::GetWebhook.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetWebhook do + let(:instance) { SibApiV3Sdk::GetWebhook.new } describe 'test an instance of GetWebhook' do it 'should create an instance of GetWebhook' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetWebhook) + expect(instance).to be_instance_of(SibApiV3Sdk::GetWebhook) end end describe 'test attribute "url"' do @@ -61,7 +54,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["marketing", "transac"]) # validator.allowable_values.each do |value| - # expect { @instance.type = value }.not_to raise_error + # expect { instance.type = value }.not_to raise_error # end end end diff --git a/spec/models/get_webhooks_spec.rb b/spec/models/get_webhooks_spec.rb index c23a4f3..9c2597f 100644 --- a/spec/models/get_webhooks_spec.rb +++ b/spec/models/get_webhooks_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::GetWebhooks -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'GetWebhooks' do - before do - # run before each test - @instance = SibApiV3Sdk::GetWebhooks.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::GetWebhooks do + let(:instance) { SibApiV3Sdk::GetWebhooks.new } describe 'test an instance of GetWebhooks' do it 'should create an instance of GetWebhooks' do - expect(@instance).to be_instance_of(SibApiV3Sdk::GetWebhooks) + expect(instance).to be_instance_of(SibApiV3Sdk::GetWebhooks) end end describe 'test attribute "webhooks"' do diff --git a/spec/models/manage_ip_spec.rb b/spec/models/manage_ip_spec.rb index d82f40c..382e672 100644 --- a/spec/models/manage_ip_spec.rb +++ b/spec/models/manage_ip_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::ManageIp -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'ManageIp' do - before do - # run before each test - @instance = SibApiV3Sdk::ManageIp.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::ManageIp do + let(:instance) { SibApiV3Sdk::ManageIp.new } describe 'test an instance of ManageIp' do it 'should create an instance of ManageIp' do - expect(@instance).to be_instance_of(SibApiV3Sdk::ManageIp) + expect(instance).to be_instance_of(SibApiV3Sdk::ManageIp) end end describe 'test attribute "ip"' do diff --git a/spec/models/post_contact_info_contacts_spec.rb b/spec/models/post_contact_info_contacts_spec.rb index dadf71c..659d962 100644 --- a/spec/models/post_contact_info_contacts_spec.rb +++ b/spec/models/post_contact_info_contacts_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::PostContactInfoContacts -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'PostContactInfoContacts' do - before do - # run before each test - @instance = SibApiV3Sdk::PostContactInfoContacts.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::PostContactInfoContacts do + let(:instance) { SibApiV3Sdk::PostContactInfoContacts.new } describe 'test an instance of PostContactInfoContacts' do it 'should create an instance of PostContactInfoContacts' do - expect(@instance).to be_instance_of(SibApiV3Sdk::PostContactInfoContacts) + expect(instance).to be_instance_of(SibApiV3Sdk::PostContactInfoContacts) end end describe 'test attribute "success"' do diff --git a/spec/models/post_contact_info_spec.rb b/spec/models/post_contact_info_spec.rb index ebff31b..206df6a 100644 --- a/spec/models/post_contact_info_spec.rb +++ b/spec/models/post_contact_info_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::PostContactInfo -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'PostContactInfo' do - before do - # run before each test - @instance = SibApiV3Sdk::PostContactInfo.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::PostContactInfo do + let(:instance) { SibApiV3Sdk::PostContactInfo.new } describe 'test an instance of PostContactInfo' do it 'should create an instance of PostContactInfo' do - expect(@instance).to be_instance_of(SibApiV3Sdk::PostContactInfo) + expect(instance).to be_instance_of(SibApiV3Sdk::PostContactInfo) end end describe 'test attribute "contacts"' do diff --git a/spec/models/post_send_failed_spec.rb b/spec/models/post_send_failed_spec.rb index 3e8fef3..27f4f71 100644 --- a/spec/models/post_send_failed_spec.rb +++ b/spec/models/post_send_failed_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::PostSendFailed -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'PostSendFailed' do - before do - # run before each test - @instance = SibApiV3Sdk::PostSendFailed.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::PostSendFailed do + let(:instance) { SibApiV3Sdk::PostSendFailed.new } describe 'test an instance of PostSendFailed' do it 'should create an instance of PostSendFailed' do - expect(@instance).to be_instance_of(SibApiV3Sdk::PostSendFailed) + expect(instance).to be_instance_of(SibApiV3Sdk::PostSendFailed) end end describe 'test attribute "code"' do diff --git a/spec/models/post_send_sms_test_failed_spec.rb b/spec/models/post_send_sms_test_failed_spec.rb index ad87291..a01adaa 100644 --- a/spec/models/post_send_sms_test_failed_spec.rb +++ b/spec/models/post_send_sms_test_failed_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::PostSendSmsTestFailed -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'PostSendSmsTestFailed' do - before do - # run before each test - @instance = SibApiV3Sdk::PostSendSmsTestFailed.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::PostSendSmsTestFailed do + let(:instance) { SibApiV3Sdk::PostSendSmsTestFailed.new } describe 'test an instance of PostSendSmsTestFailed' do it 'should create an instance of PostSendSmsTestFailed' do - expect(@instance).to be_instance_of(SibApiV3Sdk::PostSendSmsTestFailed) + expect(instance).to be_instance_of(SibApiV3Sdk::PostSendSmsTestFailed) end end describe 'test attribute "code"' do diff --git a/spec/models/remaining_credit_model_child_spec.rb b/spec/models/remaining_credit_model_child_spec.rb index d5b5217..360be7c 100644 --- a/spec/models/remaining_credit_model_child_spec.rb +++ b/spec/models/remaining_credit_model_child_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::RemainingCreditModelChild -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'RemainingCreditModelChild' do - before do - # run before each test - @instance = SibApiV3Sdk::RemainingCreditModelChild.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::RemainingCreditModelChild do + let(:instance) { SibApiV3Sdk::RemainingCreditModelChild.new } describe 'test an instance of RemainingCreditModelChild' do it 'should create an instance of RemainingCreditModelChild' do - expect(@instance).to be_instance_of(SibApiV3Sdk::RemainingCreditModelChild) + expect(instance).to be_instance_of(SibApiV3Sdk::RemainingCreditModelChild) end end describe 'test attribute "sms"' do diff --git a/spec/models/remaining_credit_model_reseller_spec.rb b/spec/models/remaining_credit_model_reseller_spec.rb index 72e0555..06928cb 100644 --- a/spec/models/remaining_credit_model_reseller_spec.rb +++ b/spec/models/remaining_credit_model_reseller_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::RemainingCreditModelReseller -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'RemainingCreditModelReseller' do - before do - # run before each test - @instance = SibApiV3Sdk::RemainingCreditModelReseller.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::RemainingCreditModelReseller do + let(:instance) { SibApiV3Sdk::RemainingCreditModelReseller.new } describe 'test an instance of RemainingCreditModelReseller' do it 'should create an instance of RemainingCreditModelReseller' do - expect(@instance).to be_instance_of(SibApiV3Sdk::RemainingCreditModelReseller) + expect(instance).to be_instance_of(SibApiV3Sdk::RemainingCreditModelReseller) end end describe 'test attribute "sms"' do diff --git a/spec/models/remaining_credit_model_spec.rb b/spec/models/remaining_credit_model_spec.rb index a3a9536..e6eba0f 100644 --- a/spec/models/remaining_credit_model_spec.rb +++ b/spec/models/remaining_credit_model_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::RemainingCreditModel -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'RemainingCreditModel' do - before do - # run before each test - @instance = SibApiV3Sdk::RemainingCreditModel.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::RemainingCreditModel do + let(:instance) { SibApiV3Sdk::RemainingCreditModel.new } describe 'test an instance of RemainingCreditModel' do it 'should create an instance of RemainingCreditModel' do - expect(@instance).to be_instance_of(SibApiV3Sdk::RemainingCreditModel) + expect(instance).to be_instance_of(SibApiV3Sdk::RemainingCreditModel) end end describe 'test attribute "child"' do diff --git a/spec/models/remove_contact_from_list_spec.rb b/spec/models/remove_contact_from_list_spec.rb index 22590f0..3552c6e 100644 --- a/spec/models/remove_contact_from_list_spec.rb +++ b/spec/models/remove_contact_from_list_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::RemoveContactFromList -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'RemoveContactFromList' do - before do - # run before each test - @instance = SibApiV3Sdk::RemoveContactFromList.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::RemoveContactFromList do + let(:instance) { SibApiV3Sdk::RemoveContactFromList.new } describe 'test an instance of RemoveContactFromList' do it 'should create an instance of RemoveContactFromList' do - expect(@instance).to be_instance_of(SibApiV3Sdk::RemoveContactFromList) + expect(instance).to be_instance_of(SibApiV3Sdk::RemoveContactFromList) end end describe 'test attribute "emails"' do diff --git a/spec/models/remove_credits_spec.rb b/spec/models/remove_credits_spec.rb index 9f8ecab..1eb6c19 100644 --- a/spec/models/remove_credits_spec.rb +++ b/spec/models/remove_credits_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::RemoveCredits -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'RemoveCredits' do - before do - # run before each test - @instance = SibApiV3Sdk::RemoveCredits.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::RemoveCredits do + let(:instance) { SibApiV3Sdk::RemoveCredits.new } describe 'test an instance of RemoveCredits' do it 'should create an instance of RemoveCredits' do - expect(@instance).to be_instance_of(SibApiV3Sdk::RemoveCredits) + expect(instance).to be_instance_of(SibApiV3Sdk::RemoveCredits) end end describe 'test attribute "sms"' do diff --git a/spec/models/request_contact_export_custom_contact_filter_spec.rb b/spec/models/request_contact_export_custom_contact_filter_spec.rb index 40f6eca..1fea533 100644 --- a/spec/models/request_contact_export_custom_contact_filter_spec.rb +++ b/spec/models/request_contact_export_custom_contact_filter_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::RequestContactExportCustomContactFilter -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'RequestContactExportCustomContactFilter' do - before do - # run before each test - @instance = SibApiV3Sdk::RequestContactExportCustomContactFilter.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::RequestContactExportCustomContactFilter do + let(:instance) { SibApiV3Sdk::RequestContactExportCustomContactFilter.new } describe 'test an instance of RequestContactExportCustomContactFilter' do it 'should create an instance of RequestContactExportCustomContactFilter' do - expect(@instance).to be_instance_of(SibApiV3Sdk::RequestContactExportCustomContactFilter) + expect(instance).to be_instance_of(SibApiV3Sdk::RequestContactExportCustomContactFilter) end end describe 'test attribute "action_for_contacts"' do @@ -37,7 +30,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["allContacts", "subscribed", "unsubscribed", "unsubscribedPerList"]) # validator.allowable_values.each do |value| - # expect { @instance.action_for_contacts = value }.not_to raise_error + # expect { instance.action_for_contacts = value }.not_to raise_error # end end end @@ -47,7 +40,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["openers", "nonOpeners", "clickers", "nonClickers", "unsubscribed", "hardBounces", "softBounces"]) # validator.allowable_values.each do |value| - # expect { @instance.action_for_email_campaigns = value }.not_to raise_error + # expect { instance.action_for_email_campaigns = value }.not_to raise_error # end end end @@ -57,7 +50,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["hardBounces", "softBounces", "unsubscribed"]) # validator.allowable_values.each do |value| - # expect { @instance.action_for_sms_campaigns = value }.not_to raise_error + # expect { instance.action_for_sms_campaigns = value }.not_to raise_error # end end end diff --git a/spec/models/request_contact_export_spec.rb b/spec/models/request_contact_export_spec.rb index 8ec5ee0..ea22839 100644 --- a/spec/models/request_contact_export_spec.rb +++ b/spec/models/request_contact_export_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::RequestContactExport -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'RequestContactExport' do - before do - # run before each test - @instance = SibApiV3Sdk::RequestContactExport.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::RequestContactExport do + let(:instance) { SibApiV3Sdk::RequestContactExport.new } describe 'test an instance of RequestContactExport' do it 'should create an instance of RequestContactExport' do - expect(@instance).to be_instance_of(SibApiV3Sdk::RequestContactExport) + expect(instance).to be_instance_of(SibApiV3Sdk::RequestContactExport) end end describe 'test attribute "export_attributes"' do diff --git a/spec/models/request_contact_import_new_list_spec.rb b/spec/models/request_contact_import_new_list_spec.rb index da35274..2f92bb8 100644 --- a/spec/models/request_contact_import_new_list_spec.rb +++ b/spec/models/request_contact_import_new_list_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::RequestContactImportNewList -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'RequestContactImportNewList' do - before do - # run before each test - @instance = SibApiV3Sdk::RequestContactImportNewList.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::RequestContactImportNewList do + let(:instance) { SibApiV3Sdk::RequestContactImportNewList.new } describe 'test an instance of RequestContactImportNewList' do it 'should create an instance of RequestContactImportNewList' do - expect(@instance).to be_instance_of(SibApiV3Sdk::RequestContactImportNewList) + expect(instance).to be_instance_of(SibApiV3Sdk::RequestContactImportNewList) end end describe 'test attribute "list_name"' do diff --git a/spec/models/request_contact_import_spec.rb b/spec/models/request_contact_import_spec.rb index baff441..1a1931c 100644 --- a/spec/models/request_contact_import_spec.rb +++ b/spec/models/request_contact_import_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::RequestContactImport -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'RequestContactImport' do - before do - # run before each test - @instance = SibApiV3Sdk::RequestContactImport.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::RequestContactImport do + let(:instance) { SibApiV3Sdk::RequestContactImport.new } describe 'test an instance of RequestContactImport' do it 'should create an instance of RequestContactImport' do - expect(@instance).to be_instance_of(SibApiV3Sdk::RequestContactImport) + expect(instance).to be_instance_of(SibApiV3Sdk::RequestContactImport) end end describe 'test attribute "file_url"' do diff --git a/spec/models/request_sms_recipient_export_spec.rb b/spec/models/request_sms_recipient_export_spec.rb index cffb96f..296dc4f 100644 --- a/spec/models/request_sms_recipient_export_spec.rb +++ b/spec/models/request_sms_recipient_export_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::RequestSmsRecipientExport -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'RequestSmsRecipientExport' do - before do - # run before each test - @instance = SibApiV3Sdk::RequestSmsRecipientExport.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::RequestSmsRecipientExport do + let(:instance) { SibApiV3Sdk::RequestSmsRecipientExport.new } describe 'test an instance of RequestSmsRecipientExport' do it 'should create an instance of RequestSmsRecipientExport' do - expect(@instance).to be_instance_of(SibApiV3Sdk::RequestSmsRecipientExport) + expect(instance).to be_instance_of(SibApiV3Sdk::RequestSmsRecipientExport) end end describe 'test attribute "notify_url"' do @@ -43,7 +36,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["all", "delivered", "answered", "softBounces", "hardBounces", "unsubscribed"]) # validator.allowable_values.each do |value| - # expect { @instance.recipients_type = value }.not_to raise_error + # expect { instance.recipients_type = value }.not_to raise_error # end end end diff --git a/spec/models/send_email_attachment_spec.rb b/spec/models/send_email_attachment_spec.rb index 6f8a849..a24bce1 100644 --- a/spec/models/send_email_attachment_spec.rb +++ b/spec/models/send_email_attachment_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendEmailAttachment -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendEmailAttachment' do - before do - # run before each test - @instance = SibApiV3Sdk::SendEmailAttachment.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendEmailAttachment do + let(:instance) { SibApiV3Sdk::SendEmailAttachment.new } describe 'test an instance of SendEmailAttachment' do it 'should create an instance of SendEmailAttachment' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendEmailAttachment) + expect(instance).to be_instance_of(SibApiV3Sdk::SendEmailAttachment) end end describe 'test attribute "content"' do diff --git a/spec/models/send_email_spec.rb b/spec/models/send_email_spec.rb index c869e7a..dc86cc5 100644 --- a/spec/models/send_email_spec.rb +++ b/spec/models/send_email_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendEmail -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendEmail' do - before do - # run before each test - @instance = SibApiV3Sdk::SendEmail.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendEmail do + let(:instance) { SibApiV3Sdk::SendEmail.new } describe 'test an instance of SendEmail' do it 'should create an instance of SendEmail' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendEmail) + expect(instance).to be_instance_of(SibApiV3Sdk::SendEmail) end end describe 'test attribute "email_to"' do diff --git a/spec/models/send_report_email_spec.rb b/spec/models/send_report_email_spec.rb index 1b5584e..b665c6e 100644 --- a/spec/models/send_report_email_spec.rb +++ b/spec/models/send_report_email_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendReportEmail -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendReportEmail' do - before do - # run before each test - @instance = SibApiV3Sdk::SendReportEmail.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendReportEmail do + let(:instance) { SibApiV3Sdk::SendReportEmail.new } describe 'test an instance of SendReportEmail' do it 'should create an instance of SendReportEmail' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendReportEmail) + expect(instance).to be_instance_of(SibApiV3Sdk::SendReportEmail) end end describe 'test attribute "to"' do diff --git a/spec/models/send_report_spec.rb b/spec/models/send_report_spec.rb index dd2b05f..12d8f53 100644 --- a/spec/models/send_report_spec.rb +++ b/spec/models/send_report_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendReport -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendReport' do - before do - # run before each test - @instance = SibApiV3Sdk::SendReport.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendReport do + let(:instance) { SibApiV3Sdk::SendReport.new } describe 'test an instance of SendReport' do it 'should create an instance of SendReport' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendReport) + expect(instance).to be_instance_of(SibApiV3Sdk::SendReport) end end describe 'test attribute "language"' do @@ -37,7 +30,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["fr", "es", "pt", "it", "de", "en"]) # validator.allowable_values.each do |value| - # expect { @instance.language = value }.not_to raise_error + # expect { instance.language = value }.not_to raise_error # end end end diff --git a/spec/models/send_sms_spec.rb b/spec/models/send_sms_spec.rb index 24426e4..ca2aa8a 100644 --- a/spec/models/send_sms_spec.rb +++ b/spec/models/send_sms_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendSms -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendSms' do - before do - # run before each test - @instance = SibApiV3Sdk::SendSms.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendSms do + let(:instance) { SibApiV3Sdk::SendSms.new } describe 'test an instance of SendSms' do it 'should create an instance of SendSms' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendSms) + expect(instance).to be_instance_of(SibApiV3Sdk::SendSms) end end describe 'test attribute "reference"' do diff --git a/spec/models/send_smtp_email_attachment_spec.rb b/spec/models/send_smtp_email_attachment_spec.rb index 04045d0..73c4db2 100644 --- a/spec/models/send_smtp_email_attachment_spec.rb +++ b/spec/models/send_smtp_email_attachment_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendSmtpEmailAttachment -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendSmtpEmailAttachment' do - before do - # run before each test - @instance = SibApiV3Sdk::SendSmtpEmailAttachment.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendSmtpEmailAttachment do + let(:instance) { SibApiV3Sdk::SendSmtpEmailAttachment.new } describe 'test an instance of SendSmtpEmailAttachment' do it 'should create an instance of SendSmtpEmailAttachment' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmailAttachment) + expect(instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmailAttachment) end end describe 'test attribute "url"' do diff --git a/spec/models/send_smtp_email_bcc_spec.rb b/spec/models/send_smtp_email_bcc_spec.rb index 1af84ba..d4511a0 100644 --- a/spec/models/send_smtp_email_bcc_spec.rb +++ b/spec/models/send_smtp_email_bcc_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendSmtpEmailBcc -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendSmtpEmailBcc' do - before do - # run before each test - @instance = SibApiV3Sdk::SendSmtpEmailBcc.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendSmtpEmailBcc do + let(:instance) { SibApiV3Sdk::SendSmtpEmailBcc.new } describe 'test an instance of SendSmtpEmailBcc' do it 'should create an instance of SendSmtpEmailBcc' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmailBcc) + expect(instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmailBcc) end end describe 'test attribute "email"' do diff --git a/spec/models/send_smtp_email_cc_spec.rb b/spec/models/send_smtp_email_cc_spec.rb index 99ae6b0..c6424ae 100644 --- a/spec/models/send_smtp_email_cc_spec.rb +++ b/spec/models/send_smtp_email_cc_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendSmtpEmailCc -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendSmtpEmailCc' do - before do - # run before each test - @instance = SibApiV3Sdk::SendSmtpEmailCc.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendSmtpEmailCc do + let(:instance) { SibApiV3Sdk::SendSmtpEmailCc.new } describe 'test an instance of SendSmtpEmailCc' do it 'should create an instance of SendSmtpEmailCc' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmailCc) + expect(instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmailCc) end end describe 'test attribute "email"' do diff --git a/spec/models/send_smtp_email_message_versions_spec.rb b/spec/models/send_smtp_email_message_versions_spec.rb index d783e86..ee422b3 100644 --- a/spec/models/send_smtp_email_message_versions_spec.rb +++ b/spec/models/send_smtp_email_message_versions_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendSmtpEmailMessageVersions -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendSmtpEmailMessageVersions' do - before do - # run before each test - @instance = SibApiV3Sdk::SendSmtpEmailMessageVersions.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendSmtpEmailMessageVersions do + let(:instance) { SibApiV3Sdk::SendSmtpEmailMessageVersions.new } describe 'test an instance of SendSmtpEmailMessageVersions' do it 'should create an instance of SendSmtpEmailMessageVersions' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmailMessageVersions) + expect(instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmailMessageVersions) end end describe 'test attribute "to"' do diff --git a/spec/models/send_smtp_email_reply_to_1_spec.rb b/spec/models/send_smtp_email_reply_to1_spec.rb similarity index 76% rename from spec/models/send_smtp_email_reply_to_1_spec.rb rename to spec/models/send_smtp_email_reply_to1_spec.rb index cfebd2e..3513b80 100644 --- a/spec/models/send_smtp_email_reply_to_1_spec.rb +++ b/spec/models/send_smtp_email_reply_to1_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendSmtpEmailReplyTo1 -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendSmtpEmailReplyTo1' do - before do - # run before each test - @instance = SibApiV3Sdk::SendSmtpEmailReplyTo1.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendSmtpEmailReplyTo1 do + let(:instance) { SibApiV3Sdk::SendSmtpEmailReplyTo1.new } describe 'test an instance of SendSmtpEmailReplyTo1' do it 'should create an instance of SendSmtpEmailReplyTo1' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmailReplyTo1) + expect(instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmailReplyTo1) end end describe 'test attribute "email"' do diff --git a/spec/models/send_smtp_email_reply_to_spec.rb b/spec/models/send_smtp_email_reply_to_spec.rb index b0c5a6d..9532069 100644 --- a/spec/models/send_smtp_email_reply_to_spec.rb +++ b/spec/models/send_smtp_email_reply_to_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendSmtpEmailReplyTo -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendSmtpEmailReplyTo' do - before do - # run before each test - @instance = SibApiV3Sdk::SendSmtpEmailReplyTo.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendSmtpEmailReplyTo do + let(:instance) { SibApiV3Sdk::SendSmtpEmailReplyTo.new } describe 'test an instance of SendSmtpEmailReplyTo' do it 'should create an instance of SendSmtpEmailReplyTo' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmailReplyTo) + expect(instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmailReplyTo) end end describe 'test attribute "email"' do diff --git a/spec/models/send_smtp_email_sender_spec.rb b/spec/models/send_smtp_email_sender_spec.rb index 0f17b2b..ec783ea 100644 --- a/spec/models/send_smtp_email_sender_spec.rb +++ b/spec/models/send_smtp_email_sender_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendSmtpEmailSender -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendSmtpEmailSender' do - before do - # run before each test - @instance = SibApiV3Sdk::SendSmtpEmailSender.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendSmtpEmailSender do + let(:instance) { SibApiV3Sdk::SendSmtpEmailSender.new } describe 'test an instance of SendSmtpEmailSender' do it 'should create an instance of SendSmtpEmailSender' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmailSender) + expect(instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmailSender) end end describe 'test attribute "name"' do diff --git a/spec/models/send_smtp_email_spec.rb b/spec/models/send_smtp_email_spec.rb index 0078344..3f9cd5d 100644 --- a/spec/models/send_smtp_email_spec.rb +++ b/spec/models/send_smtp_email_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendSmtpEmail -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendSmtpEmail' do - before do - # run before each test - @instance = SibApiV3Sdk::SendSmtpEmail.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendSmtpEmail do + let(:instance) { SibApiV3Sdk::SendSmtpEmail.new } describe 'test an instance of SendSmtpEmail' do it 'should create an instance of SendSmtpEmail' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmail) + expect(instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmail) end end describe 'test attribute "sender"' do diff --git a/spec/models/send_smtp_email_to_1_spec.rb b/spec/models/send_smtp_email_to1_spec.rb similarity index 77% rename from spec/models/send_smtp_email_to_1_spec.rb rename to spec/models/send_smtp_email_to1_spec.rb index 2d310fd..d27a029 100644 --- a/spec/models/send_smtp_email_to_1_spec.rb +++ b/spec/models/send_smtp_email_to1_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendSmtpEmailTo1 -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendSmtpEmailTo1' do - before do - # run before each test - @instance = SibApiV3Sdk::SendSmtpEmailTo1.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendSmtpEmailTo1 do + let(:instance) { SibApiV3Sdk::SendSmtpEmailTo1.new } describe 'test an instance of SendSmtpEmailTo1' do it 'should create an instance of SendSmtpEmailTo1' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmailTo1) + expect(instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmailTo1) end end describe 'test attribute "email"' do diff --git a/spec/models/send_smtp_email_to_spec.rb b/spec/models/send_smtp_email_to_spec.rb index 91bf644..ec88f54 100644 --- a/spec/models/send_smtp_email_to_spec.rb +++ b/spec/models/send_smtp_email_to_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendSmtpEmailTo -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendSmtpEmailTo' do - before do - # run before each test - @instance = SibApiV3Sdk::SendSmtpEmailTo.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendSmtpEmailTo do + let(:instance) { SibApiV3Sdk::SendSmtpEmailTo.new } describe 'test an instance of SendSmtpEmailTo' do it 'should create an instance of SendSmtpEmailTo' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmailTo) + expect(instance).to be_instance_of(SibApiV3Sdk::SendSmtpEmailTo) end end describe 'test attribute "email"' do diff --git a/spec/models/send_template_email_spec.rb b/spec/models/send_template_email_spec.rb index 4b5127b..c9241b4 100644 --- a/spec/models/send_template_email_spec.rb +++ b/spec/models/send_template_email_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendTemplateEmail -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendTemplateEmail' do - before do - # run before each test - @instance = SibApiV3Sdk::SendTemplateEmail.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendTemplateEmail do + let(:instance) { SibApiV3Sdk::SendTemplateEmail.new } describe 'test an instance of SendTemplateEmail' do it 'should create an instance of SendTemplateEmail' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendTemplateEmail) + expect(instance).to be_instance_of(SibApiV3Sdk::SendTemplateEmail) end end describe 'test attribute "message_id"' do diff --git a/spec/models/send_test_email_spec.rb b/spec/models/send_test_email_spec.rb index cbd5882..8bab29c 100644 --- a/spec/models/send_test_email_spec.rb +++ b/spec/models/send_test_email_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendTestEmail -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendTestEmail' do - before do - # run before each test - @instance = SibApiV3Sdk::SendTestEmail.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendTestEmail do + let(:instance) { SibApiV3Sdk::SendTestEmail.new } describe 'test an instance of SendTestEmail' do it 'should create an instance of SendTestEmail' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendTestEmail) + expect(instance).to be_instance_of(SibApiV3Sdk::SendTestEmail) end end describe 'test attribute "email_to"' do diff --git a/spec/models/send_test_sms_spec.rb b/spec/models/send_test_sms_spec.rb index 5143e9d..d962e76 100644 --- a/spec/models/send_test_sms_spec.rb +++ b/spec/models/send_test_sms_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendTestSms -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendTestSms' do - before do - # run before each test - @instance = SibApiV3Sdk::SendTestSms.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendTestSms do + let(:instance) { SibApiV3Sdk::SendTestSms.new } describe 'test an instance of SendTestSms' do it 'should create an instance of SendTestSms' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendTestSms) + expect(instance).to be_instance_of(SibApiV3Sdk::SendTestSms) end end describe 'test attribute "phone_number"' do diff --git a/spec/models/send_transac_sms_spec.rb b/spec/models/send_transac_sms_spec.rb index a2bd610..851d305 100644 --- a/spec/models/send_transac_sms_spec.rb +++ b/spec/models/send_transac_sms_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::SendTransacSms -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'SendTransacSms' do - before do - # run before each test - @instance = SibApiV3Sdk::SendTransacSms.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::SendTransacSms do + let(:instance) { SibApiV3Sdk::SendTransacSms.new } describe 'test an instance of SendTransacSms' do it 'should create an instance of SendTransacSms' do - expect(@instance).to be_instance_of(SibApiV3Sdk::SendTransacSms) + expect(instance).to be_instance_of(SibApiV3Sdk::SendTransacSms) end end describe 'test attribute "sender"' do @@ -55,7 +48,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["transactional", "marketing"]) # validator.allowable_values.each do |value| - # expect { @instance.type = value }.not_to raise_error + # expect { instance.type = value }.not_to raise_error # end end end diff --git a/spec/models/update_attribute_enumeration_spec.rb b/spec/models/update_attribute_enumeration_spec.rb index 776f277..965b057 100644 --- a/spec/models/update_attribute_enumeration_spec.rb +++ b/spec/models/update_attribute_enumeration_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::UpdateAttributeEnumeration -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'UpdateAttributeEnumeration' do - before do - # run before each test - @instance = SibApiV3Sdk::UpdateAttributeEnumeration.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::UpdateAttributeEnumeration do + let(:instance) { SibApiV3Sdk::UpdateAttributeEnumeration.new } describe 'test an instance of UpdateAttributeEnumeration' do it 'should create an instance of UpdateAttributeEnumeration' do - expect(@instance).to be_instance_of(SibApiV3Sdk::UpdateAttributeEnumeration) + expect(instance).to be_instance_of(SibApiV3Sdk::UpdateAttributeEnumeration) end end describe 'test attribute "value"' do diff --git a/spec/models/update_attribute_spec.rb b/spec/models/update_attribute_spec.rb index aa3a819..d053540 100644 --- a/spec/models/update_attribute_spec.rb +++ b/spec/models/update_attribute_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::UpdateAttribute -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'UpdateAttribute' do - before do - # run before each test - @instance = SibApiV3Sdk::UpdateAttribute.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::UpdateAttribute do + let(:instance) { SibApiV3Sdk::UpdateAttribute.new } describe 'test an instance of UpdateAttribute' do it 'should create an instance of UpdateAttribute' do - expect(@instance).to be_instance_of(SibApiV3Sdk::UpdateAttribute) + expect(instance).to be_instance_of(SibApiV3Sdk::UpdateAttribute) end end describe 'test attribute "value"' do diff --git a/spec/models/update_campaign_status_spec.rb b/spec/models/update_campaign_status_spec.rb index b490f4c..a7fbec6 100644 --- a/spec/models/update_campaign_status_spec.rb +++ b/spec/models/update_campaign_status_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::UpdateCampaignStatus -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'UpdateCampaignStatus' do - before do - # run before each test - @instance = SibApiV3Sdk::UpdateCampaignStatus.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::UpdateCampaignStatus do + let(:instance) { SibApiV3Sdk::UpdateCampaignStatus.new } describe 'test an instance of UpdateCampaignStatus' do it 'should create an instance of UpdateCampaignStatus' do - expect(@instance).to be_instance_of(SibApiV3Sdk::UpdateCampaignStatus) + expect(instance).to be_instance_of(SibApiV3Sdk::UpdateCampaignStatus) end end describe 'test attribute "status"' do @@ -37,7 +30,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["suspended", "archive", "darchive", "sent", "queued", "replicate", "replicateTemplate", "draft"]) # validator.allowable_values.each do |value| - # expect { @instance.status = value }.not_to raise_error + # expect { instance.status = value }.not_to raise_error # end end end diff --git a/spec/models/update_child_account_status_spec.rb b/spec/models/update_child_account_status_spec.rb index c2d1b1f..e993a88 100644 --- a/spec/models/update_child_account_status_spec.rb +++ b/spec/models/update_child_account_status_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::UpdateChildAccountStatus -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'UpdateChildAccountStatus' do - before do - # run before each test - @instance = SibApiV3Sdk::UpdateChildAccountStatus.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::UpdateChildAccountStatus do + let(:instance) { SibApiV3Sdk::UpdateChildAccountStatus.new } describe 'test an instance of UpdateChildAccountStatus' do it 'should create an instance of UpdateChildAccountStatus' do - expect(@instance).to be_instance_of(SibApiV3Sdk::UpdateChildAccountStatus) + expect(instance).to be_instance_of(SibApiV3Sdk::UpdateChildAccountStatus) end end describe 'test attribute "transactional_email"' do diff --git a/spec/models/update_child_domain_spec.rb b/spec/models/update_child_domain_spec.rb index 71808c5..e17af26 100644 --- a/spec/models/update_child_domain_spec.rb +++ b/spec/models/update_child_domain_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::UpdateChildDomain -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'UpdateChildDomain' do - before do - # run before each test - @instance = SibApiV3Sdk::UpdateChildDomain.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::UpdateChildDomain do + let(:instance) { SibApiV3Sdk::UpdateChildDomain.new } describe 'test an instance of UpdateChildDomain' do it 'should create an instance of UpdateChildDomain' do - expect(@instance).to be_instance_of(SibApiV3Sdk::UpdateChildDomain) + expect(instance).to be_instance_of(SibApiV3Sdk::UpdateChildDomain) end end describe 'test attribute "domain"' do diff --git a/spec/models/update_child_spec.rb b/spec/models/update_child_spec.rb index f00ce7a..f67951a 100644 --- a/spec/models/update_child_spec.rb +++ b/spec/models/update_child_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::UpdateChild -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'UpdateChild' do - before do - # run before each test - @instance = SibApiV3Sdk::UpdateChild.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::UpdateChild do + let(:instance) { SibApiV3Sdk::UpdateChild.new } describe 'test an instance of UpdateChild' do it 'should create an instance of UpdateChild' do - expect(@instance).to be_instance_of(SibApiV3Sdk::UpdateChild) + expect(instance).to be_instance_of(SibApiV3Sdk::UpdateChild) end end describe 'test attribute "email"' do diff --git a/spec/models/update_contact_spec.rb b/spec/models/update_contact_spec.rb index 89398af..b753160 100644 --- a/spec/models/update_contact_spec.rb +++ b/spec/models/update_contact_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::UpdateContact -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'UpdateContact' do - before do - # run before each test - @instance = SibApiV3Sdk::UpdateContact.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::UpdateContact do + let(:instance) { SibApiV3Sdk::UpdateContact.new } describe 'test an instance of UpdateContact' do it 'should create an instance of UpdateContact' do - expect(@instance).to be_instance_of(SibApiV3Sdk::UpdateContact) + expect(instance).to be_instance_of(SibApiV3Sdk::UpdateContact) end end describe 'test attribute "attributes"' do diff --git a/spec/models/update_email_campaign_recipients_spec.rb b/spec/models/update_email_campaign_recipients_spec.rb index ecb33d7..63196c5 100644 --- a/spec/models/update_email_campaign_recipients_spec.rb +++ b/spec/models/update_email_campaign_recipients_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::UpdateEmailCampaignRecipients -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'UpdateEmailCampaignRecipients' do - before do - # run before each test - @instance = SibApiV3Sdk::UpdateEmailCampaignRecipients.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::UpdateEmailCampaignRecipients do + let(:instance) { SibApiV3Sdk::UpdateEmailCampaignRecipients.new } describe 'test an instance of UpdateEmailCampaignRecipients' do it 'should create an instance of UpdateEmailCampaignRecipients' do - expect(@instance).to be_instance_of(SibApiV3Sdk::UpdateEmailCampaignRecipients) + expect(instance).to be_instance_of(SibApiV3Sdk::UpdateEmailCampaignRecipients) end end describe 'test attribute "exclusion_list_ids"' do diff --git a/spec/models/update_email_campaign_sender_spec.rb b/spec/models/update_email_campaign_sender_spec.rb index 4aa8f62..1e14c8e 100644 --- a/spec/models/update_email_campaign_sender_spec.rb +++ b/spec/models/update_email_campaign_sender_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::UpdateEmailCampaignSender -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'UpdateEmailCampaignSender' do - before do - # run before each test - @instance = SibApiV3Sdk::UpdateEmailCampaignSender.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::UpdateEmailCampaignSender do + let(:instance) { SibApiV3Sdk::UpdateEmailCampaignSender.new } describe 'test an instance of UpdateEmailCampaignSender' do it 'should create an instance of UpdateEmailCampaignSender' do - expect(@instance).to be_instance_of(SibApiV3Sdk::UpdateEmailCampaignSender) + expect(instance).to be_instance_of(SibApiV3Sdk::UpdateEmailCampaignSender) end end describe 'test attribute "name"' do diff --git a/spec/models/update_email_campaign_spec.rb b/spec/models/update_email_campaign_spec.rb index a9209eb..1c27fba 100644 --- a/spec/models/update_email_campaign_spec.rb +++ b/spec/models/update_email_campaign_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::UpdateEmailCampaign -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'UpdateEmailCampaign' do - before do - # run before each test - @instance = SibApiV3Sdk::UpdateEmailCampaign.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::UpdateEmailCampaign do + let(:instance) { SibApiV3Sdk::UpdateEmailCampaign.new } describe 'test an instance of UpdateEmailCampaign' do it 'should create an instance of UpdateEmailCampaign' do - expect(@instance).to be_instance_of(SibApiV3Sdk::UpdateEmailCampaign) + expect(instance).to be_instance_of(SibApiV3Sdk::UpdateEmailCampaign) end end describe 'test attribute "tag"' do @@ -175,7 +168,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["open", "click"]) # validator.allowable_values.each do |value| - # expect { @instance.winner_criteria = value }.not_to raise_error + # expect { instance.winner_criteria = value }.not_to raise_error # end end end diff --git a/spec/models/update_list_spec.rb b/spec/models/update_list_spec.rb index 2505803..1af6a2a 100644 --- a/spec/models/update_list_spec.rb +++ b/spec/models/update_list_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::UpdateList -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'UpdateList' do - before do - # run before each test - @instance = SibApiV3Sdk::UpdateList.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::UpdateList do + let(:instance) { SibApiV3Sdk::UpdateList.new } describe 'test an instance of UpdateList' do it 'should create an instance of UpdateList' do - expect(@instance).to be_instance_of(SibApiV3Sdk::UpdateList) + expect(instance).to be_instance_of(SibApiV3Sdk::UpdateList) end end describe 'test attribute "name"' do diff --git a/spec/models/update_sender_spec.rb b/spec/models/update_sender_spec.rb index 38e47e7..e84ac72 100644 --- a/spec/models/update_sender_spec.rb +++ b/spec/models/update_sender_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::UpdateSender -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'UpdateSender' do - before do - # run before each test - @instance = SibApiV3Sdk::UpdateSender.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::UpdateSender do + let(:instance) { SibApiV3Sdk::UpdateSender.new } describe 'test an instance of UpdateSender' do it 'should create an instance of UpdateSender' do - expect(@instance).to be_instance_of(SibApiV3Sdk::UpdateSender) + expect(instance).to be_instance_of(SibApiV3Sdk::UpdateSender) end end describe 'test attribute "name"' do diff --git a/spec/models/update_sms_campaign_spec.rb b/spec/models/update_sms_campaign_spec.rb index da5655c..8733a9d 100644 --- a/spec/models/update_sms_campaign_spec.rb +++ b/spec/models/update_sms_campaign_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::UpdateSmsCampaign -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'UpdateSmsCampaign' do - before do - # run before each test - @instance = SibApiV3Sdk::UpdateSmsCampaign.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::UpdateSmsCampaign do + let(:instance) { SibApiV3Sdk::UpdateSmsCampaign.new } describe 'test an instance of UpdateSmsCampaign' do it 'should create an instance of UpdateSmsCampaign' do - expect(@instance).to be_instance_of(SibApiV3Sdk::UpdateSmsCampaign) + expect(instance).to be_instance_of(SibApiV3Sdk::UpdateSmsCampaign) end end describe 'test attribute "name"' do diff --git a/spec/models/update_smtp_template_sender_spec.rb b/spec/models/update_smtp_template_sender_spec.rb index 197cb5b..18b7826 100644 --- a/spec/models/update_smtp_template_sender_spec.rb +++ b/spec/models/update_smtp_template_sender_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::UpdateSmtpTemplateSender -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'UpdateSmtpTemplateSender' do - before do - # run before each test - @instance = SibApiV3Sdk::UpdateSmtpTemplateSender.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::UpdateSmtpTemplateSender do + let(:instance) { SibApiV3Sdk::UpdateSmtpTemplateSender.new } describe 'test an instance of UpdateSmtpTemplateSender' do it 'should create an instance of UpdateSmtpTemplateSender' do - expect(@instance).to be_instance_of(SibApiV3Sdk::UpdateSmtpTemplateSender) + expect(instance).to be_instance_of(SibApiV3Sdk::UpdateSmtpTemplateSender) end end describe 'test attribute "name"' do diff --git a/spec/models/update_smtp_template_spec.rb b/spec/models/update_smtp_template_spec.rb index d165a99..2864d31 100644 --- a/spec/models/update_smtp_template_spec.rb +++ b/spec/models/update_smtp_template_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::UpdateSmtpTemplate -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'UpdateSmtpTemplate' do - before do - # run before each test - @instance = SibApiV3Sdk::UpdateSmtpTemplate.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::UpdateSmtpTemplate do + let(:instance) { SibApiV3Sdk::UpdateSmtpTemplate.new } describe 'test an instance of UpdateSmtpTemplate' do it 'should create an instance of UpdateSmtpTemplate' do - expect(@instance).to be_instance_of(SibApiV3Sdk::UpdateSmtpTemplate) + expect(instance).to be_instance_of(SibApiV3Sdk::UpdateSmtpTemplate) end end describe 'test attribute "tag"' do diff --git a/spec/models/update_webhook_spec.rb b/spec/models/update_webhook_spec.rb index 404d91b..0b921eb 100644 --- a/spec/models/update_webhook_spec.rb +++ b/spec/models/update_webhook_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::UpdateWebhook -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'UpdateWebhook' do - before do - # run before each test - @instance = SibApiV3Sdk::UpdateWebhook.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::UpdateWebhook do + let(:instance) { SibApiV3Sdk::UpdateWebhook.new } describe 'test an instance of UpdateWebhook' do it 'should create an instance of UpdateWebhook' do - expect(@instance).to be_instance_of(SibApiV3Sdk::UpdateWebhook) + expect(instance).to be_instance_of(SibApiV3Sdk::UpdateWebhook) end end describe 'test attribute "url"' do @@ -49,7 +42,7 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array', ["hardBounce", "softBounce", "blocked", "spam", "delivered", "request", "click", "invalid", "deferred", "opened", "uniqueOpened", "unsubscribed", "listAddition", "contactUpdated", "contactDeleted"]) # validator.allowable_values.each do |value| - # expect { @instance.events = value }.not_to raise_error + # expect { instance.events = value }.not_to raise_error # end end end diff --git a/spec/models/upload_image_to_gallery_spec.rb b/spec/models/upload_image_to_gallery_spec.rb index 1d9e6de..16bb6f1 100644 --- a/spec/models/upload_image_to_gallery_spec.rb +++ b/spec/models/upload_image_to_gallery_spec.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end @@ -15,21 +15,14 @@ require 'date' # Unit tests for SibApiV3Sdk::UploadImageToGallery -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) +# Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'UploadImageToGallery' do - before do - # run before each test - @instance = SibApiV3Sdk::UploadImageToGallery.new - end - - after do - # run after each test - end +describe SibApiV3Sdk::UploadImageToGallery do + let(:instance) { SibApiV3Sdk::UploadImageToGallery.new } describe 'test an instance of UploadImageToGallery' do it 'should create an instance of UploadImageToGallery' do - expect(@instance).to be_instance_of(SibApiV3Sdk::UploadImageToGallery) + expect(instance).to be_instance_of(SibApiV3Sdk::UploadImageToGallery) end end describe 'test attribute "image_url"' do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 74ce017..1e047a7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,10 +3,10 @@ #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 | -OpenAPI spec version: 3.0.0 +The version of the OpenAPI document: 3.0.0 Contact: contact@sendinblue.com -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.18 +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.1.0 =end diff --git a/test.rb b/test.rb new file mode 100644 index 0000000..aa205bc --- /dev/null +++ b/test.rb @@ -0,0 +1,16 @@ +# load the gem +require 'sib-api-v3-sdk' +# setup authorization +SibApiV3Sdk.configure do |config| + # Configure API key authorization: api-key + config.api_key['api-key'] = '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' +end +api_instance = SibApiV3Sdk::EmailCampaignsApi.new +campaign_id = 240 # Integer | Id of the campaign +begin + #Get an email campaign report + result = api_instance.get_email_campaign(campaign_id) + p result +rescue SibApiV3Sdk::ApiError => e + puts "Exception when calling EmailCampaignsApi->get_email_campaign: #{e}" +end \ No newline at end of file