ElasticEmail 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/DIFF +0 -0
- data/ElasticEmail.gemspec +38 -0
- data/Gemfile +9 -0
- data/README.md +286 -0
- data/Rakefile +10 -0
- data/VERSION +1 -0
- data/docs/AccessLevel.md +15 -0
- data/docs/AccountStatusEnum.md +15 -0
- data/docs/ApiKey.md +28 -0
- data/docs/ApiKeyPayload.md +26 -0
- data/docs/BodyContentType.md +15 -0
- data/docs/BodyPart.md +22 -0
- data/docs/Campaign.md +26 -0
- data/docs/CampaignOptions.md +26 -0
- data/docs/CampaignRecipient.md +20 -0
- data/docs/CampaignStatus.md +15 -0
- data/docs/CampaignTemplate.md +30 -0
- data/docs/CampaignsApi.md +374 -0
- data/docs/ChannelLogStatusSummary.md +44 -0
- data/docs/CompressionFormat.md +15 -0
- data/docs/ConsentData.md +22 -0
- data/docs/ConsentTracking.md +15 -0
- data/docs/Contact.md +38 -0
- data/docs/ContactActivity.md +38 -0
- data/docs/ContactHistEventType.md +15 -0
- data/docs/ContactHistory.md +30 -0
- data/docs/ContactPayload.md +28 -0
- data/docs/ContactSource.md +15 -0
- data/docs/ContactStatus.md +15 -0
- data/docs/ContactUpdatePayload.md +22 -0
- data/docs/ContactsApi.md +756 -0
- data/docs/ContactsList.md +24 -0
- data/docs/DeliveryOptimizationType.md +15 -0
- data/docs/EmailContent.md +38 -0
- data/docs/EmailData.md +22 -0
- data/docs/EmailMessageData.md +22 -0
- data/docs/EmailRecipient.md +20 -0
- data/docs/EmailSend.md +20 -0
- data/docs/EmailStatus.md +40 -0
- data/docs/EmailTransactionalMessageData.md +22 -0
- data/docs/EmailValidationResult.md +34 -0
- data/docs/EmailValidationStatus.md +15 -0
- data/docs/EmailView.md +22 -0
- data/docs/EmailsApi.md +295 -0
- data/docs/EmailsPayload.md +20 -0
- data/docs/EncodingType.md +15 -0
- data/docs/EventType.md +15 -0
- data/docs/EventsApi.md +575 -0
- data/docs/EventsOrderBy.md +15 -0
- data/docs/ExportFileFormats.md +15 -0
- data/docs/ExportLink.md +20 -0
- data/docs/ExportStatus.md +15 -0
- data/docs/FileInfo.md +26 -0
- data/docs/FilePayload.md +22 -0
- data/docs/FileUploadResult.md +20 -0
- data/docs/FilesApi.md +374 -0
- data/docs/InboundPayload.md +28 -0
- data/docs/InboundRoute.md +30 -0
- data/docs/InboundRouteActionType.md +15 -0
- data/docs/InboundRouteApi.md +437 -0
- data/docs/InboundRouteFilterType.md +15 -0
- data/docs/ListPayload.md +22 -0
- data/docs/ListUpdatePayload.md +20 -0
- data/docs/ListsApi.md +519 -0
- data/docs/LogJobStatus.md +15 -0
- data/docs/LogStatusSummary.md +42 -0
- data/docs/MergeEmailPayload.md +22 -0
- data/docs/MessageAttachment.md +22 -0
- data/docs/MessageCategory.md +15 -0
- data/docs/NewApiKey.md +30 -0
- data/docs/NewSmtpCredentials.md +30 -0
- data/docs/Options.md +28 -0
- data/docs/RecipientEvent.md +42 -0
- data/docs/SecurityApi.md +749 -0
- data/docs/Segment.md +20 -0
- data/docs/SegmentPayload.md +20 -0
- data/docs/SegmentsApi.md +372 -0
- data/docs/SmtpCredentials.md +28 -0
- data/docs/SmtpCredentialsPayload.md +24 -0
- data/docs/SortOrderItem.md +20 -0
- data/docs/SplitOptimizationType.md +15 -0
- data/docs/SplitOptions.md +20 -0
- data/docs/StatisticsApi.md +379 -0
- data/docs/SubAccountInfo.md +34 -0
- data/docs/SubAccountsApi.md +445 -0
- data/docs/SubaccountEmailCreditsPayload.md +20 -0
- data/docs/SubaccountEmailSettings.md +30 -0
- data/docs/SubaccountEmailSettingsPayload.md +28 -0
- data/docs/SubaccountPayload.md +24 -0
- data/docs/SubaccountSettingsInfo.md +18 -0
- data/docs/SubaccountSettingsInfoPayload.md +18 -0
- data/docs/Suppression.md +24 -0
- data/docs/SuppressionsApi.md +895 -0
- data/docs/Template.md +28 -0
- data/docs/TemplatePayload.md +24 -0
- data/docs/TemplateScopeType.md +15 -0
- data/docs/TemplateType.md +15 -0
- data/docs/TemplatesApi.md +376 -0
- data/docs/TransactionalRecipient.md +22 -0
- data/docs/Utm.md +24 -0
- data/docs/VerificationFileResult.md +28 -0
- data/docs/VerificationFileResultDetails.md +30 -0
- data/docs/VerificationStatus.md +15 -0
- data/docs/VerificationsApi.md +662 -0
- data/lib/ElasticEmail.rb +137 -0
- data/lib/ElasticEmail/api/campaigns_api.rb +348 -0
- data/lib/ElasticEmail/api/contacts_api.rb +681 -0
- data/lib/ElasticEmail/api/emails_api.rb +280 -0
- data/lib/ElasticEmail/api/events_api.rb +538 -0
- data/lib/ElasticEmail/api/files_api.rb +340 -0
- data/lib/ElasticEmail/api/inbound_route_api.rb +404 -0
- data/lib/ElasticEmail/api/lists_api.rb +485 -0
- data/lib/ElasticEmail/api/security_api.rb +674 -0
- data/lib/ElasticEmail/api/segments_api.rb +345 -0
- data/lib/ElasticEmail/api/statistics_api.rb +341 -0
- data/lib/ElasticEmail/api/sub_accounts_api.rb +414 -0
- data/lib/ElasticEmail/api/suppressions_api.rb +782 -0
- data/lib/ElasticEmail/api/templates_api.rb +355 -0
- data/lib/ElasticEmail/api/verifications_api.rb +584 -0
- data/lib/ElasticEmail/api_client.rb +390 -0
- data/lib/ElasticEmail/api_error.rb +57 -0
- data/lib/ElasticEmail/configuration.rb +277 -0
- data/lib/ElasticEmail/models/access_level.rb +79 -0
- data/lib/ElasticEmail/models/account_status_enum.rb +40 -0
- data/lib/ElasticEmail/models/api_key.rb +276 -0
- data/lib/ElasticEmail/models/api_key_payload.rb +265 -0
- data/lib/ElasticEmail/models/body_content_type.rb +39 -0
- data/lib/ElasticEmail/models/body_part.rb +240 -0
- data/lib/ElasticEmail/models/campaign.rb +261 -0
- data/lib/ElasticEmail/models/campaign_options.rb +263 -0
- data/lib/ElasticEmail/models/campaign_recipient.rb +234 -0
- data/lib/ElasticEmail/models/campaign_status.rb +43 -0
- data/lib/ElasticEmail/models/campaign_template.rb +282 -0
- data/lib/ElasticEmail/models/channel_log_status_summary.rb +350 -0
- data/lib/ElasticEmail/models/compression_format.rb +37 -0
- data/lib/ElasticEmail/models/consent_data.rb +240 -0
- data/lib/ElasticEmail/models/consent_tracking.rb +38 -0
- data/lib/ElasticEmail/models/contact.rb +323 -0
- data/lib/ElasticEmail/models/contact_activity.rb +324 -0
- data/lib/ElasticEmail/models/contact_hist_event_type.rb +49 -0
- data/lib/ElasticEmail/models/contact_history.rb +279 -0
- data/lib/ElasticEmail/models/contact_payload.rb +270 -0
- data/lib/ElasticEmail/models/contact_source.rb +42 -0
- data/lib/ElasticEmail/models/contact_status.rb +44 -0
- data/lib/ElasticEmail/models/contact_update_payload.rb +241 -0
- data/lib/ElasticEmail/models/contacts_list.rb +251 -0
- data/lib/ElasticEmail/models/delivery_optimization_type.rb +38 -0
- data/lib/ElasticEmail/models/email_content.rb +330 -0
- data/lib/ElasticEmail/models/email_data.rb +241 -0
- data/lib/ElasticEmail/models/email_message_data.rb +242 -0
- data/lib/ElasticEmail/models/email_recipient.rb +232 -0
- data/lib/ElasticEmail/models/email_send.rb +229 -0
- data/lib/ElasticEmail/models/email_status.rb +332 -0
- data/lib/ElasticEmail/models/email_transactional_message_data.rb +240 -0
- data/lib/ElasticEmail/models/email_validation_result.rb +300 -0
- data/lib/ElasticEmail/models/email_validation_status.rb +40 -0
- data/lib/ElasticEmail/models/email_view.rb +240 -0
- data/lib/ElasticEmail/models/emails_payload.rb +232 -0
- data/lib/ElasticEmail/models/encoding_type.rb +42 -0
- data/lib/ElasticEmail/models/event_type.rb +43 -0
- data/lib/ElasticEmail/models/events_order_by.rb +37 -0
- data/lib/ElasticEmail/models/export_file_formats.rb +38 -0
- data/lib/ElasticEmail/models/export_link.rb +229 -0
- data/lib/ElasticEmail/models/export_status.rb +39 -0
- data/lib/ElasticEmail/models/file_info.rb +262 -0
- data/lib/ElasticEmail/models/file_payload.rb +239 -0
- data/lib/ElasticEmail/models/file_upload_result.rb +229 -0
- data/lib/ElasticEmail/models/inbound_payload.rb +269 -0
- data/lib/ElasticEmail/models/inbound_route.rb +278 -0
- data/lib/ElasticEmail/models/inbound_route_action_type.rb +38 -0
- data/lib/ElasticEmail/models/inbound_route_filter_type.rb +37 -0
- data/lib/ElasticEmail/models/list_payload.rb +241 -0
- data/lib/ElasticEmail/models/list_update_payload.rb +229 -0
- data/lib/ElasticEmail/models/log_job_status.rb +45 -0
- data/lib/ElasticEmail/models/log_status_summary.rb +340 -0
- data/lib/ElasticEmail/models/merge_email_payload.rb +239 -0
- data/lib/ElasticEmail/models/message_attachment.rb +237 -0
- data/lib/ElasticEmail/models/message_category.rb +52 -0
- data/lib/ElasticEmail/models/new_api_key.rb +286 -0
- data/lib/ElasticEmail/models/new_smtp_credentials.rb +284 -0
- data/lib/ElasticEmail/models/options.rb +271 -0
- data/lib/ElasticEmail/models/recipient_event.rb +341 -0
- data/lib/ElasticEmail/models/segment.rb +230 -0
- data/lib/ElasticEmail/models/segment_payload.rb +229 -0
- data/lib/ElasticEmail/models/smtp_credentials.rb +274 -0
- data/lib/ElasticEmail/models/smtp_credentials_payload.rb +253 -0
- data/lib/ElasticEmail/models/sort_order_item.rb +229 -0
- data/lib/ElasticEmail/models/split_optimization_type.rb +37 -0
- data/lib/ElasticEmail/models/split_options.rb +230 -0
- data/lib/ElasticEmail/models/sub_account_info.rb +300 -0
- data/lib/ElasticEmail/models/subaccount_email_credits_payload.rb +230 -0
- data/lib/ElasticEmail/models/subaccount_email_settings.rb +280 -0
- data/lib/ElasticEmail/models/subaccount_email_settings_payload.rb +270 -0
- data/lib/ElasticEmail/models/subaccount_payload.rb +250 -0
- data/lib/ElasticEmail/models/subaccount_settings_info.rb +220 -0
- data/lib/ElasticEmail/models/subaccount_settings_info_payload.rb +220 -0
- data/lib/ElasticEmail/models/suppression.rb +252 -0
- data/lib/ElasticEmail/models/template.rb +272 -0
- data/lib/ElasticEmail/models/template_payload.rb +252 -0
- data/lib/ElasticEmail/models/template_scope_type.rb +38 -0
- data/lib/ElasticEmail/models/template_type.rb +38 -0
- data/lib/ElasticEmail/models/transactional_recipient.rb +246 -0
- data/lib/ElasticEmail/models/utm.rb +250 -0
- data/lib/ElasticEmail/models/verification_file_result.rb +270 -0
- data/lib/ElasticEmail/models/verification_file_result_details.rb +282 -0
- data/lib/ElasticEmail/models/verification_status.rb +40 -0
- data/lib/ElasticEmail/version.rb +15 -0
- data/spec/api/campaigns_api_spec.rb +98 -0
- data/spec/api/contacts_api_spec.rb +166 -0
- data/spec/api/emails_api_spec.rb +83 -0
- data/spec/api/events_api_spec.rb +146 -0
- data/spec/api/files_api_spec.rb +97 -0
- data/spec/api/inbound_route_api_spec.rb +107 -0
- data/spec/api/lists_api_spec.rb +123 -0
- data/spec/api/security_api_spec.rb +161 -0
- data/spec/api/segments_api_spec.rb +97 -0
- data/spec/api/statistics_api_spec.rb +98 -0
- data/spec/api/sub_accounts_api_spec.rb +110 -0
- data/spec/api/suppressions_api_spec.rb +186 -0
- data/spec/api/templates_api_spec.rb +99 -0
- data/spec/api/verifications_api_spec.rb +145 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/access_level_spec.rb +28 -0
- data/spec/models/account_status_enum_spec.rb +28 -0
- data/spec/models/api_key_payload_spec.rb +58 -0
- data/spec/models/api_key_spec.rb +64 -0
- data/spec/models/body_content_type_spec.rb +28 -0
- data/spec/models/body_part_spec.rb +46 -0
- data/spec/models/campaign_options_spec.rb +58 -0
- data/spec/models/campaign_recipient_spec.rb +40 -0
- data/spec/models/campaign_spec.rb +58 -0
- data/spec/models/campaign_status_spec.rb +28 -0
- data/spec/models/campaign_template_spec.rb +70 -0
- data/spec/models/channel_log_status_summary_spec.rb +112 -0
- data/spec/models/compression_format_spec.rb +28 -0
- data/spec/models/consent_data_spec.rb +46 -0
- data/spec/models/consent_tracking_spec.rb +28 -0
- data/spec/models/contact_activity_spec.rb +94 -0
- data/spec/models/contact_hist_event_type_spec.rb +28 -0
- data/spec/models/contact_history_spec.rb +70 -0
- data/spec/models/contact_payload_spec.rb +64 -0
- data/spec/models/contact_source_spec.rb +28 -0
- data/spec/models/contact_spec.rb +94 -0
- data/spec/models/contact_status_spec.rb +28 -0
- data/spec/models/contact_update_payload_spec.rb +46 -0
- data/spec/models/contacts_list_spec.rb +52 -0
- data/spec/models/delivery_optimization_type_spec.rb +28 -0
- data/spec/models/email_content_spec.rb +94 -0
- data/spec/models/email_data_spec.rb +46 -0
- data/spec/models/email_message_data_spec.rb +46 -0
- data/spec/models/email_recipient_spec.rb +40 -0
- data/spec/models/email_send_spec.rb +40 -0
- data/spec/models/email_status_spec.rb +100 -0
- data/spec/models/email_transactional_message_data_spec.rb +46 -0
- data/spec/models/email_validation_result_spec.rb +82 -0
- data/spec/models/email_validation_status_spec.rb +28 -0
- data/spec/models/email_view_spec.rb +46 -0
- data/spec/models/emails_payload_spec.rb +40 -0
- data/spec/models/encoding_type_spec.rb +28 -0
- data/spec/models/event_type_spec.rb +28 -0
- data/spec/models/events_order_by_spec.rb +28 -0
- data/spec/models/export_file_formats_spec.rb +28 -0
- data/spec/models/export_link_spec.rb +40 -0
- data/spec/models/export_status_spec.rb +28 -0
- data/spec/models/file_info_spec.rb +58 -0
- data/spec/models/file_payload_spec.rb +46 -0
- data/spec/models/file_upload_result_spec.rb +40 -0
- data/spec/models/inbound_payload_spec.rb +64 -0
- data/spec/models/inbound_route_action_type_spec.rb +28 -0
- data/spec/models/inbound_route_filter_type_spec.rb +28 -0
- data/spec/models/inbound_route_spec.rb +70 -0
- data/spec/models/list_payload_spec.rb +46 -0
- data/spec/models/list_update_payload_spec.rb +40 -0
- data/spec/models/log_job_status_spec.rb +28 -0
- data/spec/models/log_status_summary_spec.rb +106 -0
- data/spec/models/merge_email_payload_spec.rb +46 -0
- data/spec/models/message_attachment_spec.rb +46 -0
- data/spec/models/message_category_spec.rb +28 -0
- data/spec/models/new_api_key_spec.rb +70 -0
- data/spec/models/new_smtp_credentials_spec.rb +70 -0
- data/spec/models/options_spec.rb +64 -0
- data/spec/models/recipient_event_spec.rb +106 -0
- data/spec/models/segment_payload_spec.rb +40 -0
- data/spec/models/segment_spec.rb +40 -0
- data/spec/models/smtp_credentials_payload_spec.rb +52 -0
- data/spec/models/smtp_credentials_spec.rb +64 -0
- data/spec/models/sort_order_item_spec.rb +40 -0
- data/spec/models/split_optimization_type_spec.rb +28 -0
- data/spec/models/split_options_spec.rb +40 -0
- data/spec/models/sub_account_info_spec.rb +82 -0
- data/spec/models/subaccount_email_credits_payload_spec.rb +40 -0
- data/spec/models/subaccount_email_settings_payload_spec.rb +64 -0
- data/spec/models/subaccount_email_settings_spec.rb +70 -0
- data/spec/models/subaccount_payload_spec.rb +52 -0
- data/spec/models/subaccount_settings_info_payload_spec.rb +34 -0
- data/spec/models/subaccount_settings_info_spec.rb +34 -0
- data/spec/models/suppression_spec.rb +52 -0
- data/spec/models/template_payload_spec.rb +52 -0
- data/spec/models/template_scope_type_spec.rb +28 -0
- data/spec/models/template_spec.rb +64 -0
- data/spec/models/template_type_spec.rb +28 -0
- data/spec/models/transactional_recipient_spec.rb +46 -0
- data/spec/models/utm_spec.rb +52 -0
- data/spec/models/verification_file_result_details_spec.rb +70 -0
- data/spec/models/verification_file_result_spec.rb +64 -0
- data/spec/models/verification_status_spec.rb +28 -0
- data/spec/spec_helper.rb +111 -0
- metadata +498 -0
@@ -0,0 +1,681 @@
|
|
1
|
+
=begin
|
2
|
+
#Elastic Email REST API
|
3
|
+
|
4
|
+
#This API is based on the REST API architecture, allowing the user to easily manage their data with this resource-based approach. Every API call is established on which specific request type (GET, POST, PUT, DELETE) will be used. To start using this API, you will need your Access Token (available <a href=\"https://elasticemail.com/account#/settings/new/manage-api\">here</a>). Remember to keep it safe. Required access levels are listed in the given request’s description. This is the documentation for REST API. If you’d like to read our legacy documentation regarding Web API v2 click <a href=\"https://api.elasticemail.com/public/help\">here</a>.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 4.0.0
|
7
|
+
Contact: support@elasticemail.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module ElasticEmail
|
16
|
+
class ContactsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Delete Contact
|
23
|
+
# Deletes the provided contact. Required Access Level: ModifyContacts
|
24
|
+
# @param email [String] Proper email address.
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [nil]
|
27
|
+
def contacts_by_email_delete(email, opts = {})
|
28
|
+
contacts_by_email_delete_with_http_info(email, opts)
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
|
32
|
+
# Delete Contact
|
33
|
+
# Deletes the provided contact. Required Access Level: ModifyContacts
|
34
|
+
# @param email [String] Proper email address.
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
37
|
+
def contacts_by_email_delete_with_http_info(email, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: ContactsApi.contacts_by_email_delete ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'email' is set
|
42
|
+
if @api_client.config.client_side_validation && email.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'email' when calling ContactsApi.contacts_by_email_delete"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/contacts/{email}'.sub('{' + 'email' + '}', CGI.escape(email.to_s))
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
|
54
|
+
# form parameters
|
55
|
+
form_params = opts[:form_params] || {}
|
56
|
+
|
57
|
+
# http body (model)
|
58
|
+
post_body = opts[:debug_body]
|
59
|
+
|
60
|
+
# return_type
|
61
|
+
return_type = opts[:debug_return_type]
|
62
|
+
|
63
|
+
# auth_names
|
64
|
+
auth_names = opts[:debug_auth_names] || ['apikey']
|
65
|
+
|
66
|
+
new_options = opts.merge(
|
67
|
+
:operation => :"ContactsApi.contacts_by_email_delete",
|
68
|
+
:header_params => header_params,
|
69
|
+
:query_params => query_params,
|
70
|
+
:form_params => form_params,
|
71
|
+
:body => post_body,
|
72
|
+
:auth_names => auth_names,
|
73
|
+
:return_type => return_type
|
74
|
+
)
|
75
|
+
|
76
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
77
|
+
if @api_client.config.debugging
|
78
|
+
@api_client.config.logger.debug "API called: ContactsApi#contacts_by_email_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
79
|
+
end
|
80
|
+
return data, status_code, headers
|
81
|
+
end
|
82
|
+
|
83
|
+
# Load Contact
|
84
|
+
# Load detailed contact information for specified email. Required Access Level: ViewContacts
|
85
|
+
# @param email [String] Proper email address.
|
86
|
+
# @param [Hash] opts the optional parameters
|
87
|
+
# @return [Contact]
|
88
|
+
def contacts_by_email_get(email, opts = {})
|
89
|
+
data, _status_code, _headers = contacts_by_email_get_with_http_info(email, opts)
|
90
|
+
data
|
91
|
+
end
|
92
|
+
|
93
|
+
# Load Contact
|
94
|
+
# Load detailed contact information for specified email. Required Access Level: ViewContacts
|
95
|
+
# @param email [String] Proper email address.
|
96
|
+
# @param [Hash] opts the optional parameters
|
97
|
+
# @return [Array<(Contact, Integer, Hash)>] Contact data, response status code and response headers
|
98
|
+
def contacts_by_email_get_with_http_info(email, opts = {})
|
99
|
+
if @api_client.config.debugging
|
100
|
+
@api_client.config.logger.debug 'Calling API: ContactsApi.contacts_by_email_get ...'
|
101
|
+
end
|
102
|
+
# verify the required parameter 'email' is set
|
103
|
+
if @api_client.config.client_side_validation && email.nil?
|
104
|
+
fail ArgumentError, "Missing the required parameter 'email' when calling ContactsApi.contacts_by_email_get"
|
105
|
+
end
|
106
|
+
# resource path
|
107
|
+
local_var_path = '/contacts/{email}'.sub('{' + 'email' + '}', CGI.escape(email.to_s))
|
108
|
+
|
109
|
+
# query parameters
|
110
|
+
query_params = opts[:query_params] || {}
|
111
|
+
|
112
|
+
# header parameters
|
113
|
+
header_params = opts[:header_params] || {}
|
114
|
+
# HTTP header 'Accept' (if needed)
|
115
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
116
|
+
|
117
|
+
# form parameters
|
118
|
+
form_params = opts[:form_params] || {}
|
119
|
+
|
120
|
+
# http body (model)
|
121
|
+
post_body = opts[:debug_body]
|
122
|
+
|
123
|
+
# return_type
|
124
|
+
return_type = opts[:debug_return_type] || 'Contact'
|
125
|
+
|
126
|
+
# auth_names
|
127
|
+
auth_names = opts[:debug_auth_names] || ['apikey']
|
128
|
+
|
129
|
+
new_options = opts.merge(
|
130
|
+
:operation => :"ContactsApi.contacts_by_email_get",
|
131
|
+
:header_params => header_params,
|
132
|
+
:query_params => query_params,
|
133
|
+
:form_params => form_params,
|
134
|
+
:body => post_body,
|
135
|
+
:auth_names => auth_names,
|
136
|
+
:return_type => return_type
|
137
|
+
)
|
138
|
+
|
139
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
140
|
+
if @api_client.config.debugging
|
141
|
+
@api_client.config.logger.debug "API called: ContactsApi#contacts_by_email_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
142
|
+
end
|
143
|
+
return data, status_code, headers
|
144
|
+
end
|
145
|
+
|
146
|
+
# Load History
|
147
|
+
# Returns detailed history of specified Contact. Required Access Level: ViewContacts
|
148
|
+
# @param email [String] Proper email address.
|
149
|
+
# @param [Hash] opts the optional parameters
|
150
|
+
# @option opts [Integer] :limit Maximum number of returned items.
|
151
|
+
# @option opts [Integer] :offset How many items should be returned ahead.
|
152
|
+
# @return [Array<ContactHistory>]
|
153
|
+
def contacts_by_email_history_get(email, opts = {})
|
154
|
+
data, _status_code, _headers = contacts_by_email_history_get_with_http_info(email, opts)
|
155
|
+
data
|
156
|
+
end
|
157
|
+
|
158
|
+
# Load History
|
159
|
+
# Returns detailed history of specified Contact. Required Access Level: ViewContacts
|
160
|
+
# @param email [String] Proper email address.
|
161
|
+
# @param [Hash] opts the optional parameters
|
162
|
+
# @option opts [Integer] :limit Maximum number of returned items.
|
163
|
+
# @option opts [Integer] :offset How many items should be returned ahead.
|
164
|
+
# @return [Array<(Array<ContactHistory>, Integer, Hash)>] Array<ContactHistory> data, response status code and response headers
|
165
|
+
def contacts_by_email_history_get_with_http_info(email, opts = {})
|
166
|
+
if @api_client.config.debugging
|
167
|
+
@api_client.config.logger.debug 'Calling API: ContactsApi.contacts_by_email_history_get ...'
|
168
|
+
end
|
169
|
+
# verify the required parameter 'email' is set
|
170
|
+
if @api_client.config.client_side_validation && email.nil?
|
171
|
+
fail ArgumentError, "Missing the required parameter 'email' when calling ContactsApi.contacts_by_email_history_get"
|
172
|
+
end
|
173
|
+
# resource path
|
174
|
+
local_var_path = '/contacts/{email}/history'.sub('{' + 'email' + '}', CGI.escape(email.to_s))
|
175
|
+
|
176
|
+
# query parameters
|
177
|
+
query_params = opts[:query_params] || {}
|
178
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
179
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
180
|
+
|
181
|
+
# header parameters
|
182
|
+
header_params = opts[:header_params] || {}
|
183
|
+
# HTTP header 'Accept' (if needed)
|
184
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
185
|
+
|
186
|
+
# form parameters
|
187
|
+
form_params = opts[:form_params] || {}
|
188
|
+
|
189
|
+
# http body (model)
|
190
|
+
post_body = opts[:debug_body]
|
191
|
+
|
192
|
+
# return_type
|
193
|
+
return_type = opts[:debug_return_type] || 'Array<ContactHistory>'
|
194
|
+
|
195
|
+
# auth_names
|
196
|
+
auth_names = opts[:debug_auth_names] || ['apikey']
|
197
|
+
|
198
|
+
new_options = opts.merge(
|
199
|
+
:operation => :"ContactsApi.contacts_by_email_history_get",
|
200
|
+
:header_params => header_params,
|
201
|
+
:query_params => query_params,
|
202
|
+
:form_params => form_params,
|
203
|
+
:body => post_body,
|
204
|
+
:auth_names => auth_names,
|
205
|
+
:return_type => return_type
|
206
|
+
)
|
207
|
+
|
208
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
209
|
+
if @api_client.config.debugging
|
210
|
+
@api_client.config.logger.debug "API called: ContactsApi#contacts_by_email_history_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
211
|
+
end
|
212
|
+
return data, status_code, headers
|
213
|
+
end
|
214
|
+
|
215
|
+
# Update Contact
|
216
|
+
# Update selected contact. Omitted contact's fields will not be changed. Required Access Level: ModifyContacts
|
217
|
+
# @param email [String] Proper email address.
|
218
|
+
# @param contact_update_payload [ContactUpdatePayload]
|
219
|
+
# @param [Hash] opts the optional parameters
|
220
|
+
# @return [Contact]
|
221
|
+
def contacts_by_email_put(email, contact_update_payload, opts = {})
|
222
|
+
data, _status_code, _headers = contacts_by_email_put_with_http_info(email, contact_update_payload, opts)
|
223
|
+
data
|
224
|
+
end
|
225
|
+
|
226
|
+
# Update Contact
|
227
|
+
# Update selected contact. Omitted contact's fields will not be changed. Required Access Level: ModifyContacts
|
228
|
+
# @param email [String] Proper email address.
|
229
|
+
# @param contact_update_payload [ContactUpdatePayload]
|
230
|
+
# @param [Hash] opts the optional parameters
|
231
|
+
# @return [Array<(Contact, Integer, Hash)>] Contact data, response status code and response headers
|
232
|
+
def contacts_by_email_put_with_http_info(email, contact_update_payload, opts = {})
|
233
|
+
if @api_client.config.debugging
|
234
|
+
@api_client.config.logger.debug 'Calling API: ContactsApi.contacts_by_email_put ...'
|
235
|
+
end
|
236
|
+
# verify the required parameter 'email' is set
|
237
|
+
if @api_client.config.client_side_validation && email.nil?
|
238
|
+
fail ArgumentError, "Missing the required parameter 'email' when calling ContactsApi.contacts_by_email_put"
|
239
|
+
end
|
240
|
+
# verify the required parameter 'contact_update_payload' is set
|
241
|
+
if @api_client.config.client_side_validation && contact_update_payload.nil?
|
242
|
+
fail ArgumentError, "Missing the required parameter 'contact_update_payload' when calling ContactsApi.contacts_by_email_put"
|
243
|
+
end
|
244
|
+
# resource path
|
245
|
+
local_var_path = '/contacts/{email}'.sub('{' + 'email' + '}', CGI.escape(email.to_s))
|
246
|
+
|
247
|
+
# query parameters
|
248
|
+
query_params = opts[:query_params] || {}
|
249
|
+
|
250
|
+
# header parameters
|
251
|
+
header_params = opts[:header_params] || {}
|
252
|
+
# HTTP header 'Accept' (if needed)
|
253
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
254
|
+
# HTTP header 'Content-Type'
|
255
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
256
|
+
|
257
|
+
# form parameters
|
258
|
+
form_params = opts[:form_params] || {}
|
259
|
+
|
260
|
+
# http body (model)
|
261
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(contact_update_payload)
|
262
|
+
|
263
|
+
# return_type
|
264
|
+
return_type = opts[:debug_return_type] || 'Contact'
|
265
|
+
|
266
|
+
# auth_names
|
267
|
+
auth_names = opts[:debug_auth_names] || ['apikey']
|
268
|
+
|
269
|
+
new_options = opts.merge(
|
270
|
+
:operation => :"ContactsApi.contacts_by_email_put",
|
271
|
+
:header_params => header_params,
|
272
|
+
:query_params => query_params,
|
273
|
+
:form_params => form_params,
|
274
|
+
:body => post_body,
|
275
|
+
:auth_names => auth_names,
|
276
|
+
:return_type => return_type
|
277
|
+
)
|
278
|
+
|
279
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
280
|
+
if @api_client.config.debugging
|
281
|
+
@api_client.config.logger.debug "API called: ContactsApi#contacts_by_email_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
282
|
+
end
|
283
|
+
return data, status_code, headers
|
284
|
+
end
|
285
|
+
|
286
|
+
# Delete Contacts Bulk
|
287
|
+
# Deletes provided contacts in bulk. Required Access Level: ModifyContacts
|
288
|
+
# @param emails_payload [EmailsPayload] Provide either rule or a list of emails, not both.
|
289
|
+
# @param [Hash] opts the optional parameters
|
290
|
+
# @return [nil]
|
291
|
+
def contacts_delete_post(emails_payload, opts = {})
|
292
|
+
contacts_delete_post_with_http_info(emails_payload, opts)
|
293
|
+
nil
|
294
|
+
end
|
295
|
+
|
296
|
+
# Delete Contacts Bulk
|
297
|
+
# Deletes provided contacts in bulk. Required Access Level: ModifyContacts
|
298
|
+
# @param emails_payload [EmailsPayload] Provide either rule or a list of emails, not both.
|
299
|
+
# @param [Hash] opts the optional parameters
|
300
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
301
|
+
def contacts_delete_post_with_http_info(emails_payload, opts = {})
|
302
|
+
if @api_client.config.debugging
|
303
|
+
@api_client.config.logger.debug 'Calling API: ContactsApi.contacts_delete_post ...'
|
304
|
+
end
|
305
|
+
# verify the required parameter 'emails_payload' is set
|
306
|
+
if @api_client.config.client_side_validation && emails_payload.nil?
|
307
|
+
fail ArgumentError, "Missing the required parameter 'emails_payload' when calling ContactsApi.contacts_delete_post"
|
308
|
+
end
|
309
|
+
# resource path
|
310
|
+
local_var_path = '/contacts/delete'
|
311
|
+
|
312
|
+
# query parameters
|
313
|
+
query_params = opts[:query_params] || {}
|
314
|
+
|
315
|
+
# header parameters
|
316
|
+
header_params = opts[:header_params] || {}
|
317
|
+
# HTTP header 'Content-Type'
|
318
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
319
|
+
|
320
|
+
# form parameters
|
321
|
+
form_params = opts[:form_params] || {}
|
322
|
+
|
323
|
+
# http body (model)
|
324
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(emails_payload)
|
325
|
+
|
326
|
+
# return_type
|
327
|
+
return_type = opts[:debug_return_type]
|
328
|
+
|
329
|
+
# auth_names
|
330
|
+
auth_names = opts[:debug_auth_names] || ['apikey']
|
331
|
+
|
332
|
+
new_options = opts.merge(
|
333
|
+
:operation => :"ContactsApi.contacts_delete_post",
|
334
|
+
:header_params => header_params,
|
335
|
+
:query_params => query_params,
|
336
|
+
:form_params => form_params,
|
337
|
+
:body => post_body,
|
338
|
+
:auth_names => auth_names,
|
339
|
+
:return_type => return_type
|
340
|
+
)
|
341
|
+
|
342
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
343
|
+
if @api_client.config.debugging
|
344
|
+
@api_client.config.logger.debug "API called: ContactsApi#contacts_delete_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
345
|
+
end
|
346
|
+
return data, status_code, headers
|
347
|
+
end
|
348
|
+
|
349
|
+
# Check Export Status
|
350
|
+
# Check the current status of the export. Required Access Level: Export
|
351
|
+
# @param id [String] ID of the exported file
|
352
|
+
# @param [Hash] opts the optional parameters
|
353
|
+
# @return [ExportStatus]
|
354
|
+
def contacts_export_by_id_status_get(id, opts = {})
|
355
|
+
data, _status_code, _headers = contacts_export_by_id_status_get_with_http_info(id, opts)
|
356
|
+
data
|
357
|
+
end
|
358
|
+
|
359
|
+
# Check Export Status
|
360
|
+
# Check the current status of the export. Required Access Level: Export
|
361
|
+
# @param id [String] ID of the exported file
|
362
|
+
# @param [Hash] opts the optional parameters
|
363
|
+
# @return [Array<(ExportStatus, Integer, Hash)>] ExportStatus data, response status code and response headers
|
364
|
+
def contacts_export_by_id_status_get_with_http_info(id, opts = {})
|
365
|
+
if @api_client.config.debugging
|
366
|
+
@api_client.config.logger.debug 'Calling API: ContactsApi.contacts_export_by_id_status_get ...'
|
367
|
+
end
|
368
|
+
# verify the required parameter 'id' is set
|
369
|
+
if @api_client.config.client_side_validation && id.nil?
|
370
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ContactsApi.contacts_export_by_id_status_get"
|
371
|
+
end
|
372
|
+
# resource path
|
373
|
+
local_var_path = '/contacts/export/{id}/status'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
374
|
+
|
375
|
+
# query parameters
|
376
|
+
query_params = opts[:query_params] || {}
|
377
|
+
|
378
|
+
# header parameters
|
379
|
+
header_params = opts[:header_params] || {}
|
380
|
+
# HTTP header 'Accept' (if needed)
|
381
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
382
|
+
|
383
|
+
# form parameters
|
384
|
+
form_params = opts[:form_params] || {}
|
385
|
+
|
386
|
+
# http body (model)
|
387
|
+
post_body = opts[:debug_body]
|
388
|
+
|
389
|
+
# return_type
|
390
|
+
return_type = opts[:debug_return_type] || 'ExportStatus'
|
391
|
+
|
392
|
+
# auth_names
|
393
|
+
auth_names = opts[:debug_auth_names] || ['apikey']
|
394
|
+
|
395
|
+
new_options = opts.merge(
|
396
|
+
:operation => :"ContactsApi.contacts_export_by_id_status_get",
|
397
|
+
:header_params => header_params,
|
398
|
+
:query_params => query_params,
|
399
|
+
:form_params => form_params,
|
400
|
+
:body => post_body,
|
401
|
+
:auth_names => auth_names,
|
402
|
+
:return_type => return_type
|
403
|
+
)
|
404
|
+
|
405
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
406
|
+
if @api_client.config.debugging
|
407
|
+
@api_client.config.logger.debug "API called: ContactsApi#contacts_export_by_id_status_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
408
|
+
end
|
409
|
+
return data, status_code, headers
|
410
|
+
end
|
411
|
+
|
412
|
+
# Export Contacts
|
413
|
+
# Request an Export of specified Contacts. Required Access Level: Export
|
414
|
+
# @param [Hash] opts the optional parameters
|
415
|
+
# @option opts [ExportFileFormats] :file_format Format of the exported file
|
416
|
+
# @option opts [String] :rule Query used for filtering.
|
417
|
+
# @option opts [Array<String>] :emails Comma delimited list of contact emails
|
418
|
+
# @option opts [CompressionFormat] :compression_format FileResponse compression format. None or Zip.
|
419
|
+
# @option opts [String] :file_name Name of your file including extension.
|
420
|
+
# @return [ExportLink]
|
421
|
+
def contacts_export_post(opts = {})
|
422
|
+
data, _status_code, _headers = contacts_export_post_with_http_info(opts)
|
423
|
+
data
|
424
|
+
end
|
425
|
+
|
426
|
+
# Export Contacts
|
427
|
+
# Request an Export of specified Contacts. Required Access Level: Export
|
428
|
+
# @param [Hash] opts the optional parameters
|
429
|
+
# @option opts [ExportFileFormats] :file_format Format of the exported file
|
430
|
+
# @option opts [String] :rule Query used for filtering.
|
431
|
+
# @option opts [Array<String>] :emails Comma delimited list of contact emails
|
432
|
+
# @option opts [CompressionFormat] :compression_format FileResponse compression format. None or Zip.
|
433
|
+
# @option opts [String] :file_name Name of your file including extension.
|
434
|
+
# @return [Array<(ExportLink, Integer, Hash)>] ExportLink data, response status code and response headers
|
435
|
+
def contacts_export_post_with_http_info(opts = {})
|
436
|
+
if @api_client.config.debugging
|
437
|
+
@api_client.config.logger.debug 'Calling API: ContactsApi.contacts_export_post ...'
|
438
|
+
end
|
439
|
+
# resource path
|
440
|
+
local_var_path = '/contacts/export'
|
441
|
+
|
442
|
+
# query parameters
|
443
|
+
query_params = opts[:query_params] || {}
|
444
|
+
query_params[:'fileFormat'] = opts[:'file_format'] if !opts[:'file_format'].nil?
|
445
|
+
query_params[:'rule'] = opts[:'rule'] if !opts[:'rule'].nil?
|
446
|
+
query_params[:'emails'] = @api_client.build_collection_param(opts[:'emails'], :multi) if !opts[:'emails'].nil?
|
447
|
+
query_params[:'compressionFormat'] = opts[:'compression_format'] if !opts[:'compression_format'].nil?
|
448
|
+
query_params[:'fileName'] = opts[:'file_name'] if !opts[:'file_name'].nil?
|
449
|
+
|
450
|
+
# header parameters
|
451
|
+
header_params = opts[:header_params] || {}
|
452
|
+
# HTTP header 'Accept' (if needed)
|
453
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
454
|
+
|
455
|
+
# form parameters
|
456
|
+
form_params = opts[:form_params] || {}
|
457
|
+
|
458
|
+
# http body (model)
|
459
|
+
post_body = opts[:debug_body]
|
460
|
+
|
461
|
+
# return_type
|
462
|
+
return_type = opts[:debug_return_type] || 'ExportLink'
|
463
|
+
|
464
|
+
# auth_names
|
465
|
+
auth_names = opts[:debug_auth_names] || ['apikey']
|
466
|
+
|
467
|
+
new_options = opts.merge(
|
468
|
+
:operation => :"ContactsApi.contacts_export_post",
|
469
|
+
:header_params => header_params,
|
470
|
+
:query_params => query_params,
|
471
|
+
:form_params => form_params,
|
472
|
+
:body => post_body,
|
473
|
+
:auth_names => auth_names,
|
474
|
+
:return_type => return_type
|
475
|
+
)
|
476
|
+
|
477
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
478
|
+
if @api_client.config.debugging
|
479
|
+
@api_client.config.logger.debug "API called: ContactsApi#contacts_export_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
480
|
+
end
|
481
|
+
return data, status_code, headers
|
482
|
+
end
|
483
|
+
|
484
|
+
# Load Contacts
|
485
|
+
# Returns a list of contacts. Required Access Level: ViewContacts
|
486
|
+
# @param [Hash] opts the optional parameters
|
487
|
+
# @option opts [Integer] :limit Maximum number of returned items.
|
488
|
+
# @option opts [Integer] :offset How many items should be returned ahead.
|
489
|
+
# @return [Array<Contact>]
|
490
|
+
def contacts_get(opts = {})
|
491
|
+
data, _status_code, _headers = contacts_get_with_http_info(opts)
|
492
|
+
data
|
493
|
+
end
|
494
|
+
|
495
|
+
# Load Contacts
|
496
|
+
# Returns a list of contacts. Required Access Level: ViewContacts
|
497
|
+
# @param [Hash] opts the optional parameters
|
498
|
+
# @option opts [Integer] :limit Maximum number of returned items.
|
499
|
+
# @option opts [Integer] :offset How many items should be returned ahead.
|
500
|
+
# @return [Array<(Array<Contact>, Integer, Hash)>] Array<Contact> data, response status code and response headers
|
501
|
+
def contacts_get_with_http_info(opts = {})
|
502
|
+
if @api_client.config.debugging
|
503
|
+
@api_client.config.logger.debug 'Calling API: ContactsApi.contacts_get ...'
|
504
|
+
end
|
505
|
+
# resource path
|
506
|
+
local_var_path = '/contacts'
|
507
|
+
|
508
|
+
# query parameters
|
509
|
+
query_params = opts[:query_params] || {}
|
510
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
511
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
512
|
+
|
513
|
+
# header parameters
|
514
|
+
header_params = opts[:header_params] || {}
|
515
|
+
# HTTP header 'Accept' (if needed)
|
516
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
517
|
+
|
518
|
+
# form parameters
|
519
|
+
form_params = opts[:form_params] || {}
|
520
|
+
|
521
|
+
# http body (model)
|
522
|
+
post_body = opts[:debug_body]
|
523
|
+
|
524
|
+
# return_type
|
525
|
+
return_type = opts[:debug_return_type] || 'Array<Contact>'
|
526
|
+
|
527
|
+
# auth_names
|
528
|
+
auth_names = opts[:debug_auth_names] || ['apikey']
|
529
|
+
|
530
|
+
new_options = opts.merge(
|
531
|
+
:operation => :"ContactsApi.contacts_get",
|
532
|
+
:header_params => header_params,
|
533
|
+
:query_params => query_params,
|
534
|
+
:form_params => form_params,
|
535
|
+
:body => post_body,
|
536
|
+
:auth_names => auth_names,
|
537
|
+
:return_type => return_type
|
538
|
+
)
|
539
|
+
|
540
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
541
|
+
if @api_client.config.debugging
|
542
|
+
@api_client.config.logger.debug "API called: ContactsApi#contacts_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
543
|
+
end
|
544
|
+
return data, status_code, headers
|
545
|
+
end
|
546
|
+
|
547
|
+
# Upload Contacts
|
548
|
+
# Upload contacts from a file. Required Access Level: ModifyContacts
|
549
|
+
# @param [Hash] opts the optional parameters
|
550
|
+
# @option opts [String] :list_name Name of an existing list to add these contacts to
|
551
|
+
# @option opts [String] :encoding_name In what encoding the file is uploaded
|
552
|
+
# @option opts [File] :file
|
553
|
+
# @return [nil]
|
554
|
+
def contacts_import_post(opts = {})
|
555
|
+
contacts_import_post_with_http_info(opts)
|
556
|
+
nil
|
557
|
+
end
|
558
|
+
|
559
|
+
# Upload Contacts
|
560
|
+
# Upload contacts from a file. Required Access Level: ModifyContacts
|
561
|
+
# @param [Hash] opts the optional parameters
|
562
|
+
# @option opts [String] :list_name Name of an existing list to add these contacts to
|
563
|
+
# @option opts [String] :encoding_name In what encoding the file is uploaded
|
564
|
+
# @option opts [File] :file
|
565
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
566
|
+
def contacts_import_post_with_http_info(opts = {})
|
567
|
+
if @api_client.config.debugging
|
568
|
+
@api_client.config.logger.debug 'Calling API: ContactsApi.contacts_import_post ...'
|
569
|
+
end
|
570
|
+
# resource path
|
571
|
+
local_var_path = '/contacts/import'
|
572
|
+
|
573
|
+
# query parameters
|
574
|
+
query_params = opts[:query_params] || {}
|
575
|
+
query_params[:'listName'] = opts[:'list_name'] if !opts[:'list_name'].nil?
|
576
|
+
query_params[:'encodingName'] = opts[:'encoding_name'] if !opts[:'encoding_name'].nil?
|
577
|
+
|
578
|
+
# header parameters
|
579
|
+
header_params = opts[:header_params] || {}
|
580
|
+
# HTTP header 'Content-Type'
|
581
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
582
|
+
|
583
|
+
# form parameters
|
584
|
+
form_params = opts[:form_params] || {}
|
585
|
+
form_params['file'] = opts[:'file'] if !opts[:'file'].nil?
|
586
|
+
|
587
|
+
# http body (model)
|
588
|
+
post_body = opts[:debug_body]
|
589
|
+
|
590
|
+
# return_type
|
591
|
+
return_type = opts[:debug_return_type]
|
592
|
+
|
593
|
+
# auth_names
|
594
|
+
auth_names = opts[:debug_auth_names] || ['apikey']
|
595
|
+
|
596
|
+
new_options = opts.merge(
|
597
|
+
:operation => :"ContactsApi.contacts_import_post",
|
598
|
+
:header_params => header_params,
|
599
|
+
:query_params => query_params,
|
600
|
+
:form_params => form_params,
|
601
|
+
:body => post_body,
|
602
|
+
:auth_names => auth_names,
|
603
|
+
:return_type => return_type
|
604
|
+
)
|
605
|
+
|
606
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
607
|
+
if @api_client.config.debugging
|
608
|
+
@api_client.config.logger.debug "API called: ContactsApi#contacts_import_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
609
|
+
end
|
610
|
+
return data, status_code, headers
|
611
|
+
end
|
612
|
+
|
613
|
+
# Add Contact
|
614
|
+
# Add new Contacts to your Lists. Up to 1000 can be added (for more please refer to the import request). Required Access Level: ModifyContacts
|
615
|
+
# @param contact_payload [Array<ContactPayload>]
|
616
|
+
# @param [Hash] opts the optional parameters
|
617
|
+
# @option opts [Array<String>] :listnames Names of lists to which the uploaded contacts should be added to
|
618
|
+
# @return [Array<Contact>]
|
619
|
+
def contacts_post(contact_payload, opts = {})
|
620
|
+
data, _status_code, _headers = contacts_post_with_http_info(contact_payload, opts)
|
621
|
+
data
|
622
|
+
end
|
623
|
+
|
624
|
+
# Add Contact
|
625
|
+
# Add new Contacts to your Lists. Up to 1000 can be added (for more please refer to the import request). Required Access Level: ModifyContacts
|
626
|
+
# @param contact_payload [Array<ContactPayload>]
|
627
|
+
# @param [Hash] opts the optional parameters
|
628
|
+
# @option opts [Array<String>] :listnames Names of lists to which the uploaded contacts should be added to
|
629
|
+
# @return [Array<(Array<Contact>, Integer, Hash)>] Array<Contact> data, response status code and response headers
|
630
|
+
def contacts_post_with_http_info(contact_payload, opts = {})
|
631
|
+
if @api_client.config.debugging
|
632
|
+
@api_client.config.logger.debug 'Calling API: ContactsApi.contacts_post ...'
|
633
|
+
end
|
634
|
+
# verify the required parameter 'contact_payload' is set
|
635
|
+
if @api_client.config.client_side_validation && contact_payload.nil?
|
636
|
+
fail ArgumentError, "Missing the required parameter 'contact_payload' when calling ContactsApi.contacts_post"
|
637
|
+
end
|
638
|
+
# resource path
|
639
|
+
local_var_path = '/contacts'
|
640
|
+
|
641
|
+
# query parameters
|
642
|
+
query_params = opts[:query_params] || {}
|
643
|
+
query_params[:'listnames'] = @api_client.build_collection_param(opts[:'listnames'], :multi) if !opts[:'listnames'].nil?
|
644
|
+
|
645
|
+
# header parameters
|
646
|
+
header_params = opts[:header_params] || {}
|
647
|
+
# HTTP header 'Accept' (if needed)
|
648
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
649
|
+
# HTTP header 'Content-Type'
|
650
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
651
|
+
|
652
|
+
# form parameters
|
653
|
+
form_params = opts[:form_params] || {}
|
654
|
+
|
655
|
+
# http body (model)
|
656
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(contact_payload)
|
657
|
+
|
658
|
+
# return_type
|
659
|
+
return_type = opts[:debug_return_type] || 'Array<Contact>'
|
660
|
+
|
661
|
+
# auth_names
|
662
|
+
auth_names = opts[:debug_auth_names] || ['apikey']
|
663
|
+
|
664
|
+
new_options = opts.merge(
|
665
|
+
:operation => :"ContactsApi.contacts_post",
|
666
|
+
:header_params => header_params,
|
667
|
+
:query_params => query_params,
|
668
|
+
:form_params => form_params,
|
669
|
+
:body => post_body,
|
670
|
+
:auth_names => auth_names,
|
671
|
+
:return_type => return_type
|
672
|
+
)
|
673
|
+
|
674
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
675
|
+
if @api_client.config.debugging
|
676
|
+
@api_client.config.logger.debug "API called: ContactsApi#contacts_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
677
|
+
end
|
678
|
+
return data, status_code, headers
|
679
|
+
end
|
680
|
+
end
|
681
|
+
end
|