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.
Files changed (194) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +9 -3
  4. data/clicksend_client.gemspec +4 -3
  5. data/docs/ContactApi.md +63 -1
  6. data/docs/CountryListIds.md +8 -0
  7. data/docs/FaxMessage.md +1 -1
  8. data/docs/GlobalSendingApi.md +206 -0
  9. data/docs/InboundSMSRule.md +1 -0
  10. data/docs/MMSApi.md +117 -0
  11. data/docs/MmsCampaign.md +1 -1
  12. data/docs/MmsMessage.md +1 -1
  13. data/docs/SMSApi.md +1 -1
  14. data/docs/SmsCampaign.md +2 -1
  15. data/docs/SmsMessage.md +3 -3
  16. data/docs/VoiceMessage.md +2 -2
  17. data/lib/clicksend_client/api/account_api.rb +1 -1
  18. data/lib/clicksend_client/api/account_recharge_api.rb +1 -1
  19. data/lib/clicksend_client/api/contact_api.rb +74 -1
  20. data/lib/clicksend_client/api/contact_list_api.rb +1 -1
  21. data/lib/clicksend_client/api/countries_api.rb +1 -1
  22. data/lib/clicksend_client/api/delivery_issues_api.rb +1 -1
  23. data/lib/clicksend_client/api/detect_address_api.rb +1 -1
  24. data/lib/clicksend_client/api/email_delivery_receipt_rules_api.rb +1 -1
  25. data/lib/clicksend_client/api/email_marketing_api.rb +1 -1
  26. data/lib/clicksend_client/api/email_to_sms_api.rb +1 -1
  27. data/lib/clicksend_client/api/fax_api.rb +1 -1
  28. data/lib/clicksend_client/api/fax_delivery_receipt_rules_api.rb +1 -1
  29. data/lib/clicksend_client/api/global_sending_api.rb +221 -0
  30. data/lib/clicksend_client/api/inbound_fax_rules_api.rb +1 -1
  31. data/lib/clicksend_client/api/inbound_sms_rules_api.rb +1 -1
  32. data/lib/clicksend_client/api/master_email_templates_api.rb +1 -1
  33. data/lib/clicksend_client/api/mms_api.rb +127 -1
  34. data/lib/clicksend_client/api/mms_campaign_api.rb +1 -1
  35. data/lib/clicksend_client/api/number_api.rb +1 -1
  36. data/lib/clicksend_client/api/post_letter_api.rb +1 -1
  37. data/lib/clicksend_client/api/post_postcard_api.rb +1 -1
  38. data/lib/clicksend_client/api/post_return_address_api.rb +1 -1
  39. data/lib/clicksend_client/api/referral_account_api.rb +1 -1
  40. data/lib/clicksend_client/api/reseller_account_api.rb +1 -1
  41. data/lib/clicksend_client/api/search_api.rb +1 -1
  42. data/lib/clicksend_client/api/sms_api.rb +3 -3
  43. data/lib/clicksend_client/api/sms_campaign_api.rb +1 -1
  44. data/lib/clicksend_client/api/sms_delivery_receipt_rules_api.rb +1 -1
  45. data/lib/clicksend_client/api/statistics_api.rb +1 -1
  46. data/lib/clicksend_client/api/subaccount_api.rb +1 -1
  47. data/lib/clicksend_client/api/timezones_api.rb +1 -1
  48. data/lib/clicksend_client/api/transactional_email_api.rb +1 -1
  49. data/lib/clicksend_client/api/transfer_credit_api.rb +1 -1
  50. data/lib/clicksend_client/api/upload_api.rb +1 -1
  51. data/lib/clicksend_client/api/user_email_templates_api.rb +1 -1
  52. data/lib/clicksend_client/api/voice_api.rb +1 -1
  53. data/lib/clicksend_client/api/voice_delivery_receipt_rules_api.rb +1 -1
  54. data/lib/clicksend_client/api_client.rb +6 -4
  55. data/lib/clicksend_client/api_error.rb +1 -1
  56. data/lib/clicksend_client/configuration.rb +3 -3
  57. data/lib/clicksend_client/models/account.rb +3 -2
  58. data/lib/clicksend_client/models/account_forgot_password_verify.rb +3 -2
  59. data/lib/clicksend_client/models/account_verify.rb +3 -2
  60. data/lib/clicksend_client/models/address.rb +3 -2
  61. data/lib/clicksend_client/models/attachment.rb +3 -2
  62. data/lib/clicksend_client/models/contact.rb +3 -2
  63. data/lib/clicksend_client/models/contact_list.rb +3 -2
  64. data/lib/clicksend_client/models/contact_list_import.rb +3 -2
  65. data/lib/clicksend_client/models/country_list_ids.rb +192 -0
  66. data/lib/clicksend_client/models/credit_card.rb +3 -2
  67. data/lib/clicksend_client/models/date_before.rb +4 -3
  68. data/lib/clicksend_client/models/delivery_issue.rb +3 -2
  69. data/lib/clicksend_client/models/delivery_receipt_rule.rb +3 -2
  70. data/lib/clicksend_client/models/email.rb +3 -2
  71. data/lib/clicksend_client/models/email_address.rb +3 -2
  72. data/lib/clicksend_client/models/email_campaign.rb +3 -2
  73. data/lib/clicksend_client/models/email_from.rb +3 -2
  74. data/lib/clicksend_client/models/email_recipient.rb +3 -2
  75. data/lib/clicksend_client/models/email_sms_address.rb +3 -2
  76. data/lib/clicksend_client/models/email_template_new.rb +3 -2
  77. data/lib/clicksend_client/models/email_template_update.rb +3 -2
  78. data/lib/clicksend_client/models/fax_message.rb +4 -3
  79. data/lib/clicksend_client/models/fax_message_collection.rb +3 -2
  80. data/lib/clicksend_client/models/fields.rb +3 -2
  81. data/lib/clicksend_client/models/fields_fields.rb +3 -2
  82. data/lib/clicksend_client/models/forgot_password.rb +3 -2
  83. data/lib/clicksend_client/models/forgot_username.rb +3 -2
  84. data/lib/clicksend_client/models/inbound_fax_rule.rb +3 -2
  85. data/lib/clicksend_client/models/inbound_sms_rule.rb +17 -6
  86. data/lib/clicksend_client/models/mms_campaign.rb +4 -3
  87. data/lib/clicksend_client/models/mms_message.rb +3 -7
  88. data/lib/clicksend_client/models/mms_message_collection.rb +3 -2
  89. data/lib/clicksend_client/models/post_letter.rb +3 -2
  90. data/lib/clicksend_client/models/post_postcard.rb +3 -2
  91. data/lib/clicksend_client/models/post_recipient.rb +3 -2
  92. data/lib/clicksend_client/models/reseller_account.rb +3 -2
  93. data/lib/clicksend_client/models/reseller_account_transfer_credit.rb +3 -2
  94. data/lib/clicksend_client/models/sms_campaign.rb +18 -7
  95. data/lib/clicksend_client/models/sms_message.rb +5 -9
  96. data/lib/clicksend_client/models/sms_message_collection.rb +3 -2
  97. data/lib/clicksend_client/models/sms_template.rb +3 -2
  98. data/lib/clicksend_client/models/stripped_string.rb +3 -2
  99. data/lib/clicksend_client/models/subaccount.rb +3 -2
  100. data/lib/clicksend_client/models/upload_file.rb +3 -2
  101. data/lib/clicksend_client/models/url.rb +3 -2
  102. data/lib/clicksend_client/models/voice_message.rb +4 -8
  103. data/lib/clicksend_client/models/voice_message_collection.rb +3 -2
  104. data/lib/clicksend_client/version.rb +2 -2
  105. data/lib/clicksend_client.rb +3 -1
  106. data/spec/api/account_api_spec.rb +1 -1
  107. data/spec/api/account_recharge_api_spec.rb +1 -1
  108. data/spec/api/contact_api_spec.rb +16 -1
  109. data/spec/api/contact_list_api_spec.rb +1 -1
  110. data/spec/api/countries_api_spec.rb +1 -1
  111. data/spec/api/delivery_issues_api_spec.rb +1 -1
  112. data/spec/api/detect_address_api_spec.rb +1 -1
  113. data/spec/api/email_delivery_receipt_rules_api_spec.rb +1 -1
  114. data/spec/api/email_marketing_api_spec.rb +1 -1
  115. data/spec/api/email_to_sms_api_spec.rb +1 -1
  116. data/spec/api/fax_api_spec.rb +1 -1
  117. data/spec/api/fax_delivery_receipt_rules_api_spec.rb +1 -1
  118. data/spec/api/global_sending_api_spec.rb +80 -0
  119. data/spec/api/inbound_fax_rules_api_spec.rb +1 -1
  120. data/spec/api/inbound_sms_rules_api_spec.rb +1 -1
  121. data/spec/api/master_email_templates_api_spec.rb +1 -1
  122. data/spec/api/mms_api_spec.rb +29 -1
  123. data/spec/api/mms_campaign_api_spec.rb +1 -1
  124. data/spec/api/number_api_spec.rb +1 -1
  125. data/spec/api/post_letter_api_spec.rb +1 -1
  126. data/spec/api/post_postcard_api_spec.rb +1 -1
  127. data/spec/api/post_return_address_api_spec.rb +1 -1
  128. data/spec/api/referral_account_api_spec.rb +1 -1
  129. data/spec/api/reseller_account_api_spec.rb +1 -1
  130. data/spec/api/search_api_spec.rb +1 -1
  131. data/spec/api/sms_api_spec.rb +2 -2
  132. data/spec/api/sms_campaign_api_spec.rb +1 -1
  133. data/spec/api/sms_delivery_receipt_rules_api_spec.rb +1 -1
  134. data/spec/api/statistics_api_spec.rb +1 -1
  135. data/spec/api/subaccount_api_spec.rb +1 -1
  136. data/spec/api/timezones_api_spec.rb +1 -1
  137. data/spec/api/transactional_email_api_spec.rb +1 -1
  138. data/spec/api/transfer_credit_api_spec.rb +1 -1
  139. data/spec/api/upload_api_spec.rb +1 -1
  140. data/spec/api/user_email_templates_api_spec.rb +1 -1
  141. data/spec/api/voice_api_spec.rb +1 -1
  142. data/spec/api/voice_delivery_receipt_rules_api_spec.rb +1 -1
  143. data/spec/api_client_spec.rb +18 -1
  144. data/spec/configuration_spec.rb +1 -1
  145. data/spec/models/account_forgot_password_verify_spec.rb +1 -1
  146. data/spec/models/account_spec.rb +1 -1
  147. data/spec/models/account_verify_spec.rb +1 -1
  148. data/spec/models/address_spec.rb +1 -1
  149. data/spec/models/attachment_spec.rb +1 -1
  150. data/spec/models/contact_list_import_spec.rb +1 -1
  151. data/spec/models/contact_list_spec.rb +1 -1
  152. data/spec/models/contact_spec.rb +1 -1
  153. data/spec/models/country_list_ids_spec.rb +41 -0
  154. data/spec/models/credit_card_spec.rb +1 -1
  155. data/spec/models/date_before_spec.rb +1 -1
  156. data/spec/models/delivery_issue_spec.rb +1 -1
  157. data/spec/models/delivery_receipt_rule_spec.rb +1 -1
  158. data/spec/models/email_address_spec.rb +1 -1
  159. data/spec/models/email_campaign_spec.rb +1 -1
  160. data/spec/models/email_from_spec.rb +1 -1
  161. data/spec/models/email_recipient_spec.rb +1 -1
  162. data/spec/models/email_sms_address_spec.rb +1 -1
  163. data/spec/models/email_spec.rb +1 -1
  164. data/spec/models/email_template_new_spec.rb +1 -1
  165. data/spec/models/email_template_update_spec.rb +1 -1
  166. data/spec/models/fax_message_collection_spec.rb +1 -1
  167. data/spec/models/fax_message_spec.rb +1 -1
  168. data/spec/models/fields_fields_spec.rb +1 -1
  169. data/spec/models/fields_spec.rb +1 -1
  170. data/spec/models/forgot_password_spec.rb +1 -1
  171. data/spec/models/forgot_username_spec.rb +1 -1
  172. data/spec/models/inbound_fax_rule_spec.rb +1 -1
  173. data/spec/models/inbound_sms_rule_spec.rb +7 -1
  174. data/spec/models/mms_campaign_spec.rb +1 -1
  175. data/spec/models/mms_message_collection_spec.rb +1 -1
  176. data/spec/models/mms_message_spec.rb +1 -1
  177. data/spec/models/post_letter_spec.rb +1 -1
  178. data/spec/models/post_postcard_spec.rb +1 -1
  179. data/spec/models/post_recipient_spec.rb +1 -1
  180. data/spec/models/reseller_account_spec.rb +1 -1
  181. data/spec/models/reseller_account_transfer_credit_spec.rb +1 -1
  182. data/spec/models/sms_campaign_spec.rb +7 -1
  183. data/spec/models/sms_message_collection_spec.rb +1 -1
  184. data/spec/models/sms_message_spec.rb +1 -1
  185. data/spec/models/sms_template_spec.rb +1 -1
  186. data/spec/models/stripped_string_spec.rb +1 -1
  187. data/spec/models/subaccount_spec.rb +1 -1
  188. data/spec/models/upload_file_spec.rb +1 -1
  189. data/spec/models/url_spec.rb +1 -1
  190. data/spec/models/voice_message_collection_spec.rb +1 -1
  191. data/spec/models/voice_message_spec.rb +1 -1
  192. data/spec/spec_helper.rb +1 -1
  193. metadata +109 -84
  194. 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.1-SNAPSHOT
9
+ ClickSend Codegen version: 2.4.53-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -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.1-SNAPSHOT
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://dashboard.clicksend.com/#/signup/step1/) for the possible response message status strings.*
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://dashboard.clicksend.com/#/signup/step1/) for the possible response message status strings.*
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.1-SNAPSHOT
9
+ ClickSend Codegen version: 2.4.53-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -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.1-SNAPSHOT
9
+ ClickSend Codegen version: 2.4.53-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -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.1-SNAPSHOT
9
+ ClickSend Codegen version: 2.4.53-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -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.1-SNAPSHOT
9
+ ClickSend Codegen version: 2.4.53-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -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.1-SNAPSHOT
9
+ ClickSend Codegen version: 2.4.53-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -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.1-SNAPSHOT
9
+ ClickSend Codegen version: 2.4.53-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -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.1-SNAPSHOT
9
+ ClickSend Codegen version: 2.4.53-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -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.1-SNAPSHOT
9
+ ClickSend Codegen version: 2.4.53-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -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.1-SNAPSHOT
9
+ ClickSend Codegen version: 2.4.53-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -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.1-SNAPSHOT
9
+ ClickSend Codegen version: 2.4.53-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -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.1-SNAPSHOT
9
+ ClickSend Codegen version: 2.4.53-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -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.1-SNAPSHOT
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,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.1-SNAPSHOT
9
+ ClickSend Codegen version: 2.4.53-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -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.1-SNAPSHOT
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.1-SNAPSHOT
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 the attribute
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.1-SNAPSHOT
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 the attribute
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.1-SNAPSHOT
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 the attribute
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.1-SNAPSHOT
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 the attribute
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.1-SNAPSHOT
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 the attribute
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.1-SNAPSHOT
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 the attribute
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.1-SNAPSHOT
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 the attribute
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.1-SNAPSHOT
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 the attribute
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.1-SNAPSHOT
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 the attribute
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