clicksend_client 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +78 -0
- data/Rakefile +8 -0
- data/clicksend_client-1.0.1.gem +0 -0
- data/clicksend_client.gemspec +45 -0
- data/docs/Account.md +15 -0
- data/docs/AccountApi.md +433 -0
- data/docs/AccountForgotPasswordVerify.md +10 -0
- data/docs/AccountRechargeApi.md +330 -0
- data/docs/AccountVerify.md +10 -0
- data/docs/Address.md +14 -0
- data/docs/Attachment.md +12 -0
- data/docs/Contact.md +23 -0
- data/docs/ContactApi.md +416 -0
- data/docs/ContactList.md +8 -0
- data/docs/ContactListApi.md +398 -0
- data/docs/ContactListImport.md +9 -0
- data/docs/CountriesApi.md +50 -0
- data/docs/CreditCard.md +13 -0
- data/docs/DateBefore.md +8 -0
- data/docs/DeliveryIssue.md +12 -0
- data/docs/DeliveryIssuesApi.md +119 -0
- data/docs/DeliveryReceiptRule.md +12 -0
- data/docs/DetectAddressApi.md +62 -0
- data/docs/Email.md +15 -0
- data/docs/EmailAddress.md +8 -0
- data/docs/EmailCampaign.md +15 -0
- data/docs/EmailDeliveryReceiptRulesApi.md +286 -0
- data/docs/EmailFrom.md +9 -0
- data/docs/EmailMarketingApi.md +793 -0
- data/docs/EmailRecipient.md +9 -0
- data/docs/EmailSMSAddress.md +10 -0
- data/docs/EmailTemplateNew.md +9 -0
- data/docs/EmailTemplateUpdate.md +9 -0
- data/docs/EmailToSmsApi.md +395 -0
- data/docs/FAXApi.md +401 -0
- data/docs/FAXDeliveryReceiptRulesApi.md +286 -0
- data/docs/FaxMessage.md +15 -0
- data/docs/FaxMessageCollection.md +9 -0
- data/docs/Fields.md +8 -0
- data/docs/FieldsFields.md +23 -0
- data/docs/ForgotPassword.md +8 -0
- data/docs/ForgotUsername.md +9 -0
- data/docs/InboundFAXRulesApi.md +286 -0
- data/docs/InboundFaxRule.md +12 -0
- data/docs/InboundSMSRule.md +14 -0
- data/docs/InboundSMSRulesApi.md +286 -0
- data/docs/MMSApi.md +228 -0
- data/docs/MasterEmailTemplatesApi.md +290 -0
- data/docs/MmsCampaign.md +14 -0
- data/docs/MmsCampaignApi.md +338 -0
- data/docs/MmsMessage.md +17 -0
- data/docs/MmsMessageCollection.md +9 -0
- data/docs/NumberApi.md +183 -0
- data/docs/PostLetter.md +14 -0
- data/docs/PostLetterApi.md +227 -0
- data/docs/PostPostcard.md +9 -0
- data/docs/PostPostcardApi.md +227 -0
- data/docs/PostRecipient.md +16 -0
- data/docs/PostReturnAddressApi.md +284 -0
- data/docs/ReferralAccountApi.md +65 -0
- data/docs/ResellerAccount.md +15 -0
- data/docs/ResellerAccountApi.md +230 -0
- data/docs/ResellerAccountTransferCredit.md +10 -0
- data/docs/SMSApi.md +999 -0
- data/docs/SMSDeliveryReceiptRulesApi.md +286 -0
- data/docs/SearchApi.md +68 -0
- data/docs/SmsCampaign.md +12 -0
- data/docs/SmsCampaignApi.md +338 -0
- data/docs/SmsMessage.md +16 -0
- data/docs/SmsMessageCollection.md +8 -0
- data/docs/SmsTemplate.md +9 -0
- data/docs/StatisticsApi.md +104 -0
- data/docs/StrippedString.md +8 -0
- data/docs/Subaccount.md +18 -0
- data/docs/SubaccountApi.md +338 -0
- data/docs/TimezonesApi.md +65 -0
- data/docs/TransactionalEmailApi.md +237 -0
- data/docs/TransferCreditApi.md +62 -0
- data/docs/UploadApi.md +65 -0
- data/docs/UploadFile.md +8 -0
- data/docs/Url.md +8 -0
- data/docs/UserEmailTemplatesApi.md +284 -0
- data/docs/VoiceApi.md +547 -0
- data/docs/VoiceDeliveryReceiptRulesApi.md +286 -0
- data/docs/VoiceMessage.md +18 -0
- data/docs/VoiceMessageCollection.md +8 -0
- data/lib/clicksend_client.rb +121 -0
- data/lib/clicksend_client/api/account_api.rb +447 -0
- data/lib/clicksend_client/api/account_recharge_api.rb +346 -0
- data/lib/clicksend_client/api/contact_api.rb +463 -0
- data/lib/clicksend_client/api/contact_list_api.rb +427 -0
- data/lib/clicksend_client/api/countries_api.rb +71 -0
- data/lib/clicksend_client/api/delivery_issues_api.rb +139 -0
- data/lib/clicksend_client/api/detect_address_api.rb +77 -0
- data/lib/clicksend_client/api/email_delivery_receipt_rules_api.rb +310 -0
- data/lib/clicksend_client/api/email_marketing_api.rb +829 -0
- data/lib/clicksend_client/api/email_to_sms_api.rb +423 -0
- data/lib/clicksend_client/api/fax_api.rb +425 -0
- data/lib/clicksend_client/api/fax_delivery_receipt_rules_api.rb +310 -0
- data/lib/clicksend_client/api/inbound_fax_rules_api.rb +310 -0
- data/lib/clicksend_client/api/inbound_sms_rules_api.rb +310 -0
- data/lib/clicksend_client/api/master_email_templates_api.rb +323 -0
- data/lib/clicksend_client/api/mms_api.rb +243 -0
- data/lib/clicksend_client/api/mms_campaign_api.rb +361 -0
- data/lib/clicksend_client/api/number_api.rb +213 -0
- data/lib/clicksend_client/api/post_letter_api.rb +248 -0
- data/lib/clicksend_client/api/post_postcard_api.rb +248 -0
- data/lib/clicksend_client/api/post_return_address_api.rb +307 -0
- data/lib/clicksend_client/api/referral_account_api.rb +85 -0
- data/lib/clicksend_client/api/reseller_account_api.rb +253 -0
- data/lib/clicksend_client/api/search_api.rb +92 -0
- data/lib/clicksend_client/api/sms_api.rb +1032 -0
- data/lib/clicksend_client/api/sms_campaign_api.rb +361 -0
- data/lib/clicksend_client/api/sms_delivery_receipt_rules_api.rb +310 -0
- data/lib/clicksend_client/api/statistics_api.rb +119 -0
- data/lib/clicksend_client/api/subaccount_api.rb +361 -0
- data/lib/clicksend_client/api/timezones_api.rb +85 -0
- data/lib/clicksend_client/api/transactional_email_api.rb +260 -0
- data/lib/clicksend_client/api/transfer_credit_api.rb +77 -0
- data/lib/clicksend_client/api/upload_api.rb +84 -0
- data/lib/clicksend_client/api/user_email_templates_api.rb +307 -0
- data/lib/clicksend_client/api/voice_api.rb +570 -0
- data/lib/clicksend_client/api/voice_delivery_receipt_rules_api.rb +310 -0
- data/lib/clicksend_client/api_client.rb +389 -0
- data/lib/clicksend_client/api_error.rb +38 -0
- data/lib/clicksend_client/configuration.rb +209 -0
- data/lib/clicksend_client/models/account.rb +295 -0
- data/lib/clicksend_client/models/account_forgot_password_verify.rb +219 -0
- data/lib/clicksend_client/models/account_verify.rb +220 -0
- data/lib/clicksend_client/models/address.rb +270 -0
- data/lib/clicksend_client/models/attachment.rb +250 -0
- data/lib/clicksend_client/models/contact.rb +345 -0
- data/lib/clicksend_client/models/contact_list.rb +190 -0
- data/lib/clicksend_client/models/contact_list_import.rb +207 -0
- data/lib/clicksend_client/models/credit_card.rb +265 -0
- data/lib/clicksend_client/models/date_before.rb +185 -0
- data/lib/clicksend_client/models/delivery_issue.rb +240 -0
- data/lib/clicksend_client/models/delivery_receipt_rule.rb +250 -0
- data/lib/clicksend_client/models/email.rb +277 -0
- data/lib/clicksend_client/models/email_address.rb +189 -0
- data/lib/clicksend_client/models/email_campaign.rb +287 -0
- data/lib/clicksend_client/models/email_from.rb +200 -0
- data/lib/clicksend_client/models/email_recipient.rb +200 -0
- data/lib/clicksend_client/models/email_sms_address.rb +215 -0
- data/lib/clicksend_client/models/email_template_new.rb +205 -0
- data/lib/clicksend_client/models/email_template_update.rb +200 -0
- data/lib/clicksend_client/models/fax_message.rb +262 -0
- data/lib/clicksend_client/models/fax_message_collection.rb +207 -0
- data/lib/clicksend_client/models/fields.rb +184 -0
- data/lib/clicksend_client/models/fields_fields.rb +335 -0
- data/lib/clicksend_client/models/forgot_password.rb +189 -0
- data/lib/clicksend_client/models/forgot_username.rb +194 -0
- data/lib/clicksend_client/models/inbound_fax_rule.rb +250 -0
- data/lib/clicksend_client/models/inbound_sms_rule.rb +280 -0
- data/lib/clicksend_client/models/mms_campaign.rb +272 -0
- data/lib/clicksend_client/models/mms_message.rb +294 -0
- data/lib/clicksend_client/models/mms_message_collection.rb +207 -0
- data/lib/clicksend_client/models/post_letter.rb +267 -0
- data/lib/clicksend_client/models/post_postcard.rb +209 -0
- data/lib/clicksend_client/models/post_recipient.rb +302 -0
- data/lib/clicksend_client/models/reseller_account.rb +295 -0
- data/lib/clicksend_client/models/reseller_account_transfer_credit.rb +220 -0
- data/lib/clicksend_client/models/sms_campaign.rb +242 -0
- data/lib/clicksend_client/models/sms_message.rb +279 -0
- data/lib/clicksend_client/models/sms_message_collection.rb +192 -0
- data/lib/clicksend_client/models/sms_template.rb +205 -0
- data/lib/clicksend_client/models/stripped_string.rb +190 -0
- data/lib/clicksend_client/models/subaccount.rb +325 -0
- data/lib/clicksend_client/models/upload_file.rb +190 -0
- data/lib/clicksend_client/models/url.rb +190 -0
- data/lib/clicksend_client/models/voice_message.rb +316 -0
- data/lib/clicksend_client/models/voice_message_collection.rb +192 -0
- data/lib/clicksend_client/version.rb +15 -0
- data/spec/api/account_api_spec.rb +131 -0
- data/spec/api/account_recharge_api_spec.rb +107 -0
- data/spec/api/contact_api_spec.rb +129 -0
- data/spec/api/contact_list_api_spec.rb +123 -0
- data/spec/api/countries_api_spec.rb +46 -0
- data/spec/api/delivery_issues_api_spec.rb +60 -0
- data/spec/api/detect_address_api_spec.rb +47 -0
- data/spec/api/email_delivery_receipt_rules_api_spec.rb +98 -0
- data/spec/api/email_marketing_api_spec.rb +213 -0
- data/spec/api/email_to_sms_api_spec.rb +122 -0
- data/spec/api/fax_api_spec.rb +125 -0
- data/spec/api/fax_delivery_receipt_rules_api_spec.rb +98 -0
- data/spec/api/inbound_fax_rules_api_spec.rb +98 -0
- data/spec/api/inbound_sms_rules_api_spec.rb +98 -0
- data/spec/api/master_email_templates_api_spec.rb +99 -0
- data/spec/api/mms_api_spec.rb +84 -0
- data/spec/api/mms_campaign_api_spec.rb +109 -0
- data/spec/api/number_api_spec.rb +76 -0
- data/spec/api/post_letter_api_spec.rb +84 -0
- data/spec/api/post_postcard_api_spec.rb +84 -0
- data/spec/api/post_return_address_api_spec.rb +97 -0
- data/spec/api/referral_account_api_spec.rb +48 -0
- data/spec/api/reseller_account_api_spec.rb +85 -0
- data/spec/api/search_api_spec.rb +49 -0
- data/spec/api/sms_api_spec.rb +259 -0
- data/spec/api/sms_campaign_api_spec.rb +109 -0
- data/spec/api/sms_delivery_receipt_rules_api_spec.rb +98 -0
- data/spec/api/statistics_api_spec.rb +57 -0
- data/spec/api/subaccount_api_spec.rb +109 -0
- data/spec/api/timezones_api_spec.rb +48 -0
- data/spec/api/transactional_email_api_spec.rb +88 -0
- data/spec/api/transfer_credit_api_spec.rb +47 -0
- data/spec/api/upload_api_spec.rb +48 -0
- data/spec/api/user_email_templates_api_spec.rb +97 -0
- data/spec/api/voice_api_spec.rb +157 -0
- data/spec/api/voice_delivery_receipt_rules_api_spec.rb +98 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/account_forgot_password_verify_spec.rb +53 -0
- data/spec/models/account_spec.rb +83 -0
- data/spec/models/account_verify_spec.rb +53 -0
- data/spec/models/address_spec.rb +77 -0
- data/spec/models/attachment_spec.rb +65 -0
- data/spec/models/contact_list_import_spec.rb +47 -0
- data/spec/models/contact_list_spec.rb +41 -0
- data/spec/models/contact_spec.rb +131 -0
- data/spec/models/credit_card_spec.rb +71 -0
- data/spec/models/date_before_spec.rb +41 -0
- data/spec/models/delivery_issue_spec.rb +65 -0
- data/spec/models/delivery_receipt_rule_spec.rb +65 -0
- data/spec/models/email_address_spec.rb +41 -0
- data/spec/models/email_campaign_spec.rb +83 -0
- data/spec/models/email_from_spec.rb +47 -0
- data/spec/models/email_recipient_spec.rb +47 -0
- data/spec/models/email_sms_address_spec.rb +53 -0
- data/spec/models/email_spec.rb +83 -0
- data/spec/models/email_template_new_spec.rb +47 -0
- data/spec/models/email_template_update_spec.rb +47 -0
- data/spec/models/fax_message_collection_spec.rb +47 -0
- data/spec/models/fax_message_spec.rb +83 -0
- data/spec/models/fields_fields_spec.rb +131 -0
- data/spec/models/fields_spec.rb +41 -0
- data/spec/models/forgot_password_spec.rb +41 -0
- data/spec/models/forgot_username_spec.rb +47 -0
- data/spec/models/inbound_fax_rule_spec.rb +65 -0
- data/spec/models/inbound_sms_rule_spec.rb +77 -0
- data/spec/models/mms_campaign_spec.rb +77 -0
- data/spec/models/mms_message_collection_spec.rb +47 -0
- data/spec/models/mms_message_spec.rb +95 -0
- data/spec/models/post_letter_spec.rb +77 -0
- data/spec/models/post_postcard_spec.rb +47 -0
- data/spec/models/post_recipient_spec.rb +89 -0
- data/spec/models/reseller_account_spec.rb +83 -0
- data/spec/models/reseller_account_transfer_credit_spec.rb +53 -0
- data/spec/models/sms_campaign_spec.rb +65 -0
- data/spec/models/sms_message_collection_spec.rb +41 -0
- data/spec/models/sms_message_spec.rb +89 -0
- data/spec/models/sms_template_spec.rb +47 -0
- data/spec/models/stripped_string_spec.rb +41 -0
- data/spec/models/subaccount_spec.rb +101 -0
- data/spec/models/upload_file_spec.rb +41 -0
- data/spec/models/url_spec.rb +41 -0
- data/spec/models/voice_message_collection_spec.rb +41 -0
- data/spec/models/voice_message_spec.rb +101 -0
- data/spec/spec_helper.rb +111 -0
- metadata +568 -0
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#ClickSend v3 API
|
|
3
|
+
|
|
4
|
+
# This is an official SDK for [ClickSend](https://clicksend.com) Below you will find a current list of the available methods for clicksend. *NOTE: You will need to create a free account to use the API. You can register [here](https://dashboard.clicksend.com/#/signup/step1/)..*
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 3.1
|
|
7
|
+
Contact: support@clicksend.com
|
|
8
|
+
Generated by: https://github.com/clicksend-api/clicksend-codegen.git
|
|
9
|
+
ClickSend Codegen version: 2.4.1-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'uri'
|
|
14
|
+
|
|
15
|
+
module ClickSendClient
|
|
16
|
+
class AccountRechargeApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get Credit Card info
|
|
23
|
+
# Get Credit Card info
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [String]
|
|
26
|
+
def recharge_credit_card_get(opts = {})
|
|
27
|
+
data, _status_code, _headers = recharge_credit_card_get_with_http_info(opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Get Credit Card info
|
|
32
|
+
# Get Credit Card info
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
35
|
+
def recharge_credit_card_get_with_http_info(opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: AccountRechargeApi.recharge_credit_card_get ...'
|
|
38
|
+
end
|
|
39
|
+
# resource path
|
|
40
|
+
local_var_path = '/recharge/credit-card'
|
|
41
|
+
|
|
42
|
+
# query parameters
|
|
43
|
+
query_params = {}
|
|
44
|
+
|
|
45
|
+
# header parameters
|
|
46
|
+
header_params = {}
|
|
47
|
+
# HTTP header 'Accept' (if needed)
|
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
49
|
+
# HTTP header 'Content-Type'
|
|
50
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
51
|
+
|
|
52
|
+
# form parameters
|
|
53
|
+
form_params = {}
|
|
54
|
+
|
|
55
|
+
# http body (model)
|
|
56
|
+
post_body = nil
|
|
57
|
+
auth_names = ['BasicAuth']
|
|
58
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
59
|
+
:header_params => header_params,
|
|
60
|
+
:query_params => query_params,
|
|
61
|
+
:form_params => form_params,
|
|
62
|
+
:body => post_body,
|
|
63
|
+
:auth_names => auth_names,
|
|
64
|
+
:return_type => 'String')
|
|
65
|
+
if @api_client.config.debugging
|
|
66
|
+
@api_client.config.logger.debug "API called: AccountRechargeApi#recharge_credit_card_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
67
|
+
end
|
|
68
|
+
return data, status_code, headers
|
|
69
|
+
end
|
|
70
|
+
# Update credit card info
|
|
71
|
+
# Update credit card info
|
|
72
|
+
# @param credit_card CreditCard model
|
|
73
|
+
# @param [Hash] opts the optional parameters
|
|
74
|
+
# @return [String]
|
|
75
|
+
def recharge_credit_card_put(credit_card, opts = {})
|
|
76
|
+
data, _status_code, _headers = recharge_credit_card_put_with_http_info(credit_card, opts)
|
|
77
|
+
data
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Update credit card info
|
|
81
|
+
# Update credit card info
|
|
82
|
+
# @param credit_card CreditCard model
|
|
83
|
+
# @param [Hash] opts the optional parameters
|
|
84
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
85
|
+
def recharge_credit_card_put_with_http_info(credit_card, opts = {})
|
|
86
|
+
if @api_client.config.debugging
|
|
87
|
+
@api_client.config.logger.debug 'Calling API: AccountRechargeApi.recharge_credit_card_put ...'
|
|
88
|
+
end
|
|
89
|
+
# verify the required parameter 'credit_card' is set
|
|
90
|
+
if @api_client.config.client_side_validation && credit_card.nil?
|
|
91
|
+
fail ArgumentError, "Missing the required parameter 'credit_card' when calling AccountRechargeApi.recharge_credit_card_put"
|
|
92
|
+
end
|
|
93
|
+
# resource path
|
|
94
|
+
local_var_path = '/recharge/credit-card'
|
|
95
|
+
|
|
96
|
+
# query parameters
|
|
97
|
+
query_params = {}
|
|
98
|
+
|
|
99
|
+
# header parameters
|
|
100
|
+
header_params = {}
|
|
101
|
+
# HTTP header 'Accept' (if needed)
|
|
102
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
103
|
+
# HTTP header 'Content-Type'
|
|
104
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
105
|
+
|
|
106
|
+
# form parameters
|
|
107
|
+
form_params = {}
|
|
108
|
+
|
|
109
|
+
# http body (model)
|
|
110
|
+
post_body = @api_client.object_to_http_body(credit_card)
|
|
111
|
+
auth_names = ['BasicAuth']
|
|
112
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
|
113
|
+
:header_params => header_params,
|
|
114
|
+
:query_params => query_params,
|
|
115
|
+
:form_params => form_params,
|
|
116
|
+
:body => post_body,
|
|
117
|
+
:auth_names => auth_names,
|
|
118
|
+
:return_type => 'String')
|
|
119
|
+
if @api_client.config.debugging
|
|
120
|
+
@api_client.config.logger.debug "API called: AccountRechargeApi#recharge_credit_card_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
121
|
+
end
|
|
122
|
+
return data, status_code, headers
|
|
123
|
+
end
|
|
124
|
+
# Get list of all packages
|
|
125
|
+
# Get list of all packages
|
|
126
|
+
# @param [Hash] opts the optional parameters
|
|
127
|
+
# @option opts [String] :country Country code
|
|
128
|
+
# @return [String]
|
|
129
|
+
def recharge_packages_get(opts = {})
|
|
130
|
+
data, _status_code, _headers = recharge_packages_get_with_http_info(opts)
|
|
131
|
+
data
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Get list of all packages
|
|
135
|
+
# Get list of all packages
|
|
136
|
+
# @param [Hash] opts the optional parameters
|
|
137
|
+
# @option opts [String] :country Country code
|
|
138
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
139
|
+
def recharge_packages_get_with_http_info(opts = {})
|
|
140
|
+
if @api_client.config.debugging
|
|
141
|
+
@api_client.config.logger.debug 'Calling API: AccountRechargeApi.recharge_packages_get ...'
|
|
142
|
+
end
|
|
143
|
+
# resource path
|
|
144
|
+
local_var_path = '/recharge/packages'
|
|
145
|
+
|
|
146
|
+
# query parameters
|
|
147
|
+
query_params = {}
|
|
148
|
+
query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil?
|
|
149
|
+
|
|
150
|
+
# header parameters
|
|
151
|
+
header_params = {}
|
|
152
|
+
# HTTP header 'Accept' (if needed)
|
|
153
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
154
|
+
# HTTP header 'Content-Type'
|
|
155
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
156
|
+
|
|
157
|
+
# form parameters
|
|
158
|
+
form_params = {}
|
|
159
|
+
|
|
160
|
+
# http body (model)
|
|
161
|
+
post_body = nil
|
|
162
|
+
auth_names = ['BasicAuth']
|
|
163
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
164
|
+
:header_params => header_params,
|
|
165
|
+
:query_params => query_params,
|
|
166
|
+
:form_params => form_params,
|
|
167
|
+
:body => post_body,
|
|
168
|
+
:auth_names => auth_names,
|
|
169
|
+
:return_type => 'String')
|
|
170
|
+
if @api_client.config.debugging
|
|
171
|
+
@api_client.config.logger.debug "API called: AccountRechargeApi#recharge_packages_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
172
|
+
end
|
|
173
|
+
return data, status_code, headers
|
|
174
|
+
end
|
|
175
|
+
# Purchase a package
|
|
176
|
+
# Purchase a package
|
|
177
|
+
# @param package_id ID of package to purchase
|
|
178
|
+
# @param [Hash] opts the optional parameters
|
|
179
|
+
# @return [String]
|
|
180
|
+
def recharge_purchase_by_package_id_put(package_id, opts = {})
|
|
181
|
+
data, _status_code, _headers = recharge_purchase_by_package_id_put_with_http_info(package_id, opts)
|
|
182
|
+
data
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Purchase a package
|
|
186
|
+
# Purchase a package
|
|
187
|
+
# @param package_id ID of package to purchase
|
|
188
|
+
# @param [Hash] opts the optional parameters
|
|
189
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
190
|
+
def recharge_purchase_by_package_id_put_with_http_info(package_id, opts = {})
|
|
191
|
+
if @api_client.config.debugging
|
|
192
|
+
@api_client.config.logger.debug 'Calling API: AccountRechargeApi.recharge_purchase_by_package_id_put ...'
|
|
193
|
+
end
|
|
194
|
+
# verify the required parameter 'package_id' is set
|
|
195
|
+
if @api_client.config.client_side_validation && package_id.nil?
|
|
196
|
+
fail ArgumentError, "Missing the required parameter 'package_id' when calling AccountRechargeApi.recharge_purchase_by_package_id_put"
|
|
197
|
+
end
|
|
198
|
+
# resource path
|
|
199
|
+
local_var_path = '/recharge/purchase/{package_id}'.sub('{' + 'package_id' + '}', package_id.to_s)
|
|
200
|
+
|
|
201
|
+
# query parameters
|
|
202
|
+
query_params = {}
|
|
203
|
+
|
|
204
|
+
# header parameters
|
|
205
|
+
header_params = {}
|
|
206
|
+
# HTTP header 'Accept' (if needed)
|
|
207
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
208
|
+
# HTTP header 'Content-Type'
|
|
209
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
210
|
+
|
|
211
|
+
# form parameters
|
|
212
|
+
form_params = {}
|
|
213
|
+
|
|
214
|
+
# http body (model)
|
|
215
|
+
post_body = nil
|
|
216
|
+
auth_names = ['BasicAuth']
|
|
217
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
|
218
|
+
:header_params => header_params,
|
|
219
|
+
:query_params => query_params,
|
|
220
|
+
:form_params => form_params,
|
|
221
|
+
:body => post_body,
|
|
222
|
+
:auth_names => auth_names,
|
|
223
|
+
:return_type => 'String')
|
|
224
|
+
if @api_client.config.debugging
|
|
225
|
+
@api_client.config.logger.debug "API called: AccountRechargeApi#recharge_purchase_by_package_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
226
|
+
end
|
|
227
|
+
return data, status_code, headers
|
|
228
|
+
end
|
|
229
|
+
# Get specific Transaction
|
|
230
|
+
# Get specific Transaction
|
|
231
|
+
# @param transaction_id ID of transaction to retrieve
|
|
232
|
+
# @param [Hash] opts the optional parameters
|
|
233
|
+
# @return [String]
|
|
234
|
+
def recharge_transactions_by_transaction_id_get(transaction_id, opts = {})
|
|
235
|
+
data, _status_code, _headers = recharge_transactions_by_transaction_id_get_with_http_info(transaction_id, opts)
|
|
236
|
+
data
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# Get specific Transaction
|
|
240
|
+
# Get specific Transaction
|
|
241
|
+
# @param transaction_id ID of transaction to retrieve
|
|
242
|
+
# @param [Hash] opts the optional parameters
|
|
243
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
244
|
+
def recharge_transactions_by_transaction_id_get_with_http_info(transaction_id, opts = {})
|
|
245
|
+
if @api_client.config.debugging
|
|
246
|
+
@api_client.config.logger.debug 'Calling API: AccountRechargeApi.recharge_transactions_by_transaction_id_get ...'
|
|
247
|
+
end
|
|
248
|
+
# verify the required parameter 'transaction_id' is set
|
|
249
|
+
if @api_client.config.client_side_validation && transaction_id.nil?
|
|
250
|
+
fail ArgumentError, "Missing the required parameter 'transaction_id' when calling AccountRechargeApi.recharge_transactions_by_transaction_id_get"
|
|
251
|
+
end
|
|
252
|
+
# resource path
|
|
253
|
+
local_var_path = '/recharge/transactions/{transaction_id}'.sub('{' + 'transaction_id' + '}', transaction_id.to_s)
|
|
254
|
+
|
|
255
|
+
# query parameters
|
|
256
|
+
query_params = {}
|
|
257
|
+
|
|
258
|
+
# header parameters
|
|
259
|
+
header_params = {}
|
|
260
|
+
# HTTP header 'Accept' (if needed)
|
|
261
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
262
|
+
# HTTP header 'Content-Type'
|
|
263
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
264
|
+
|
|
265
|
+
# form parameters
|
|
266
|
+
form_params = {}
|
|
267
|
+
|
|
268
|
+
# http body (model)
|
|
269
|
+
post_body = nil
|
|
270
|
+
auth_names = ['BasicAuth']
|
|
271
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
272
|
+
:header_params => header_params,
|
|
273
|
+
:query_params => query_params,
|
|
274
|
+
:form_params => form_params,
|
|
275
|
+
:body => post_body,
|
|
276
|
+
:auth_names => auth_names,
|
|
277
|
+
:return_type => 'String')
|
|
278
|
+
if @api_client.config.debugging
|
|
279
|
+
@api_client.config.logger.debug "API called: AccountRechargeApi#recharge_transactions_by_transaction_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
280
|
+
end
|
|
281
|
+
return data, status_code, headers
|
|
282
|
+
end
|
|
283
|
+
# Purchase a package
|
|
284
|
+
# Get all transactions
|
|
285
|
+
# @param [Hash] opts the optional parameters
|
|
286
|
+
# @option opts [Integer] :page Page number (default to 1)
|
|
287
|
+
# @option opts [Integer] :limit Number of records per page (default to 10)
|
|
288
|
+
# @return [String]
|
|
289
|
+
def recharge_transactions_get(opts = {})
|
|
290
|
+
data, _status_code, _headers = recharge_transactions_get_with_http_info(opts)
|
|
291
|
+
data
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
# Purchase a package
|
|
295
|
+
# Get all transactions
|
|
296
|
+
# @param [Hash] opts the optional parameters
|
|
297
|
+
# @option opts [Integer] :page Page number
|
|
298
|
+
# @option opts [Integer] :limit Number of records per page
|
|
299
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
300
|
+
def recharge_transactions_get_with_http_info(opts = {})
|
|
301
|
+
if @api_client.config.debugging
|
|
302
|
+
@api_client.config.logger.debug 'Calling API: AccountRechargeApi.recharge_transactions_get ...'
|
|
303
|
+
end
|
|
304
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
|
305
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AccountRechargeApi.recharge_transactions_get, must be greater than or equal to 1.'
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
309
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling AccountRechargeApi.recharge_transactions_get, must be greater than or equal to 1.'
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# resource path
|
|
313
|
+
local_var_path = '/recharge/transactions'
|
|
314
|
+
|
|
315
|
+
# query parameters
|
|
316
|
+
query_params = {}
|
|
317
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
318
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
319
|
+
|
|
320
|
+
# header parameters
|
|
321
|
+
header_params = {}
|
|
322
|
+
# HTTP header 'Accept' (if needed)
|
|
323
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
324
|
+
# HTTP header 'Content-Type'
|
|
325
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
326
|
+
|
|
327
|
+
# form parameters
|
|
328
|
+
form_params = {}
|
|
329
|
+
|
|
330
|
+
# http body (model)
|
|
331
|
+
post_body = nil
|
|
332
|
+
auth_names = ['BasicAuth']
|
|
333
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
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 => 'String')
|
|
340
|
+
if @api_client.config.debugging
|
|
341
|
+
@api_client.config.logger.debug "API called: AccountRechargeApi#recharge_transactions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
342
|
+
end
|
|
343
|
+
return data, status_code, headers
|
|
344
|
+
end
|
|
345
|
+
end
|
|
346
|
+
end
|
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#ClickSend v3 API
|
|
3
|
+
|
|
4
|
+
# This is an official SDK for [ClickSend](https://clicksend.com) Below you will find a current list of the available methods for clicksend. *NOTE: You will need to create a free account to use the API. You can register [here](https://dashboard.clicksend.com/#/signup/step1/)..*
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 3.1
|
|
7
|
+
Contact: support@clicksend.com
|
|
8
|
+
Generated by: https://github.com/clicksend-api/clicksend-codegen.git
|
|
9
|
+
ClickSend Codegen version: 2.4.1-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'uri'
|
|
14
|
+
|
|
15
|
+
module ClickSendClient
|
|
16
|
+
class ContactApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Delete a contact
|
|
23
|
+
# Delete a contact
|
|
24
|
+
# @param list_id List ID
|
|
25
|
+
# @param contact_id Contact ID
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @return [String]
|
|
28
|
+
def lists_contacts_by_list_id_and_contact_id_delete(list_id, contact_id, opts = {})
|
|
29
|
+
data, _status_code, _headers = lists_contacts_by_list_id_and_contact_id_delete_with_http_info(list_id, contact_id, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Delete a contact
|
|
34
|
+
# Delete a contact
|
|
35
|
+
# @param list_id List ID
|
|
36
|
+
# @param contact_id Contact ID
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
39
|
+
def lists_contacts_by_list_id_and_contact_id_delete_with_http_info(list_id, contact_id, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: ContactApi.lists_contacts_by_list_id_and_contact_id_delete ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'list_id' is set
|
|
44
|
+
if @api_client.config.client_side_validation && list_id.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactApi.lists_contacts_by_list_id_and_contact_id_delete"
|
|
46
|
+
end
|
|
47
|
+
# verify the required parameter 'contact_id' is set
|
|
48
|
+
if @api_client.config.client_side_validation && contact_id.nil?
|
|
49
|
+
fail ArgumentError, "Missing the required parameter 'contact_id' when calling ContactApi.lists_contacts_by_list_id_and_contact_id_delete"
|
|
50
|
+
end
|
|
51
|
+
# resource path
|
|
52
|
+
local_var_path = '/lists/{list_id}/contacts/{contact_id}'.sub('{' + 'list_id' + '}', list_id.to_s).sub('{' + 'contact_id' + '}', contact_id.to_s)
|
|
53
|
+
|
|
54
|
+
# query parameters
|
|
55
|
+
query_params = {}
|
|
56
|
+
|
|
57
|
+
# header parameters
|
|
58
|
+
header_params = {}
|
|
59
|
+
# HTTP header 'Accept' (if needed)
|
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
61
|
+
# HTTP header 'Content-Type'
|
|
62
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
63
|
+
|
|
64
|
+
# form parameters
|
|
65
|
+
form_params = {}
|
|
66
|
+
|
|
67
|
+
# http body (model)
|
|
68
|
+
post_body = nil
|
|
69
|
+
auth_names = ['BasicAuth']
|
|
70
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
|
71
|
+
:header_params => header_params,
|
|
72
|
+
:query_params => query_params,
|
|
73
|
+
:form_params => form_params,
|
|
74
|
+
:body => post_body,
|
|
75
|
+
:auth_names => auth_names,
|
|
76
|
+
:return_type => 'String')
|
|
77
|
+
if @api_client.config.debugging
|
|
78
|
+
@api_client.config.logger.debug "API called: ContactApi#lists_contacts_by_list_id_and_contact_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
79
|
+
end
|
|
80
|
+
return data, status_code, headers
|
|
81
|
+
end
|
|
82
|
+
# Get a specific contact
|
|
83
|
+
# Get a specific contact
|
|
84
|
+
# @param list_id Your contact list id you want to access.
|
|
85
|
+
# @param contact_id Your contact id you want to access.
|
|
86
|
+
# @param [Hash] opts the optional parameters
|
|
87
|
+
# @return [String]
|
|
88
|
+
def lists_contacts_by_list_id_and_contact_id_get(list_id, contact_id, opts = {})
|
|
89
|
+
data, _status_code, _headers = lists_contacts_by_list_id_and_contact_id_get_with_http_info(list_id, contact_id, opts)
|
|
90
|
+
data
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Get a specific contact
|
|
94
|
+
# Get a specific contact
|
|
95
|
+
# @param list_id Your contact list id you want to access.
|
|
96
|
+
# @param contact_id Your contact id you want to access.
|
|
97
|
+
# @param [Hash] opts the optional parameters
|
|
98
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
99
|
+
def lists_contacts_by_list_id_and_contact_id_get_with_http_info(list_id, contact_id, opts = {})
|
|
100
|
+
if @api_client.config.debugging
|
|
101
|
+
@api_client.config.logger.debug 'Calling API: ContactApi.lists_contacts_by_list_id_and_contact_id_get ...'
|
|
102
|
+
end
|
|
103
|
+
# verify the required parameter 'list_id' is set
|
|
104
|
+
if @api_client.config.client_side_validation && list_id.nil?
|
|
105
|
+
fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactApi.lists_contacts_by_list_id_and_contact_id_get"
|
|
106
|
+
end
|
|
107
|
+
# verify the required parameter 'contact_id' is set
|
|
108
|
+
if @api_client.config.client_side_validation && contact_id.nil?
|
|
109
|
+
fail ArgumentError, "Missing the required parameter 'contact_id' when calling ContactApi.lists_contacts_by_list_id_and_contact_id_get"
|
|
110
|
+
end
|
|
111
|
+
# resource path
|
|
112
|
+
local_var_path = '/lists/{list_id}/contacts/{contact_id}'.sub('{' + 'list_id' + '}', list_id.to_s).sub('{' + 'contact_id' + '}', contact_id.to_s)
|
|
113
|
+
|
|
114
|
+
# query parameters
|
|
115
|
+
query_params = {}
|
|
116
|
+
|
|
117
|
+
# header parameters
|
|
118
|
+
header_params = {}
|
|
119
|
+
# HTTP header 'Accept' (if needed)
|
|
120
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
121
|
+
# HTTP header 'Content-Type'
|
|
122
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
123
|
+
|
|
124
|
+
# form parameters
|
|
125
|
+
form_params = {}
|
|
126
|
+
|
|
127
|
+
# http body (model)
|
|
128
|
+
post_body = nil
|
|
129
|
+
auth_names = ['BasicAuth']
|
|
130
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
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 => 'String')
|
|
137
|
+
if @api_client.config.debugging
|
|
138
|
+
@api_client.config.logger.debug "API called: ContactApi#lists_contacts_by_list_id_and_contact_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
139
|
+
end
|
|
140
|
+
return data, status_code, headers
|
|
141
|
+
end
|
|
142
|
+
# Update specific contact
|
|
143
|
+
# Update specific contact
|
|
144
|
+
# @param list_id Contact list id
|
|
145
|
+
# @param contact_id Contact ID
|
|
146
|
+
# @param contact Contact model
|
|
147
|
+
# @param [Hash] opts the optional parameters
|
|
148
|
+
# @return [String]
|
|
149
|
+
def lists_contacts_by_list_id_and_contact_id_put(list_id, contact_id, contact, opts = {})
|
|
150
|
+
data, _status_code, _headers = lists_contacts_by_list_id_and_contact_id_put_with_http_info(list_id, contact_id, contact, opts)
|
|
151
|
+
data
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Update specific contact
|
|
155
|
+
# Update specific contact
|
|
156
|
+
# @param list_id Contact list id
|
|
157
|
+
# @param contact_id Contact ID
|
|
158
|
+
# @param contact Contact model
|
|
159
|
+
# @param [Hash] opts the optional parameters
|
|
160
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
161
|
+
def lists_contacts_by_list_id_and_contact_id_put_with_http_info(list_id, contact_id, contact, opts = {})
|
|
162
|
+
if @api_client.config.debugging
|
|
163
|
+
@api_client.config.logger.debug 'Calling API: ContactApi.lists_contacts_by_list_id_and_contact_id_put ...'
|
|
164
|
+
end
|
|
165
|
+
# verify the required parameter 'list_id' is set
|
|
166
|
+
if @api_client.config.client_side_validation && list_id.nil?
|
|
167
|
+
fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactApi.lists_contacts_by_list_id_and_contact_id_put"
|
|
168
|
+
end
|
|
169
|
+
# verify the required parameter 'contact_id' is set
|
|
170
|
+
if @api_client.config.client_side_validation && contact_id.nil?
|
|
171
|
+
fail ArgumentError, "Missing the required parameter 'contact_id' when calling ContactApi.lists_contacts_by_list_id_and_contact_id_put"
|
|
172
|
+
end
|
|
173
|
+
# verify the required parameter 'contact' is set
|
|
174
|
+
if @api_client.config.client_side_validation && contact.nil?
|
|
175
|
+
fail ArgumentError, "Missing the required parameter 'contact' when calling ContactApi.lists_contacts_by_list_id_and_contact_id_put"
|
|
176
|
+
end
|
|
177
|
+
# resource path
|
|
178
|
+
local_var_path = '/lists/{list_id}/contacts/{contact_id}'.sub('{' + 'list_id' + '}', list_id.to_s).sub('{' + 'contact_id' + '}', contact_id.to_s)
|
|
179
|
+
|
|
180
|
+
# query parameters
|
|
181
|
+
query_params = {}
|
|
182
|
+
|
|
183
|
+
# header parameters
|
|
184
|
+
header_params = {}
|
|
185
|
+
# HTTP header 'Accept' (if needed)
|
|
186
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
187
|
+
# HTTP header 'Content-Type'
|
|
188
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
189
|
+
|
|
190
|
+
# form parameters
|
|
191
|
+
form_params = {}
|
|
192
|
+
|
|
193
|
+
# http body (model)
|
|
194
|
+
post_body = @api_client.object_to_http_body(contact)
|
|
195
|
+
auth_names = ['BasicAuth']
|
|
196
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
|
197
|
+
:header_params => header_params,
|
|
198
|
+
:query_params => query_params,
|
|
199
|
+
:form_params => form_params,
|
|
200
|
+
:body => post_body,
|
|
201
|
+
:auth_names => auth_names,
|
|
202
|
+
:return_type => 'String')
|
|
203
|
+
if @api_client.config.debugging
|
|
204
|
+
@api_client.config.logger.debug "API called: ContactApi#lists_contacts_by_list_id_and_contact_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
205
|
+
end
|
|
206
|
+
return data, status_code, headers
|
|
207
|
+
end
|
|
208
|
+
# Get all contacts in a list
|
|
209
|
+
# Get all contacts in a list
|
|
210
|
+
# @param list_id Contact list ID
|
|
211
|
+
# @param [Hash] opts the optional parameters
|
|
212
|
+
# @option opts [Integer] :page Page number (default to 1)
|
|
213
|
+
# @option opts [Integer] :limit Number of records per page (default to 10)
|
|
214
|
+
# @return [String]
|
|
215
|
+
def lists_contacts_by_list_id_get(list_id, opts = {})
|
|
216
|
+
data, _status_code, _headers = lists_contacts_by_list_id_get_with_http_info(list_id, opts)
|
|
217
|
+
data
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Get all contacts in a list
|
|
221
|
+
# Get all contacts in a list
|
|
222
|
+
# @param list_id Contact list ID
|
|
223
|
+
# @param [Hash] opts the optional parameters
|
|
224
|
+
# @option opts [Integer] :page Page number
|
|
225
|
+
# @option opts [Integer] :limit Number of records per page
|
|
226
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
227
|
+
def lists_contacts_by_list_id_get_with_http_info(list_id, opts = {})
|
|
228
|
+
if @api_client.config.debugging
|
|
229
|
+
@api_client.config.logger.debug 'Calling API: ContactApi.lists_contacts_by_list_id_get ...'
|
|
230
|
+
end
|
|
231
|
+
# verify the required parameter 'list_id' is set
|
|
232
|
+
if @api_client.config.client_side_validation && list_id.nil?
|
|
233
|
+
fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactApi.lists_contacts_by_list_id_get"
|
|
234
|
+
end
|
|
235
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
|
236
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ContactApi.lists_contacts_by_list_id_get, must be greater than or equal to 1.'
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
240
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ContactApi.lists_contacts_by_list_id_get, must be greater than or equal to 1.'
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# resource path
|
|
244
|
+
local_var_path = '/lists/{list_id}/contacts'.sub('{' + 'list_id' + '}', list_id.to_s)
|
|
245
|
+
|
|
246
|
+
# query parameters
|
|
247
|
+
query_params = {}
|
|
248
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
249
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
250
|
+
|
|
251
|
+
# header parameters
|
|
252
|
+
header_params = {}
|
|
253
|
+
# HTTP header 'Accept' (if needed)
|
|
254
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
255
|
+
# HTTP header 'Content-Type'
|
|
256
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
257
|
+
|
|
258
|
+
# form parameters
|
|
259
|
+
form_params = {}
|
|
260
|
+
|
|
261
|
+
# http body (model)
|
|
262
|
+
post_body = nil
|
|
263
|
+
auth_names = ['BasicAuth']
|
|
264
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
265
|
+
:header_params => header_params,
|
|
266
|
+
:query_params => query_params,
|
|
267
|
+
:form_params => form_params,
|
|
268
|
+
:body => post_body,
|
|
269
|
+
:auth_names => auth_names,
|
|
270
|
+
:return_type => 'String')
|
|
271
|
+
if @api_client.config.debugging
|
|
272
|
+
@api_client.config.logger.debug "API called: ContactApi#lists_contacts_by_list_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
273
|
+
end
|
|
274
|
+
return data, status_code, headers
|
|
275
|
+
end
|
|
276
|
+
# Create new contact
|
|
277
|
+
# Create new contact
|
|
278
|
+
# @param contact Contact model
|
|
279
|
+
# @param list_id List id
|
|
280
|
+
# @param [Hash] opts the optional parameters
|
|
281
|
+
# @return [String]
|
|
282
|
+
def lists_contacts_by_list_id_post(contact, list_id, opts = {})
|
|
283
|
+
data, _status_code, _headers = lists_contacts_by_list_id_post_with_http_info(contact, list_id, opts)
|
|
284
|
+
data
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
# Create new contact
|
|
288
|
+
# Create new contact
|
|
289
|
+
# @param contact Contact model
|
|
290
|
+
# @param list_id List id
|
|
291
|
+
# @param [Hash] opts the optional parameters
|
|
292
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
293
|
+
def lists_contacts_by_list_id_post_with_http_info(contact, list_id, opts = {})
|
|
294
|
+
if @api_client.config.debugging
|
|
295
|
+
@api_client.config.logger.debug 'Calling API: ContactApi.lists_contacts_by_list_id_post ...'
|
|
296
|
+
end
|
|
297
|
+
# verify the required parameter 'contact' is set
|
|
298
|
+
if @api_client.config.client_side_validation && contact.nil?
|
|
299
|
+
fail ArgumentError, "Missing the required parameter 'contact' when calling ContactApi.lists_contacts_by_list_id_post"
|
|
300
|
+
end
|
|
301
|
+
# verify the required parameter 'list_id' is set
|
|
302
|
+
if @api_client.config.client_side_validation && list_id.nil?
|
|
303
|
+
fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactApi.lists_contacts_by_list_id_post"
|
|
304
|
+
end
|
|
305
|
+
# resource path
|
|
306
|
+
local_var_path = '/lists/{list_id}/contacts'.sub('{' + 'list_id' + '}', list_id.to_s)
|
|
307
|
+
|
|
308
|
+
# query parameters
|
|
309
|
+
query_params = {}
|
|
310
|
+
|
|
311
|
+
# header parameters
|
|
312
|
+
header_params = {}
|
|
313
|
+
# HTTP header 'Accept' (if needed)
|
|
314
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
315
|
+
# HTTP header 'Content-Type'
|
|
316
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
317
|
+
|
|
318
|
+
# form parameters
|
|
319
|
+
form_params = {}
|
|
320
|
+
|
|
321
|
+
# http body (model)
|
|
322
|
+
post_body = @api_client.object_to_http_body(contact)
|
|
323
|
+
auth_names = ['BasicAuth']
|
|
324
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
325
|
+
:header_params => header_params,
|
|
326
|
+
:query_params => query_params,
|
|
327
|
+
:form_params => form_params,
|
|
328
|
+
:body => post_body,
|
|
329
|
+
:auth_names => auth_names,
|
|
330
|
+
:return_type => 'String')
|
|
331
|
+
if @api_client.config.debugging
|
|
332
|
+
@api_client.config.logger.debug "API called: ContactApi#lists_contacts_by_list_id_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
333
|
+
end
|
|
334
|
+
return data, status_code, headers
|
|
335
|
+
end
|
|
336
|
+
# Remove all opted out contacts
|
|
337
|
+
# Remove all opted out contacts
|
|
338
|
+
# @param list_id Your list id
|
|
339
|
+
# @param opt_out_list_id Your opt out list id
|
|
340
|
+
# @param [Hash] opts the optional parameters
|
|
341
|
+
# @return [String]
|
|
342
|
+
def lists_remove_opted_out_contacts_by_list_id_and_opt_out_list_id_put(list_id, opt_out_list_id, opts = {})
|
|
343
|
+
data, _status_code, _headers = lists_remove_opted_out_contacts_by_list_id_and_opt_out_list_id_put_with_http_info(list_id, opt_out_list_id, opts)
|
|
344
|
+
data
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
# Remove all opted out contacts
|
|
348
|
+
# Remove all opted out contacts
|
|
349
|
+
# @param list_id Your list id
|
|
350
|
+
# @param opt_out_list_id Your opt out list id
|
|
351
|
+
# @param [Hash] opts the optional parameters
|
|
352
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
353
|
+
def lists_remove_opted_out_contacts_by_list_id_and_opt_out_list_id_put_with_http_info(list_id, opt_out_list_id, opts = {})
|
|
354
|
+
if @api_client.config.debugging
|
|
355
|
+
@api_client.config.logger.debug 'Calling API: ContactApi.lists_remove_opted_out_contacts_by_list_id_and_opt_out_list_id_put ...'
|
|
356
|
+
end
|
|
357
|
+
# verify the required parameter 'list_id' is set
|
|
358
|
+
if @api_client.config.client_side_validation && list_id.nil?
|
|
359
|
+
fail ArgumentError, "Missing the required parameter 'list_id' when calling ContactApi.lists_remove_opted_out_contacts_by_list_id_and_opt_out_list_id_put"
|
|
360
|
+
end
|
|
361
|
+
# verify the required parameter 'opt_out_list_id' is set
|
|
362
|
+
if @api_client.config.client_side_validation && opt_out_list_id.nil?
|
|
363
|
+
fail ArgumentError, "Missing the required parameter 'opt_out_list_id' when calling ContactApi.lists_remove_opted_out_contacts_by_list_id_and_opt_out_list_id_put"
|
|
364
|
+
end
|
|
365
|
+
# resource path
|
|
366
|
+
local_var_path = '/lists/{list_id}/remove-opted-out-contacts/{opt_out_list_id}'.sub('{' + 'list_id' + '}', list_id.to_s).sub('{' + 'opt_out_list_id' + '}', opt_out_list_id.to_s)
|
|
367
|
+
|
|
368
|
+
# query parameters
|
|
369
|
+
query_params = {}
|
|
370
|
+
|
|
371
|
+
# header parameters
|
|
372
|
+
header_params = {}
|
|
373
|
+
# HTTP header 'Accept' (if needed)
|
|
374
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
375
|
+
# HTTP header 'Content-Type'
|
|
376
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
377
|
+
|
|
378
|
+
# form parameters
|
|
379
|
+
form_params = {}
|
|
380
|
+
|
|
381
|
+
# http body (model)
|
|
382
|
+
post_body = nil
|
|
383
|
+
auth_names = ['BasicAuth']
|
|
384
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
|
385
|
+
:header_params => header_params,
|
|
386
|
+
:query_params => query_params,
|
|
387
|
+
:form_params => form_params,
|
|
388
|
+
:body => post_body,
|
|
389
|
+
:auth_names => auth_names,
|
|
390
|
+
:return_type => 'String')
|
|
391
|
+
if @api_client.config.debugging
|
|
392
|
+
@api_client.config.logger.debug "API called: ContactApi#lists_remove_opted_out_contacts_by_list_id_and_opt_out_list_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
393
|
+
end
|
|
394
|
+
return data, status_code, headers
|
|
395
|
+
end
|
|
396
|
+
# Transfer contact to another list
|
|
397
|
+
# Transfer contact to another list
|
|
398
|
+
# @param from_list_id List ID for list that contains contact.
|
|
399
|
+
# @param contact_id Contact ID
|
|
400
|
+
# @param to_list_id List ID for list you want to transfer contact to.
|
|
401
|
+
# @param [Hash] opts the optional parameters
|
|
402
|
+
# @return [String]
|
|
403
|
+
def lists_transfer_contact_put(from_list_id, contact_id, to_list_id, opts = {})
|
|
404
|
+
data, _status_code, _headers = lists_transfer_contact_put_with_http_info(from_list_id, contact_id, to_list_id, opts)
|
|
405
|
+
data
|
|
406
|
+
end
|
|
407
|
+
|
|
408
|
+
# Transfer contact to another list
|
|
409
|
+
# Transfer contact to another list
|
|
410
|
+
# @param from_list_id List ID for list that contains contact.
|
|
411
|
+
# @param contact_id Contact ID
|
|
412
|
+
# @param to_list_id List ID for list you want to transfer contact to.
|
|
413
|
+
# @param [Hash] opts the optional parameters
|
|
414
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
415
|
+
def lists_transfer_contact_put_with_http_info(from_list_id, contact_id, to_list_id, opts = {})
|
|
416
|
+
if @api_client.config.debugging
|
|
417
|
+
@api_client.config.logger.debug 'Calling API: ContactApi.lists_transfer_contact_put ...'
|
|
418
|
+
end
|
|
419
|
+
# verify the required parameter 'from_list_id' is set
|
|
420
|
+
if @api_client.config.client_side_validation && from_list_id.nil?
|
|
421
|
+
fail ArgumentError, "Missing the required parameter 'from_list_id' when calling ContactApi.lists_transfer_contact_put"
|
|
422
|
+
end
|
|
423
|
+
# verify the required parameter 'contact_id' is set
|
|
424
|
+
if @api_client.config.client_side_validation && contact_id.nil?
|
|
425
|
+
fail ArgumentError, "Missing the required parameter 'contact_id' when calling ContactApi.lists_transfer_contact_put"
|
|
426
|
+
end
|
|
427
|
+
# verify the required parameter 'to_list_id' is set
|
|
428
|
+
if @api_client.config.client_side_validation && to_list_id.nil?
|
|
429
|
+
fail ArgumentError, "Missing the required parameter 'to_list_id' when calling ContactApi.lists_transfer_contact_put"
|
|
430
|
+
end
|
|
431
|
+
# resource path
|
|
432
|
+
local_var_path = '/lists/{from_list_id}/contacts/{contact_id}/transfer/{to_list_id}'.sub('{' + 'from_list_id' + '}', from_list_id.to_s).sub('{' + 'contact_id' + '}', contact_id.to_s).sub('{' + 'to_list_id' + '}', to_list_id.to_s)
|
|
433
|
+
|
|
434
|
+
# query parameters
|
|
435
|
+
query_params = {}
|
|
436
|
+
|
|
437
|
+
# header parameters
|
|
438
|
+
header_params = {}
|
|
439
|
+
# HTTP header 'Accept' (if needed)
|
|
440
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
441
|
+
# HTTP header 'Content-Type'
|
|
442
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
443
|
+
|
|
444
|
+
# form parameters
|
|
445
|
+
form_params = {}
|
|
446
|
+
|
|
447
|
+
# http body (model)
|
|
448
|
+
post_body = nil
|
|
449
|
+
auth_names = ['BasicAuth']
|
|
450
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
|
451
|
+
:header_params => header_params,
|
|
452
|
+
:query_params => query_params,
|
|
453
|
+
:form_params => form_params,
|
|
454
|
+
:body => post_body,
|
|
455
|
+
:auth_names => auth_names,
|
|
456
|
+
:return_type => 'String')
|
|
457
|
+
if @api_client.config.debugging
|
|
458
|
+
@api_client.config.logger.debug "API called: ContactApi#lists_transfer_contact_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
459
|
+
end
|
|
460
|
+
return data, status_code, headers
|
|
461
|
+
end
|
|
462
|
+
end
|
|
463
|
+
end
|