clicksend_client 1.0.2 → 5.1.1
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 +4 -4
- data/Gemfile +1 -1
- data/README.md +9 -3
- data/clicksend_client.gemspec +4 -3
- data/docs/ContactApi.md +63 -1
- data/docs/CountryListIds.md +8 -0
- data/docs/FaxMessage.md +1 -1
- data/docs/GlobalSendingApi.md +206 -0
- data/docs/InboundSMSRule.md +1 -0
- data/docs/MMSApi.md +117 -0
- data/docs/MmsCampaign.md +1 -1
- data/docs/MmsMessage.md +1 -1
- data/docs/SMSApi.md +1 -1
- data/docs/SmsCampaign.md +2 -1
- data/docs/SmsMessage.md +3 -3
- data/docs/VoiceMessage.md +2 -2
- data/lib/clicksend_client/api/account_api.rb +1 -1
- data/lib/clicksend_client/api/account_recharge_api.rb +1 -1
- data/lib/clicksend_client/api/contact_api.rb +74 -1
- data/lib/clicksend_client/api/contact_list_api.rb +1 -1
- data/lib/clicksend_client/api/countries_api.rb +1 -1
- data/lib/clicksend_client/api/delivery_issues_api.rb +1 -1
- data/lib/clicksend_client/api/detect_address_api.rb +1 -1
- data/lib/clicksend_client/api/email_delivery_receipt_rules_api.rb +1 -1
- data/lib/clicksend_client/api/email_marketing_api.rb +1 -1
- data/lib/clicksend_client/api/email_to_sms_api.rb +1 -1
- data/lib/clicksend_client/api/fax_api.rb +1 -1
- data/lib/clicksend_client/api/fax_delivery_receipt_rules_api.rb +1 -1
- data/lib/clicksend_client/api/global_sending_api.rb +221 -0
- data/lib/clicksend_client/api/inbound_fax_rules_api.rb +1 -1
- data/lib/clicksend_client/api/inbound_sms_rules_api.rb +1 -1
- data/lib/clicksend_client/api/master_email_templates_api.rb +1 -1
- data/lib/clicksend_client/api/mms_api.rb +127 -1
- data/lib/clicksend_client/api/mms_campaign_api.rb +1 -1
- data/lib/clicksend_client/api/number_api.rb +1 -1
- data/lib/clicksend_client/api/post_letter_api.rb +1 -1
- data/lib/clicksend_client/api/post_postcard_api.rb +1 -1
- data/lib/clicksend_client/api/post_return_address_api.rb +1 -1
- data/lib/clicksend_client/api/referral_account_api.rb +1 -1
- data/lib/clicksend_client/api/reseller_account_api.rb +1 -1
- data/lib/clicksend_client/api/search_api.rb +1 -1
- data/lib/clicksend_client/api/sms_api.rb +3 -3
- data/lib/clicksend_client/api/sms_campaign_api.rb +1 -1
- data/lib/clicksend_client/api/sms_delivery_receipt_rules_api.rb +1 -1
- data/lib/clicksend_client/api/statistics_api.rb +1 -1
- data/lib/clicksend_client/api/subaccount_api.rb +1 -1
- data/lib/clicksend_client/api/timezones_api.rb +1 -1
- data/lib/clicksend_client/api/transactional_email_api.rb +1 -1
- data/lib/clicksend_client/api/transfer_credit_api.rb +1 -1
- data/lib/clicksend_client/api/upload_api.rb +1 -1
- data/lib/clicksend_client/api/user_email_templates_api.rb +1 -1
- data/lib/clicksend_client/api/voice_api.rb +1 -1
- data/lib/clicksend_client/api/voice_delivery_receipt_rules_api.rb +1 -1
- data/lib/clicksend_client/api_client.rb +6 -4
- data/lib/clicksend_client/api_error.rb +1 -1
- data/lib/clicksend_client/configuration.rb +3 -3
- data/lib/clicksend_client/models/account.rb +3 -2
- data/lib/clicksend_client/models/account_forgot_password_verify.rb +3 -2
- data/lib/clicksend_client/models/account_verify.rb +3 -2
- data/lib/clicksend_client/models/address.rb +3 -2
- data/lib/clicksend_client/models/attachment.rb +3 -2
- data/lib/clicksend_client/models/contact.rb +3 -2
- data/lib/clicksend_client/models/contact_list.rb +3 -2
- data/lib/clicksend_client/models/contact_list_import.rb +3 -2
- data/lib/clicksend_client/models/country_list_ids.rb +192 -0
- data/lib/clicksend_client/models/credit_card.rb +3 -2
- data/lib/clicksend_client/models/date_before.rb +4 -3
- data/lib/clicksend_client/models/delivery_issue.rb +3 -2
- data/lib/clicksend_client/models/delivery_receipt_rule.rb +3 -2
- data/lib/clicksend_client/models/email.rb +3 -2
- data/lib/clicksend_client/models/email_address.rb +3 -2
- data/lib/clicksend_client/models/email_campaign.rb +3 -2
- data/lib/clicksend_client/models/email_from.rb +3 -2
- data/lib/clicksend_client/models/email_recipient.rb +3 -2
- data/lib/clicksend_client/models/email_sms_address.rb +3 -2
- data/lib/clicksend_client/models/email_template_new.rb +3 -2
- data/lib/clicksend_client/models/email_template_update.rb +3 -2
- data/lib/clicksend_client/models/fax_message.rb +4 -3
- data/lib/clicksend_client/models/fax_message_collection.rb +3 -2
- data/lib/clicksend_client/models/fields.rb +3 -2
- data/lib/clicksend_client/models/fields_fields.rb +3 -2
- data/lib/clicksend_client/models/forgot_password.rb +3 -2
- data/lib/clicksend_client/models/forgot_username.rb +3 -2
- data/lib/clicksend_client/models/inbound_fax_rule.rb +3 -2
- data/lib/clicksend_client/models/inbound_sms_rule.rb +17 -6
- data/lib/clicksend_client/models/mms_campaign.rb +4 -3
- data/lib/clicksend_client/models/mms_message.rb +3 -7
- data/lib/clicksend_client/models/mms_message_collection.rb +3 -2
- data/lib/clicksend_client/models/post_letter.rb +3 -2
- data/lib/clicksend_client/models/post_postcard.rb +3 -2
- data/lib/clicksend_client/models/post_recipient.rb +3 -2
- data/lib/clicksend_client/models/reseller_account.rb +3 -2
- data/lib/clicksend_client/models/reseller_account_transfer_credit.rb +3 -2
- data/lib/clicksend_client/models/sms_campaign.rb +18 -7
- data/lib/clicksend_client/models/sms_message.rb +5 -9
- data/lib/clicksend_client/models/sms_message_collection.rb +3 -2
- data/lib/clicksend_client/models/sms_template.rb +3 -2
- data/lib/clicksend_client/models/stripped_string.rb +3 -2
- data/lib/clicksend_client/models/subaccount.rb +3 -2
- data/lib/clicksend_client/models/upload_file.rb +3 -2
- data/lib/clicksend_client/models/url.rb +3 -2
- data/lib/clicksend_client/models/voice_message.rb +4 -8
- data/lib/clicksend_client/models/voice_message_collection.rb +3 -2
- data/lib/clicksend_client/version.rb +2 -2
- data/lib/clicksend_client.rb +3 -1
- data/spec/api/account_api_spec.rb +1 -1
- data/spec/api/account_recharge_api_spec.rb +1 -1
- data/spec/api/contact_api_spec.rb +16 -1
- data/spec/api/contact_list_api_spec.rb +1 -1
- data/spec/api/countries_api_spec.rb +1 -1
- data/spec/api/delivery_issues_api_spec.rb +1 -1
- data/spec/api/detect_address_api_spec.rb +1 -1
- data/spec/api/email_delivery_receipt_rules_api_spec.rb +1 -1
- data/spec/api/email_marketing_api_spec.rb +1 -1
- data/spec/api/email_to_sms_api_spec.rb +1 -1
- data/spec/api/fax_api_spec.rb +1 -1
- data/spec/api/fax_delivery_receipt_rules_api_spec.rb +1 -1
- data/spec/api/global_sending_api_spec.rb +80 -0
- data/spec/api/inbound_fax_rules_api_spec.rb +1 -1
- data/spec/api/inbound_sms_rules_api_spec.rb +1 -1
- data/spec/api/master_email_templates_api_spec.rb +1 -1
- data/spec/api/mms_api_spec.rb +29 -1
- data/spec/api/mms_campaign_api_spec.rb +1 -1
- data/spec/api/number_api_spec.rb +1 -1
- data/spec/api/post_letter_api_spec.rb +1 -1
- data/spec/api/post_postcard_api_spec.rb +1 -1
- data/spec/api/post_return_address_api_spec.rb +1 -1
- data/spec/api/referral_account_api_spec.rb +1 -1
- data/spec/api/reseller_account_api_spec.rb +1 -1
- data/spec/api/search_api_spec.rb +1 -1
- data/spec/api/sms_api_spec.rb +2 -2
- data/spec/api/sms_campaign_api_spec.rb +1 -1
- data/spec/api/sms_delivery_receipt_rules_api_spec.rb +1 -1
- data/spec/api/statistics_api_spec.rb +1 -1
- data/spec/api/subaccount_api_spec.rb +1 -1
- data/spec/api/timezones_api_spec.rb +1 -1
- data/spec/api/transactional_email_api_spec.rb +1 -1
- data/spec/api/transfer_credit_api_spec.rb +1 -1
- data/spec/api/upload_api_spec.rb +1 -1
- data/spec/api/user_email_templates_api_spec.rb +1 -1
- data/spec/api/voice_api_spec.rb +1 -1
- data/spec/api/voice_delivery_receipt_rules_api_spec.rb +1 -1
- data/spec/api_client_spec.rb +18 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/account_forgot_password_verify_spec.rb +1 -1
- data/spec/models/account_spec.rb +1 -1
- data/spec/models/account_verify_spec.rb +1 -1
- data/spec/models/address_spec.rb +1 -1
- data/spec/models/attachment_spec.rb +1 -1
- data/spec/models/contact_list_import_spec.rb +1 -1
- data/spec/models/contact_list_spec.rb +1 -1
- data/spec/models/contact_spec.rb +1 -1
- data/spec/models/country_list_ids_spec.rb +41 -0
- data/spec/models/credit_card_spec.rb +1 -1
- data/spec/models/date_before_spec.rb +1 -1
- data/spec/models/delivery_issue_spec.rb +1 -1
- data/spec/models/delivery_receipt_rule_spec.rb +1 -1
- data/spec/models/email_address_spec.rb +1 -1
- data/spec/models/email_campaign_spec.rb +1 -1
- data/spec/models/email_from_spec.rb +1 -1
- data/spec/models/email_recipient_spec.rb +1 -1
- data/spec/models/email_sms_address_spec.rb +1 -1
- data/spec/models/email_spec.rb +1 -1
- data/spec/models/email_template_new_spec.rb +1 -1
- data/spec/models/email_template_update_spec.rb +1 -1
- data/spec/models/fax_message_collection_spec.rb +1 -1
- data/spec/models/fax_message_spec.rb +1 -1
- data/spec/models/fields_fields_spec.rb +1 -1
- data/spec/models/fields_spec.rb +1 -1
- data/spec/models/forgot_password_spec.rb +1 -1
- data/spec/models/forgot_username_spec.rb +1 -1
- data/spec/models/inbound_fax_rule_spec.rb +1 -1
- data/spec/models/inbound_sms_rule_spec.rb +7 -1
- data/spec/models/mms_campaign_spec.rb +1 -1
- data/spec/models/mms_message_collection_spec.rb +1 -1
- data/spec/models/mms_message_spec.rb +1 -1
- data/spec/models/post_letter_spec.rb +1 -1
- data/spec/models/post_postcard_spec.rb +1 -1
- data/spec/models/post_recipient_spec.rb +1 -1
- data/spec/models/reseller_account_spec.rb +1 -1
- data/spec/models/reseller_account_transfer_credit_spec.rb +1 -1
- data/spec/models/sms_campaign_spec.rb +7 -1
- data/spec/models/sms_message_collection_spec.rb +1 -1
- data/spec/models/sms_message_spec.rb +1 -1
- data/spec/models/sms_template_spec.rb +1 -1
- data/spec/models/stripped_string_spec.rb +1 -1
- data/spec/models/subaccount_spec.rb +1 -1
- data/spec/models/upload_file_spec.rb +1 -1
- data/spec/models/url_spec.rb +1 -1
- data/spec/models/voice_message_collection_spec.rb +1 -1
- data/spec/models/voice_message_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +109 -84
- data/clicksend_client-1.0.1.gem +0 -0
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
OpenAPI spec version: 3.1
|
|
7
7
|
Contact: support@clicksend.com
|
|
8
8
|
Generated by: https://github.com/clicksend-api/clicksend-codegen.git
|
|
9
|
-
ClickSend Codegen version: 2.4.
|
|
9
|
+
ClickSend Codegen version: 2.4.53-SNAPSHOT
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -745,7 +745,7 @@ module ClickSendClient
|
|
|
745
745
|
return data, status_code, headers
|
|
746
746
|
end
|
|
747
747
|
# Send sms message(s)
|
|
748
|
-
# # Send one or more SMS messages You can post up to 1000 messages with each API call. You can send to a mix of contacts and contact lists, as long as the total number of recipients is up to 1000. The response contains status and details for each recipient. *Refer to [Application Status Codes](https://
|
|
748
|
+
# # Send one or more SMS messages You can post up to 1000 messages with each API call. You can send to a mix of contacts and contact lists, as long as the total number of recipients is up to 1000. The response contains status and details for each recipient. *Refer to [Application Status Codes](https://developers.clicksend.com/docs/#application-status-codes) for the possible response message status strings.*
|
|
749
749
|
# @param sms_messages SmsMessageCollection model
|
|
750
750
|
# @param [Hash] opts the optional parameters
|
|
751
751
|
# @return [String]
|
|
@@ -755,7 +755,7 @@ module ClickSendClient
|
|
|
755
755
|
end
|
|
756
756
|
|
|
757
757
|
# Send sms message(s)
|
|
758
|
-
# # Send one or more SMS messages You can post up to 1000 messages with each API call. You can send to a mix of contacts and contact lists, as long as the total number of recipients is up to 1000. The response contains status and details for each recipient. *Refer to [Application Status Codes](https://
|
|
758
|
+
# # Send one or more SMS messages You can post up to 1000 messages with each API call. You can send to a mix of contacts and contact lists, as long as the total number of recipients is up to 1000. The response contains status and details for each recipient. *Refer to [Application Status Codes](https://developers.clicksend.com/docs/#application-status-codes) for the possible response message status strings.*
|
|
759
759
|
# @param sms_messages SmsMessageCollection model
|
|
760
760
|
# @param [Hash] opts the optional parameters
|
|
761
761
|
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
OpenAPI spec version: 3.1
|
|
7
7
|
Contact: support@clicksend.com
|
|
8
8
|
Generated by: https://github.com/clicksend-api/clicksend-codegen.git
|
|
9
|
-
ClickSend Codegen version: 2.4.
|
|
9
|
+
ClickSend Codegen version: 2.4.53-SNAPSHOT
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'json'
|
|
|
15
15
|
require 'logger'
|
|
16
16
|
require 'tempfile'
|
|
17
17
|
require 'typhoeus'
|
|
18
|
-
require 'uri'
|
|
18
|
+
require 'addressable/uri'
|
|
19
19
|
|
|
20
20
|
module ClickSendClient
|
|
21
21
|
class ApiClient
|
|
@@ -63,7 +63,7 @@ module ClickSendClient
|
|
|
63
63
|
:message => response.return_message)
|
|
64
64
|
else
|
|
65
65
|
fail ApiError.new(:code => response.code,
|
|
66
|
-
:response_headers => response.headers,
|
|
66
|
+
:response_headers => response.headers.to_h,
|
|
67
67
|
:response_body => response.body),
|
|
68
68
|
response.status_message
|
|
69
69
|
end
|
|
@@ -112,6 +112,8 @@ module ClickSendClient
|
|
|
112
112
|
:verbose => @config.debugging
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
req_opts.merge!(multipart: true) if header_params['Content-Type'].start_with? "multipart/"
|
|
116
|
+
|
|
115
117
|
# set custom cert, if provided
|
|
116
118
|
req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
|
|
117
119
|
|
|
@@ -264,7 +266,7 @@ module ClickSendClient
|
|
|
264
266
|
def build_request_url(path)
|
|
265
267
|
# Add leading and trailing slashes to path
|
|
266
268
|
path = "/#{path}".gsub(/\/+/, '/')
|
|
267
|
-
URI.encode(@config.base_url + path)
|
|
269
|
+
Addressable::URI.encode(@config.base_url + path)
|
|
268
270
|
end
|
|
269
271
|
|
|
270
272
|
# Builds the HTTP request body
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
OpenAPI spec version: 3.1
|
|
7
7
|
Contact: support@clicksend.com
|
|
8
8
|
Generated by: https://github.com/clicksend-api/clicksend-codegen.git
|
|
9
|
-
ClickSend Codegen version: 2.4.
|
|
9
|
+
ClickSend Codegen version: 2.4.53-SNAPSHOT
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
|
-
require 'uri'
|
|
13
|
+
require 'addressable/uri'
|
|
14
14
|
|
|
15
15
|
module ClickSendClient
|
|
16
16
|
class Configuration
|
|
@@ -175,7 +175,7 @@ module ClickSendClient
|
|
|
175
175
|
|
|
176
176
|
def base_url
|
|
177
177
|
url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
|
|
178
|
-
URI.encode(url)
|
|
178
|
+
Addressable::URI.encode(url)
|
|
179
179
|
end
|
|
180
180
|
|
|
181
181
|
# Gets API key (with prefix if set).
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
OpenAPI spec version: 3.1
|
|
7
7
|
Contact: support@clicksend.com
|
|
8
8
|
Generated by: https://github.com/clicksend-api/clicksend-codegen.git
|
|
9
|
-
ClickSend Codegen version: 2.4.
|
|
9
|
+
ClickSend Codegen version: 2.4.53-SNAPSHOT
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -195,7 +195,7 @@ module ClickSendClient
|
|
|
195
195
|
return nil unless attributes.is_a?(Hash)
|
|
196
196
|
self.class.clicksend_types.each_pair do |key, type|
|
|
197
197
|
if type =~ /\AArray<(.*)>/i
|
|
198
|
-
# check to ensure the input is an array given that the
|
|
198
|
+
# check to ensure the input is an array given that the attribute
|
|
199
199
|
# is documented as an array but the input is not
|
|
200
200
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
201
201
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
@@ -291,5 +291,6 @@ module ClickSendClient
|
|
|
291
291
|
value
|
|
292
292
|
end
|
|
293
293
|
end
|
|
294
|
+
|
|
294
295
|
end
|
|
295
296
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
OpenAPI spec version: 3.1
|
|
7
7
|
Contact: support@clicksend.com
|
|
8
8
|
Generated by: https://github.com/clicksend-api/clicksend-codegen.git
|
|
9
|
-
ClickSend Codegen version: 2.4.
|
|
9
|
+
ClickSend Codegen version: 2.4.53-SNAPSHOT
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -119,7 +119,7 @@ module ClickSendClient
|
|
|
119
119
|
return nil unless attributes.is_a?(Hash)
|
|
120
120
|
self.class.clicksend_types.each_pair do |key, type|
|
|
121
121
|
if type =~ /\AArray<(.*)>/i
|
|
122
|
-
# check to ensure the input is an array given that the
|
|
122
|
+
# check to ensure the input is an array given that the attribute
|
|
123
123
|
# is documented as an array but the input is not
|
|
124
124
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
125
125
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
@@ -215,5 +215,6 @@ module ClickSendClient
|
|
|
215
215
|
value
|
|
216
216
|
end
|
|
217
217
|
end
|
|
218
|
+
|
|
218
219
|
end
|
|
219
220
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
OpenAPI spec version: 3.1
|
|
7
7
|
Contact: support@clicksend.com
|
|
8
8
|
Generated by: https://github.com/clicksend-api/clicksend-codegen.git
|
|
9
|
-
ClickSend Codegen version: 2.4.
|
|
9
|
+
ClickSend Codegen version: 2.4.53-SNAPSHOT
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -120,7 +120,7 @@ module ClickSendClient
|
|
|
120
120
|
return nil unless attributes.is_a?(Hash)
|
|
121
121
|
self.class.clicksend_types.each_pair do |key, type|
|
|
122
122
|
if type =~ /\AArray<(.*)>/i
|
|
123
|
-
# check to ensure the input is an array given that the
|
|
123
|
+
# check to ensure the input is an array given that the attribute
|
|
124
124
|
# is documented as an array but the input is not
|
|
125
125
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
126
126
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
@@ -216,5 +216,6 @@ module ClickSendClient
|
|
|
216
216
|
value
|
|
217
217
|
end
|
|
218
218
|
end
|
|
219
|
+
|
|
219
220
|
end
|
|
220
221
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
OpenAPI spec version: 3.1
|
|
7
7
|
Contact: support@clicksend.com
|
|
8
8
|
Generated by: https://github.com/clicksend-api/clicksend-codegen.git
|
|
9
|
-
ClickSend Codegen version: 2.4.
|
|
9
|
+
ClickSend Codegen version: 2.4.53-SNAPSHOT
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -170,7 +170,7 @@ module ClickSendClient
|
|
|
170
170
|
return nil unless attributes.is_a?(Hash)
|
|
171
171
|
self.class.clicksend_types.each_pair do |key, type|
|
|
172
172
|
if type =~ /\AArray<(.*)>/i
|
|
173
|
-
# check to ensure the input is an array given that the
|
|
173
|
+
# check to ensure the input is an array given that the attribute
|
|
174
174
|
# is documented as an array but the input is not
|
|
175
175
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
176
176
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
@@ -266,5 +266,6 @@ module ClickSendClient
|
|
|
266
266
|
value
|
|
267
267
|
end
|
|
268
268
|
end
|
|
269
|
+
|
|
269
270
|
end
|
|
270
271
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
OpenAPI spec version: 3.1
|
|
7
7
|
Contact: support@clicksend.com
|
|
8
8
|
Generated by: https://github.com/clicksend-api/clicksend-codegen.git
|
|
9
|
-
ClickSend Codegen version: 2.4.
|
|
9
|
+
ClickSend Codegen version: 2.4.53-SNAPSHOT
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -150,7 +150,7 @@ module ClickSendClient
|
|
|
150
150
|
return nil unless attributes.is_a?(Hash)
|
|
151
151
|
self.class.clicksend_types.each_pair do |key, type|
|
|
152
152
|
if type =~ /\AArray<(.*)>/i
|
|
153
|
-
# check to ensure the input is an array given that the
|
|
153
|
+
# check to ensure the input is an array given that the attribute
|
|
154
154
|
# is documented as an array but the input is not
|
|
155
155
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
156
156
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
@@ -246,5 +246,6 @@ module ClickSendClient
|
|
|
246
246
|
value
|
|
247
247
|
end
|
|
248
248
|
end
|
|
249
|
+
|
|
249
250
|
end
|
|
250
251
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
OpenAPI spec version: 3.1
|
|
7
7
|
Contact: support@clicksend.com
|
|
8
8
|
Generated by: https://github.com/clicksend-api/clicksend-codegen.git
|
|
9
|
-
ClickSend Codegen version: 2.4.
|
|
9
|
+
ClickSend Codegen version: 2.4.53-SNAPSHOT
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -245,7 +245,7 @@ module ClickSendClient
|
|
|
245
245
|
return nil unless attributes.is_a?(Hash)
|
|
246
246
|
self.class.clicksend_types.each_pair do |key, type|
|
|
247
247
|
if type =~ /\AArray<(.*)>/i
|
|
248
|
-
# check to ensure the input is an array given that the
|
|
248
|
+
# check to ensure the input is an array given that the attribute
|
|
249
249
|
# is documented as an array but the input is not
|
|
250
250
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
251
251
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
@@ -341,5 +341,6 @@ module ClickSendClient
|
|
|
341
341
|
value
|
|
342
342
|
end
|
|
343
343
|
end
|
|
344
|
+
|
|
344
345
|
end
|
|
345
346
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
OpenAPI spec version: 3.1
|
|
7
7
|
Contact: support@clicksend.com
|
|
8
8
|
Generated by: https://github.com/clicksend-api/clicksend-codegen.git
|
|
9
|
-
ClickSend Codegen version: 2.4.
|
|
9
|
+
ClickSend Codegen version: 2.4.53-SNAPSHOT
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -90,7 +90,7 @@ module ClickSendClient
|
|
|
90
90
|
return nil unless attributes.is_a?(Hash)
|
|
91
91
|
self.class.clicksend_types.each_pair do |key, type|
|
|
92
92
|
if type =~ /\AArray<(.*)>/i
|
|
93
|
-
# check to ensure the input is an array given that the
|
|
93
|
+
# check to ensure the input is an array given that the attribute
|
|
94
94
|
# is documented as an array but the input is not
|
|
95
95
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
96
96
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
@@ -186,5 +186,6 @@ module ClickSendClient
|
|
|
186
186
|
value
|
|
187
187
|
end
|
|
188
188
|
end
|
|
189
|
+
|
|
189
190
|
end
|
|
190
191
|
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
OpenAPI spec version: 3.1
|
|
7
7
|
Contact: support@clicksend.com
|
|
8
8
|
Generated by: https://github.com/clicksend-api/clicksend-codegen.git
|
|
9
|
-
ClickSend Codegen version: 2.4.
|
|
9
|
+
ClickSend Codegen version: 2.4.53-SNAPSHOT
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -107,7 +107,7 @@ module ClickSendClient
|
|
|
107
107
|
return nil unless attributes.is_a?(Hash)
|
|
108
108
|
self.class.clicksend_types.each_pair do |key, type|
|
|
109
109
|
if type =~ /\AArray<(.*)>/i
|
|
110
|
-
# check to ensure the input is an array given that the
|
|
110
|
+
# check to ensure the input is an array given that the attribute
|
|
111
111
|
# is documented as an array but the input is not
|
|
112
112
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
113
113
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
@@ -203,5 +203,6 @@ module ClickSendClient
|
|
|
203
203
|
value
|
|
204
204
|
end
|
|
205
205
|
end
|
|
206
|
+
|
|
206
207
|
end
|
|
207
208
|
end
|
|
@@ -0,0 +1,192 @@
|
|
|
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.53-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
|
|
15
|
+
module ClickSendClient
|
|
16
|
+
class CountryListIds
|
|
17
|
+
# Array of country ids
|
|
18
|
+
attr_accessor :country_list_ids
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'country_list_ids' => :'country_list_ids'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Attribute type mapping.
|
|
28
|
+
def self.clicksend_types
|
|
29
|
+
{
|
|
30
|
+
:'country_list_ids' => :'Array<Integer>'
|
|
31
|
+
}
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Initializes the object
|
|
35
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
36
|
+
def initialize(attributes = {})
|
|
37
|
+
return unless attributes.is_a?(Hash)
|
|
38
|
+
|
|
39
|
+
# convert string to symbol for hash key
|
|
40
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
41
|
+
|
|
42
|
+
if attributes.has_key?(:'country_list_ids')
|
|
43
|
+
if (value = attributes[:'country_list_ids']).is_a?(Array)
|
|
44
|
+
self.country_list_ids = value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
50
|
+
# @return Array for valid properties with the reasons
|
|
51
|
+
def list_invalid_properties
|
|
52
|
+
invalid_properties = Array.new
|
|
53
|
+
if @country_list_ids.nil?
|
|
54
|
+
invalid_properties.push('invalid value for "country_list_ids", country_list_ids cannot be nil.')
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
invalid_properties
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Check to see if the all the properties in the model are valid
|
|
61
|
+
# @return true if the model is valid
|
|
62
|
+
def valid?
|
|
63
|
+
return false if @country_list_ids.nil?
|
|
64
|
+
true
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Checks equality by comparing each attribute.
|
|
68
|
+
# @param [Object] Object to be compared
|
|
69
|
+
def ==(o)
|
|
70
|
+
return true if self.equal?(o)
|
|
71
|
+
self.class == o.class &&
|
|
72
|
+
country_list_ids == o.country_list_ids
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# @see the `==` method
|
|
76
|
+
# @param [Object] Object to be compared
|
|
77
|
+
def eql?(o)
|
|
78
|
+
self == o
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Calculates hash code according to all attributes.
|
|
82
|
+
# @return [Fixnum] Hash code
|
|
83
|
+
def hash
|
|
84
|
+
[country_list_ids].hash
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Builds the object from hash
|
|
88
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
89
|
+
# @return [Object] Returns the model itself
|
|
90
|
+
def build_from_hash(attributes)
|
|
91
|
+
return nil unless attributes.is_a?(Hash)
|
|
92
|
+
self.class.clicksend_types.each_pair do |key, type|
|
|
93
|
+
if type =~ /\AArray<(.*)>/i
|
|
94
|
+
# check to ensure the input is an array given that the attribute
|
|
95
|
+
# is documented as an array but the input is not
|
|
96
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
97
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
98
|
+
end
|
|
99
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
100
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
101
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
self
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Deserializes the data based on type
|
|
108
|
+
# @param string type Data type
|
|
109
|
+
# @param string value Value to be deserialized
|
|
110
|
+
# @return [Object] Deserialized data
|
|
111
|
+
def _deserialize(type, value)
|
|
112
|
+
case type.to_sym
|
|
113
|
+
when :DateTime
|
|
114
|
+
DateTime.parse(value)
|
|
115
|
+
when :Date
|
|
116
|
+
Date.parse(value)
|
|
117
|
+
when :String
|
|
118
|
+
value.to_s
|
|
119
|
+
when :Integer
|
|
120
|
+
value.to_i
|
|
121
|
+
when :Float
|
|
122
|
+
value.to_f
|
|
123
|
+
when :BOOLEAN
|
|
124
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
125
|
+
true
|
|
126
|
+
else
|
|
127
|
+
false
|
|
128
|
+
end
|
|
129
|
+
when :Object
|
|
130
|
+
# generic object (usually a Hash), return directly
|
|
131
|
+
value
|
|
132
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
133
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
134
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
135
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
136
|
+
k_type = Regexp.last_match[:k_type]
|
|
137
|
+
v_type = Regexp.last_match[:v_type]
|
|
138
|
+
{}.tap do |hash|
|
|
139
|
+
value.each do |k, v|
|
|
140
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
else # model
|
|
144
|
+
temp_model = ClickSendClient.const_get(type).new
|
|
145
|
+
temp_model.build_from_hash(value)
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Returns the string representation of the object
|
|
150
|
+
# @return [String] String presentation of the object
|
|
151
|
+
def to_s
|
|
152
|
+
to_hash.to_s
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
156
|
+
# @return [Hash] Returns the object in the form of hash
|
|
157
|
+
def to_body
|
|
158
|
+
to_hash
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Returns the object in the form of hash
|
|
162
|
+
# @return [Hash] Returns the object in the form of hash
|
|
163
|
+
def to_hash
|
|
164
|
+
hash = {}
|
|
165
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
166
|
+
value = self.send(attr)
|
|
167
|
+
next if value.nil?
|
|
168
|
+
hash[param] = _to_hash(value)
|
|
169
|
+
end
|
|
170
|
+
hash
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Outputs non-array value in the form of hash
|
|
174
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
175
|
+
# @param [Object] value Any valid value
|
|
176
|
+
# @return [Hash] Returns the value in the form of hash
|
|
177
|
+
def _to_hash(value)
|
|
178
|
+
if value.is_a?(Array)
|
|
179
|
+
value.compact.map { |v| _to_hash(v) }
|
|
180
|
+
elsif value.is_a?(Hash)
|
|
181
|
+
{}.tap do |hash|
|
|
182
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
183
|
+
end
|
|
184
|
+
elsif value.respond_to? :to_hash
|
|
185
|
+
value.to_hash
|
|
186
|
+
else
|
|
187
|
+
value
|
|
188
|
+
end
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
end
|
|
192
|
+
end
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
OpenAPI spec version: 3.1
|
|
7
7
|
Contact: support@clicksend.com
|
|
8
8
|
Generated by: https://github.com/clicksend-api/clicksend-codegen.git
|
|
9
|
-
ClickSend Codegen version: 2.4.
|
|
9
|
+
ClickSend Codegen version: 2.4.53-SNAPSHOT
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -165,7 +165,7 @@ module ClickSendClient
|
|
|
165
165
|
return nil unless attributes.is_a?(Hash)
|
|
166
166
|
self.class.clicksend_types.each_pair do |key, type|
|
|
167
167
|
if type =~ /\AArray<(.*)>/i
|
|
168
|
-
# check to ensure the input is an array given that the
|
|
168
|
+
# check to ensure the input is an array given that the attribute
|
|
169
169
|
# is documented as an array but the input is not
|
|
170
170
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
171
171
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
@@ -261,5 +261,6 @@ module ClickSendClient
|
|
|
261
261
|
value
|
|
262
262
|
end
|
|
263
263
|
end
|
|
264
|
+
|
|
264
265
|
end
|
|
265
266
|
end
|