ruby-transmitsms 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +4 -0
  3. data/Gemfile.lock +49 -0
  4. data/LICENSE +22 -0
  5. data/README.md +62 -0
  6. data/Rakefile +7 -0
  7. data/fixtures/vcr_cassettes/account_api_get_balance.yml +49 -0
  8. data/fixtures/vcr_cassettes/email_sms_api_add_email.yml +49 -0
  9. data/fixtures/vcr_cassettes/email_sms_api_delete_email.yml +49 -0
  10. data/fixtures/vcr_cassettes/keywords_api_add_keyword.yml +49 -0
  11. data/fixtures/vcr_cassettes/keywords_api_edit_keyword.yml +49 -0
  12. data/fixtures/vcr_cassettes/keywords_api_get_keywords.yml +50 -0
  13. data/fixtures/vcr_cassettes/lists_api_add_list.yml +49 -0
  14. data/fixtures/vcr_cassettes/lists_api_add_to_list.yml +50 -0
  15. data/fixtures/vcr_cassettes/lists_api_delete_from_list.yml +49 -0
  16. data/fixtures/vcr_cassettes/lists_api_edit_list_member.yml +50 -0
  17. data/fixtures/vcr_cassettes/lists_api_get_list.yml +60 -0
  18. data/fixtures/vcr_cassettes/lists_api_get_lists.yml +61 -0
  19. data/fixtures/vcr_cassettes/lists_api_optout_list_member.yml +49 -0
  20. data/fixtures/vcr_cassettes/lists_api_remove_list.yml +49 -0
  21. data/fixtures/vcr_cassettes/numbers_api_get_number.yml +49 -0
  22. data/fixtures/vcr_cassettes/numbers_api_get_numbers.yml +49 -0
  23. data/fixtures/vcr_cassettes/numbers_api_lease_number.yml +50 -0
  24. data/fixtures/vcr_cassettes/resellers_api_add_client.yml +49 -0
  25. data/fixtures/vcr_cassettes/resellers_api_edit_client.yml +40 -0
  26. data/fixtures/vcr_cassettes/resellers_api_get_client.yml +50 -0
  27. data/fixtures/vcr_cassettes/resellers_api_get_clients.yml +59 -0
  28. data/fixtures/vcr_cassettes/resellers_api_get_transaction.yml +51 -0
  29. data/fixtures/vcr_cassettes/resellers_api_get_transactions.yml +61 -0
  30. data/fixtures/vcr_cassettes/sms_api_test_cancel_sms.yml +50 -0
  31. data/fixtures/vcr_cassettes/sms_api_test_format_number.yml +49 -0
  32. data/fixtures/vcr_cassettes/sms_api_test_format_number_fail_in_missing_msisdn.yml +50 -0
  33. data/fixtures/vcr_cassettes/sms_api_test_get_message_log.yml +50 -0
  34. data/fixtures/vcr_cassettes/sms_api_test_get_sms_info.yml +49 -0
  35. data/fixtures/vcr_cassettes/sms_api_test_get_sms_info_fail_for_not_existing_message_id.yml +50 -0
  36. data/fixtures/vcr_cassettes/sms_api_test_get_sms_responses.yml +53 -0
  37. data/fixtures/vcr_cassettes/sms_api_test_get_sms_sent.yml +50 -0
  38. data/fixtures/vcr_cassettes/sms_api_test_get_user_sms_responses.yml +49 -0
  39. data/fixtures/vcr_cassettes/sms_api_test_message_reply.yml +49 -0
  40. data/fixtures/vcr_cassettes/sms_api_test_send.yml +49 -0
  41. data/fixtures/vcr_cassettes/sms_api_test_send_missing_to_and_list_id.yml +50 -0
  42. data/fixtures/vcr_cassettes/sms_api_test_send_with_list_id.yml +50 -0
  43. data/geminstall.sh +1 -0
  44. data/lib/account_api.rb +80 -0
  45. data/lib/email_api.rb +137 -0
  46. data/lib/keywords_api.rb +224 -0
  47. data/lib/lists_api.rb +523 -0
  48. data/lib/monkey.rb +90 -0
  49. data/lib/numbers_api.rb +188 -0
  50. data/lib/resellers_api.rb +379 -0
  51. data/lib/ruby-transmitsms.rb +16 -0
  52. data/lib/sms_api.rb +550 -0
  53. data/lib/swagger.rb +84 -0
  54. data/lib/swagger/configuration.rb +22 -0
  55. data/lib/swagger/request.rb +212 -0
  56. data/lib/swagger/response.rb +70 -0
  57. data/lib/swagger/version.rb +4 -0
  58. data/ruby-transmitsms.gemspec +33 -0
  59. data/runtest.sh +8 -0
  60. data/setup.sh +1 -0
  61. data/spec/.resellers_api_spec.rb.swp +0 -0
  62. data/spec/account_api_spec.rb +30 -0
  63. data/spec/email_sms_api_spec.rb +40 -0
  64. data/spec/keywords_api_spec.rb +56 -0
  65. data/spec/lists_api_spec.rb +117 -0
  66. data/spec/numbers_api_spec.rb +53 -0
  67. data/spec/resellers_api_spec.rb +85 -0
  68. data/spec/sms_api_spec.rb +174 -0
  69. data/spec/spec.opts +4 -0
  70. metadata +219 -0
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.burst.dev.local/format-number.json?countrycode=AU&msisdn=0455667889
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - ruby-swagger-4.06.08
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Api-Key:
15
+ - ''
16
+ Authorization:
17
+ - |
18
+ Basic MTVhZDI2NmM1MzhmYjM2YzRkOTBmMDEwNTVhZWY0OTQ6bW9vc2U=
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: OK
23
+ headers:
24
+ Server:
25
+ - nginx/1.1.19
26
+ Date:
27
+ - Mon, 14 Sep 2015 07:26:04 GMT
28
+ Content-Type:
29
+ - application/json; charset=utf-8
30
+ Transfer-Encoding:
31
+ - chunked
32
+ Connection:
33
+ - keep-alive
34
+ X-Powered-By:
35
+ - PHP/5.4.44-1+deb.sury.org~precise+1
36
+ Expires:
37
+ - Thu, 19 Nov 1981 08:52:00 GMT
38
+ Cache-Control:
39
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
40
+ Pragma:
41
+ - no-cache
42
+ X-Mashape-Billing:
43
+ - Queries=1
44
+ body:
45
+ encoding: UTF-8
46
+ string: '{"number":{"countrycode":61,"nationalnumber":455667889,"national_leading_zeroes":455667889,"rawinput":null,"international":61455667889,"type":1,"isValid":true},"error":{"code":"SUCCESS","description":"OK"}}'
47
+ http_version:
48
+ recorded_at: Mon, 14 Sep 2015 07:26:04 GMT
49
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.burst.dev.local/format-number.json?countrycode=AU
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - ruby-swagger-4.06.08
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Api-Key:
15
+ - ''
16
+ Authorization:
17
+ - |
18
+ Basic MTVhZDI2NmM1MzhmYjM2YzRkOTBmMDEwNTVhZWY0OTQ6bW9vc2U=
19
+ response:
20
+ status:
21
+ code: 400
22
+ message: Bad Request
23
+ headers:
24
+ Server:
25
+ - nginx/1.1.19
26
+ Date:
27
+ - Mon, 14 Sep 2015 07:26:51 GMT
28
+ Content-Type:
29
+ - application/json; charset=utf-8
30
+ Transfer-Encoding:
31
+ - chunked
32
+ Connection:
33
+ - keep-alive
34
+ X-Powered-By:
35
+ - PHP/5.4.44-1+deb.sury.org~precise+1
36
+ Expires:
37
+ - Thu, 19 Nov 1981 08:52:00 GMT
38
+ Cache-Control:
39
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
40
+ Pragma:
41
+ - no-cache
42
+ X-Mashape-Billing:
43
+ - Queries=1
44
+ body:
45
+ encoding: UTF-8
46
+ string: '{"error":{"code":"FIELD_EMPTY","description":"Required field ''msisdn''
47
+ is empty"}}'
48
+ http_version:
49
+ recorded_at: Mon, 14 Sep 2015 07:26:51 GMT
50
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.burst.dev.local/get-message-log.json?message_id=50694&mobile=61422222222
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - ruby-swagger-4.06.08
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Api-Key:
15
+ - ''
16
+ Authorization:
17
+ - |
18
+ Basic MTVhZDI2NmM1MzhmYjM2YzRkOTBmMDEwNTVhZWY0OTQ6bW9vc2U=
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: OK
23
+ headers:
24
+ Server:
25
+ - nginx/1.1.19
26
+ Date:
27
+ - Mon, 14 Sep 2015 07:18:43 GMT
28
+ Content-Type:
29
+ - application/json; charset=utf-8
30
+ Transfer-Encoding:
31
+ - chunked
32
+ Connection:
33
+ - keep-alive
34
+ X-Powered-By:
35
+ - PHP/5.4.44-1+deb.sury.org~precise+1
36
+ Expires:
37
+ - Thu, 19 Nov 1981 08:52:00 GMT
38
+ Cache-Control:
39
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
40
+ Pragma:
41
+ - no-cache
42
+ X-Mashape-Billing:
43
+ - Queries=1
44
+ body:
45
+ encoding: UTF-8
46
+ string: '{"message_id":50694,"message":"Testing API to field","mobile":61422222222,"caller_id":61422345678,"datetime_send":"2015-09-14
47
+ 07:06:21","error":{"code":"SUCCESS","description":"OK"}}'
48
+ http_version:
49
+ recorded_at: Mon, 14 Sep 2015 07:18:43 GMT
50
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.burst.dev.local/get-sms.json?message_id=27746
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - ruby-swagger-4.06.08
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Api-Key:
15
+ - ''
16
+ Authorization:
17
+ - |
18
+ Basic MTVhZDI2NmM1MzhmYjM2YzRkOTBmMDEwNTVhZWY0OTQ6bW9vc2U=
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: OK
23
+ headers:
24
+ Server:
25
+ - nginx/1.1.19
26
+ Date:
27
+ - Mon, 14 Sep 2015 07:27:30 GMT
28
+ Content-Type:
29
+ - application/json; charset=utf-8
30
+ Transfer-Encoding:
31
+ - chunked
32
+ Connection:
33
+ - keep-alive
34
+ X-Powered-By:
35
+ - PHP/5.4.44-1+deb.sury.org~precise+1
36
+ Expires:
37
+ - Thu, 19 Nov 1981 08:52:00 GMT
38
+ Cache-Control:
39
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
40
+ Pragma:
41
+ - no-cache
42
+ X-Mashape-Billing:
43
+ - Queries=1
44
+ body:
45
+ encoding: UTF-8
46
+ string: '{"message_id":27746,"send_at":"2009-10-13 10:56:55","recipients":0,"cost":0,"sms":0,"delivery_stats":{"delivered":1,"pending":1,"bounced":0,"responses":2,"optouts":0},"error":{"code":"SUCCESS","description":"OK"}}'
47
+ http_version:
48
+ recorded_at: Mon, 14 Sep 2015 07:27:30 GMT
49
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.burst.dev.local/get-sms.json?message_id=1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - ruby-swagger-4.06.08
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Api-Key:
15
+ - ''
16
+ Authorization:
17
+ - |
18
+ Basic MTVhZDI2NmM1MzhmYjM2YzRkOTBmMDEwNTVhZWY0OTQ6bW9vc2U=
19
+ response:
20
+ status:
21
+ code: 400
22
+ message: Bad Request
23
+ headers:
24
+ Server:
25
+ - nginx/1.1.19
26
+ Date:
27
+ - Mon, 14 Sep 2015 07:27:53 GMT
28
+ Content-Type:
29
+ - application/json; charset=utf-8
30
+ Transfer-Encoding:
31
+ - chunked
32
+ Connection:
33
+ - keep-alive
34
+ X-Powered-By:
35
+ - PHP/5.4.44-1+deb.sury.org~precise+1
36
+ Expires:
37
+ - Thu, 19 Nov 1981 08:52:00 GMT
38
+ Cache-Control:
39
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
40
+ Pragma:
41
+ - no-cache
42
+ X-Mashape-Billing:
43
+ - Queries=1
44
+ body:
45
+ encoding: UTF-8
46
+ string: '{"error":{"code":"NOT_FOUND","description":"Message with this ID does
47
+ not exist"}}'
48
+ http_version:
49
+ recorded_at: Mon, 14 Sep 2015 07:27:53 GMT
50
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,53 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.burst.dev.local/get-sms-responses.json?message_id=27746
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - ruby-swagger-4.06.08
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Api-Key:
15
+ - ''
16
+ Authorization:
17
+ - |
18
+ Basic MTVhZDI2NmM1MzhmYjM2YzRkOTBmMDEwNTVhZWY0OTQ6bW9vc2U=
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: OK
23
+ headers:
24
+ Server:
25
+ - nginx/1.1.19
26
+ Date:
27
+ - Mon, 14 Sep 2015 07:28:22 GMT
28
+ Content-Type:
29
+ - application/json; charset=utf-8
30
+ Transfer-Encoding:
31
+ - chunked
32
+ Connection:
33
+ - keep-alive
34
+ X-Powered-By:
35
+ - PHP/5.4.44-1+deb.sury.org~precise+1
36
+ Expires:
37
+ - Thu, 19 Nov 1981 08:52:00 GMT
38
+ Cache-Control:
39
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
40
+ Pragma:
41
+ - no-cache
42
+ X-Mashape-Billing:
43
+ - Queries=1
44
+ body:
45
+ encoding: UTF-8
46
+ string: '{"page":{"count":1,"number":1},"total":2,"responses":[{"id":157,"message_id":27746,"list_id":0,"received_at":"2009-10-13
47
+ 13:57:55","first_name":"Nathan","last_name":"Bryant","msisdn":61406614352,"response":"Second
48
+ test","longcode":null},{"id":156,"message_id":27746,"list_id":0,"received_at":"2009-10-13
49
+ 10:58:31","first_name":"Nathan","last_name":"Bryant","msisdn":61406614352,"response":"Testing
50
+ campaign","longcode":null}],"error":{"code":"SUCCESS","description":"OK"}}'
51
+ http_version:
52
+ recorded_at: Mon, 14 Sep 2015 07:28:22 GMT
53
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.burst.dev.local/get-sms-sent.json?message_id=27746
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - ruby-swagger-4.06.08
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Api-Key:
15
+ - ''
16
+ Authorization:
17
+ - |
18
+ Basic MTVhZDI2NmM1MzhmYjM2YzRkOTBmMDEwNTVhZWY0OTQ6bW9vc2U=
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: OK
23
+ headers:
24
+ Server:
25
+ - nginx/1.1.19
26
+ Date:
27
+ - Mon, 14 Sep 2015 07:35:21 GMT
28
+ Content-Type:
29
+ - application/json; charset=utf-8
30
+ Transfer-Encoding:
31
+ - chunked
32
+ Connection:
33
+ - keep-alive
34
+ X-Powered-By:
35
+ - PHP/5.4.44-1+deb.sury.org~precise+1
36
+ Expires:
37
+ - Thu, 19 Nov 1981 08:52:00 GMT
38
+ Cache-Control:
39
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
40
+ Pragma:
41
+ - no-cache
42
+ X-Mashape-Billing:
43
+ - Queries=1
44
+ body:
45
+ encoding: UTF-8
46
+ string: '{"page":{"count":1,"number":1},"total":2,"message":{"message_id":27746,"send_at":"2009-10-13
47
+ 10:56:55","recipients":0,"cost":0,"sms":0,"delivery_stats":{"delivered":1,"pending":1,"bounced":0,"responses":2,"optouts":0}},"recipients":[{"msisdn":61406614352,"first_name":null,"last_name":null,"delivery_status":"pending","optout":false},{"msisdn":61406614352,"first_name":null,"last_name":null,"delivery_status":"pending","optout":false}],"error":{"code":"SUCCESS","description":"OK"}}'
48
+ http_version:
49
+ recorded_at: Mon, 14 Sep 2015 07:35:21 GMT
50
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.burst.dev.local/get-user-sms-responses.json?enddate=2015-04-20%2023:59:59&start=2015-09-13%2000:00:00
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - ruby-swagger-4.06.08
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Api-Key:
15
+ - ''
16
+ Authorization:
17
+ - |
18
+ Basic MTVhZDI2NmM1MzhmYjM2YzRkOTBmMDEwNTVhZWY0OTQ6bW9vc2U=
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: OK
23
+ headers:
24
+ Server:
25
+ - nginx/1.1.19
26
+ Date:
27
+ - Mon, 14 Sep 2015 07:33:13 GMT
28
+ Content-Type:
29
+ - application/json; charset=utf-8
30
+ Transfer-Encoding:
31
+ - chunked
32
+ Connection:
33
+ - keep-alive
34
+ X-Powered-By:
35
+ - PHP/5.4.44-1+deb.sury.org~precise+1
36
+ Expires:
37
+ - Thu, 19 Nov 1981 08:52:00 GMT
38
+ Cache-Control:
39
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
40
+ Pragma:
41
+ - no-cache
42
+ X-Mashape-Billing:
43
+ - Queries=1
44
+ body:
45
+ encoding: UTF-8
46
+ string: '{"page":{"count":1,"number":1},"total":1,"error":{"code":"SUCCESS","description":"OK"}}'
47
+ http_version:
48
+ recorded_at: Mon, 14 Sep 2015 07:33:13 GMT
49
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,49 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.burst.dev.local/message-reply.json?from=61422222222&message=Testing%20API%20to%20field&to=61412345678
6
+ body:
7
+ encoding: UTF-8
8
+ string: 'null'
9
+ headers:
10
+ User-Agent:
11
+ - ruby-swagger-4.06.08
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Api-Key:
15
+ - ''
16
+ Authorization:
17
+ - |
18
+ Basic MTVhZDI2NmM1MzhmYjM2YzRkOTBmMDEwNTVhZWY0OTQ6bW9vc2U=
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: OK
23
+ headers:
24
+ Server:
25
+ - nginx/1.1.19
26
+ Date:
27
+ - Mon, 14 Sep 2015 07:13:30 GMT
28
+ Content-Type:
29
+ - application/json; charset=utf-8
30
+ Transfer-Encoding:
31
+ - chunked
32
+ Connection:
33
+ - keep-alive
34
+ X-Powered-By:
35
+ - PHP/5.4.44-1+deb.sury.org~precise+1
36
+ Expires:
37
+ - Thu, 19 Nov 1981 08:52:00 GMT
38
+ Cache-Control:
39
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
40
+ Pragma:
41
+ - no-cache
42
+ X-Mashape-Billing:
43
+ - Queries=1
44
+ body:
45
+ encoding: UTF-8
46
+ string: '{"result":"SYSTEM: Message response handled\n","error":{"code":"SUCCESS","description":"OK"}}'
47
+ http_version:
48
+ recorded_at: Mon, 14 Sep 2015 07:13:30 GMT
49
+ recorded_with: VCR 2.9.3