sms_works_sdk 1.0.0

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 (78) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +120 -0
  4. data/Rakefile +8 -0
  5. data/docs/ApiKeyResponse.md +9 -0
  6. data/docs/AuthApi.md +102 -0
  7. data/docs/BatchMessage.md +11 -0
  8. data/docs/BatchMessageResponse.md +9 -0
  9. data/docs/BatchMessagesApi.md +224 -0
  10. data/docs/CancelledMessageResponse.md +9 -0
  11. data/docs/ErrorModel.md +9 -0
  12. data/docs/ExtendedErrorModel.md +10 -0
  13. data/docs/HelloWorldResponse.md +8 -0
  14. data/docs/Login.md +10 -0
  15. data/docs/Message.md +12 -0
  16. data/docs/MessageResponse.md +19 -0
  17. data/docs/MessagesApi.md +278 -0
  18. data/docs/MessagesResponse.md +8 -0
  19. data/docs/MessagesResponseMessages.md +8 -0
  20. data/docs/Query.md +13 -0
  21. data/docs/ScheduledBatchResponse.md +9 -0
  22. data/docs/ScheduledMessageResponse.md +9 -0
  23. data/docs/SendMessageResponse.md +10 -0
  24. data/docs/TokenResponse.md +8 -0
  25. data/docs/UtilsApi.md +56 -0
  26. data/git_push.sh +55 -0
  27. data/lib/swagger_client.rb +60 -0
  28. data/lib/swagger_client/api/auth_api.rb +134 -0
  29. data/lib/swagger_client/api/batch_messages_api.rb +243 -0
  30. data/lib/swagger_client/api/messages_api.rb +298 -0
  31. data/lib/swagger_client/api/utils_api.rb +75 -0
  32. data/lib/swagger_client/api_client.rb +389 -0
  33. data/lib/swagger_client/api_error.rb +38 -0
  34. data/lib/swagger_client/configuration.rb +209 -0
  35. data/lib/swagger_client/models/api_key_response.rb +207 -0
  36. data/lib/swagger_client/models/batch_message.rb +241 -0
  37. data/lib/swagger_client/models/batch_message_response.rb +207 -0
  38. data/lib/swagger_client/models/cancelled_message_response.rb +207 -0
  39. data/lib/swagger_client/models/error_model.rb +235 -0
  40. data/lib/swagger_client/models/extended_error_model.rb +249 -0
  41. data/lib/swagger_client/models/hello_world_response.rb +193 -0
  42. data/lib/swagger_client/models/login.rb +209 -0
  43. data/lib/swagger_client/models/message.rb +249 -0
  44. data/lib/swagger_client/models/message_response.rb +347 -0
  45. data/lib/swagger_client/models/messages_response.rb +188 -0
  46. data/lib/swagger_client/models/messages_response_messages.rb +188 -0
  47. data/lib/swagger_client/models/query.rb +239 -0
  48. data/lib/swagger_client/models/scheduled_batch_response.rb +207 -0
  49. data/lib/swagger_client/models/scheduled_message_response.rb +207 -0
  50. data/lib/swagger_client/models/send_message_response.rb +221 -0
  51. data/lib/swagger_client/models/token_response.rb +193 -0
  52. data/lib/swagger_client/version.rb +15 -0
  53. data/spec/api/auth_api_spec.rb +59 -0
  54. data/spec/api/batch_messages_api_spec.rb +83 -0
  55. data/spec/api/messages_api_spec.rb +95 -0
  56. data/spec/api/utils_api_spec.rb +47 -0
  57. data/spec/api_client_spec.rb +226 -0
  58. data/spec/configuration_spec.rb +42 -0
  59. data/spec/models/api_key_response_spec.rb +48 -0
  60. data/spec/models/batch_message_response_spec.rb +48 -0
  61. data/spec/models/batch_message_spec.rb +60 -0
  62. data/spec/models/cancelled_message_response_spec.rb +48 -0
  63. data/spec/models/error_model_spec.rb +48 -0
  64. data/spec/models/extended_error_model_spec.rb +54 -0
  65. data/spec/models/hello_world_response_spec.rb +42 -0
  66. data/spec/models/login_spec.rb +54 -0
  67. data/spec/models/message_response_spec.rb +108 -0
  68. data/spec/models/message_spec.rb +66 -0
  69. data/spec/models/messages_response_messages_spec.rb +42 -0
  70. data/spec/models/messages_response_spec.rb +42 -0
  71. data/spec/models/query_spec.rb +72 -0
  72. data/spec/models/scheduled_batch_response_spec.rb +48 -0
  73. data/spec/models/scheduled_message_response_spec.rb +48 -0
  74. data/spec/models/send_message_response_spec.rb +54 -0
  75. data/spec/models/token_response_spec.rb +42 -0
  76. data/spec/spec_helper.rb +111 -0
  77. data/swagger_client.gemspec +46 -0
  78. metadata +323 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a6a078a55fc73ea7a84275468e9cb2e5502f25f1
4
+ data.tar.gz: 431f36c6d46f3ef207ff4b245a970c208ac4feb0
5
+ SHA512:
6
+ metadata.gz: dbe32eb8976deaf33e8cbb875acffc5fbb7f73db190db401a1705f3f1b80049b9626e2e314f8180e99d149738998710aee29b4e2fc3cf6af8abaccd2f61bf770
7
+ data.tar.gz: 088c81dbd94561679dd00f2a4a62fc016cccc3e9041e090123d00432097311ececfd1a87553942bb21910680f99b13d2354477e0195a310a61b06fb228f4abcb
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rake', '~> 12.0.0'
7
+ end
@@ -0,0 +1,120 @@
1
+ # swagger_client
2
+
3
+ SwaggerClient - the Ruby gem for the The SMS Works API
4
+
5
+ No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
6
+
7
+ This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
+
9
+ - API version: 1.0.0
10
+ - Package version: 1.0.0
11
+ - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
+
13
+ ## Installation
14
+
15
+ ### Build a gem
16
+
17
+ To build the Ruby code into a gem:
18
+
19
+ ```shell
20
+ gem build swagger_client.gemspec
21
+ ```
22
+
23
+ Then either install the gem locally:
24
+
25
+ ```shell
26
+ gem install ./swagger_client-1.0.0.gem
27
+ ```
28
+ (for development, run `gem install --dev ./swagger_client-1.0.0.gem` to install the development dependencies)
29
+
30
+ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
+
32
+ Finally add this to the Gemfile:
33
+
34
+ gem 'swagger_client', '~> 1.0.0'
35
+
36
+ ### Install from Git
37
+
38
+ If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
39
+
40
+ gem 'swagger_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
41
+
42
+ ### Include the Ruby code directly
43
+
44
+ Include the Ruby code directly using `-I` as follows:
45
+
46
+ ```shell
47
+ ruby -Ilib script.rb
48
+ ```
49
+
50
+ ## Getting Started
51
+
52
+ Please follow the [installation](#installation) procedure and then run the following code:
53
+ ```ruby
54
+ # Load the gem
55
+ require 'swagger_client'
56
+
57
+ api_instance = SwaggerClient::AuthApi.new
58
+
59
+ customerid = "customerid_example" # String | The Customer ID
60
+
61
+
62
+ begin
63
+ result = api_instance.key_secret(customerid)
64
+ p result
65
+ rescue SwaggerClient::ApiError => e
66
+ puts "Exception when calling AuthApi->key_secret: #{e}"
67
+ end
68
+
69
+ ```
70
+
71
+ ## Documentation for API Endpoints
72
+
73
+ All URIs are relative to *https://api.thesmsworks.co.uk/v1*
74
+
75
+ Class | Method | HTTP request | Description
76
+ ------------ | ------------- | ------------- | -------------
77
+ *SwaggerClient::AuthApi* | [**key_secret**](docs/AuthApi.md#key_secret) | **GET** /auth/getApiKey |
78
+ *SwaggerClient::AuthApi* | [**login**](docs/AuthApi.md#login) | **POST** /auth/token |
79
+ *SwaggerClient::BatchMessagesApi* | [**cancel_scheduled_batch_job**](docs/BatchMessagesApi.md#cancel_scheduled_batch_job) | **DELETE** /batches/schedule/{batchid} |
80
+ *SwaggerClient::BatchMessagesApi* | [**get_batch_by_id**](docs/BatchMessagesApi.md#get_batch_by_id) | **GET** /batch/{batchid} |
81
+ *SwaggerClient::BatchMessagesApi* | [**schedule_batch**](docs/BatchMessagesApi.md#schedule_batch) | **POST** /batch/schedule |
82
+ *SwaggerClient::BatchMessagesApi* | [**send_batch**](docs/BatchMessagesApi.md#send_batch) | **POST** /batch/send |
83
+ *SwaggerClient::MessagesApi* | [**cancel_scheduled_job**](docs/MessagesApi.md#cancel_scheduled_job) | **DELETE** /messages/schedule/{messageid} |
84
+ *SwaggerClient::MessagesApi* | [**get_message_by_id**](docs/MessagesApi.md#get_message_by_id) | **GET** /messages/{messageid} |
85
+ *SwaggerClient::MessagesApi* | [**get_messages**](docs/MessagesApi.md#get_messages) | **POST** /messages |
86
+ *SwaggerClient::MessagesApi* | [**schedule_message**](docs/MessagesApi.md#schedule_message) | **POST** /message/schedule |
87
+ *SwaggerClient::MessagesApi* | [**send_message**](docs/MessagesApi.md#send_message) | **POST** /message/send |
88
+ *SwaggerClient::UtilsApi* | [**hello**](docs/UtilsApi.md#hello) | **GET** /utils/hello |
89
+
90
+
91
+ ## Documentation for Models
92
+
93
+ - [SwaggerClient::ApiKeyResponse](docs/ApiKeyResponse.md)
94
+ - [SwaggerClient::BatchMessage](docs/BatchMessage.md)
95
+ - [SwaggerClient::BatchMessageResponse](docs/BatchMessageResponse.md)
96
+ - [SwaggerClient::CancelledMessageResponse](docs/CancelledMessageResponse.md)
97
+ - [SwaggerClient::ErrorModel](docs/ErrorModel.md)
98
+ - [SwaggerClient::HelloWorldResponse](docs/HelloWorldResponse.md)
99
+ - [SwaggerClient::Login](docs/Login.md)
100
+ - [SwaggerClient::Message](docs/Message.md)
101
+ - [SwaggerClient::MessageResponse](docs/MessageResponse.md)
102
+ - [SwaggerClient::MessagesResponse](docs/MessagesResponse.md)
103
+ - [SwaggerClient::MessagesResponseMessages](docs/MessagesResponseMessages.md)
104
+ - [SwaggerClient::Query](docs/Query.md)
105
+ - [SwaggerClient::ScheduledBatchResponse](docs/ScheduledBatchResponse.md)
106
+ - [SwaggerClient::ScheduledMessageResponse](docs/ScheduledMessageResponse.md)
107
+ - [SwaggerClient::SendMessageResponse](docs/SendMessageResponse.md)
108
+ - [SwaggerClient::TokenResponse](docs/TokenResponse.md)
109
+ - [SwaggerClient::ExtendedErrorModel](docs/ExtendedErrorModel.md)
110
+
111
+
112
+ ## Documentation for Authorization
113
+
114
+
115
+ ### JWT
116
+
117
+ - **Type**: API key
118
+ - **API key parameter name**: Authorization
119
+ - **Location**: HTTP header
120
+
@@ -0,0 +1,8 @@
1
+ begin
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+ task default: :spec
6
+ rescue LoadError
7
+ # no rspec available
8
+ end
@@ -0,0 +1,9 @@
1
+ # SwaggerClient::ApiKeyResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **key** | **String** | |
7
+ **secret** | **String** | |
8
+
9
+
@@ -0,0 +1,102 @@
1
+ # SwaggerClient::AuthApi
2
+
3
+ All URIs are relative to *https://api.thesmsworks.co.uk/v1*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**key_secret**](AuthApi.md#key_secret) | **GET** /auth/getApiKey |
8
+ [**login**](AuthApi.md#login) | **POST** /auth/token |
9
+
10
+
11
+ # **key_secret**
12
+ > ApiKeyResponse key_secret(customerid)
13
+
14
+
15
+
16
+ Generates an API Key/Secret pair
17
+
18
+ ### Example
19
+ ```ruby
20
+ # load the gem
21
+ require 'swagger_client'
22
+
23
+ api_instance = SwaggerClient::AuthApi.new
24
+
25
+ customerid = "customerid_example" # String | The Customer ID
26
+
27
+
28
+ begin
29
+ result = api_instance.key_secret(customerid)
30
+ p result
31
+ rescue SwaggerClient::ApiError => e
32
+ puts "Exception when calling AuthApi->key_secret: #{e}"
33
+ end
34
+ ```
35
+
36
+ ### Parameters
37
+
38
+ Name | Type | Description | Notes
39
+ ------------- | ------------- | ------------- | -------------
40
+ **customerid** | **String**| The Customer ID |
41
+
42
+ ### Return type
43
+
44
+ [**ApiKeyResponse**](ApiKeyResponse.md)
45
+
46
+ ### Authorization
47
+
48
+ No authorization required
49
+
50
+ ### HTTP request headers
51
+
52
+ - **Content-Type**: application/json
53
+ - **Accept**: application/json;charset=UTF-8
54
+
55
+
56
+
57
+ # **login**
58
+ > TokenResponse login(credentials)
59
+
60
+
61
+
62
+ Generates a Json Web Token
63
+
64
+ ### Example
65
+ ```ruby
66
+ # load the gem
67
+ require 'swagger_client'
68
+
69
+ api_instance = SwaggerClient::AuthApi.new
70
+
71
+ credentials = SwaggerClient::Login.new # Login | API Key & Secret
72
+
73
+
74
+ begin
75
+ result = api_instance.login(credentials)
76
+ p result
77
+ rescue SwaggerClient::ApiError => e
78
+ puts "Exception when calling AuthApi->login: #{e}"
79
+ end
80
+ ```
81
+
82
+ ### Parameters
83
+
84
+ Name | Type | Description | Notes
85
+ ------------- | ------------- | ------------- | -------------
86
+ **credentials** | [**Login**](Login.md)| API Key & Secret |
87
+
88
+ ### Return type
89
+
90
+ [**TokenResponse**](TokenResponse.md)
91
+
92
+ ### Authorization
93
+
94
+ No authorization required
95
+
96
+ ### HTTP request headers
97
+
98
+ - **Content-Type**: application/json
99
+ - **Accept**: application/json;charset=UTF-8
100
+
101
+
102
+
@@ -0,0 +1,11 @@
1
+ # SwaggerClient::BatchMessage
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **sender** | **String** | The sender of the message. Should be no longer than 11 characters for alphanumeric or 15 characters for numeric sender ID's. No spaces or special characters. |
7
+ **destinations** | **Array<String>** | Telephone numbers of each of the recipients |
8
+ **content** | **String** | Message to send to the recipient |
9
+ **schedule** | **String** | Date-time at which to send the batch. This is only used by the batch/schedule service. |
10
+
11
+
@@ -0,0 +1,9 @@
1
+ # SwaggerClient::BatchMessageResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **batchid** | **String** | |
7
+ **status** | **String** | |
8
+
9
+
@@ -0,0 +1,224 @@
1
+ # SwaggerClient::BatchMessagesApi
2
+
3
+ All URIs are relative to *https://api.thesmsworks.co.uk/v1*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**cancel_scheduled_batch_job**](BatchMessagesApi.md#cancel_scheduled_batch_job) | **DELETE** /batches/schedule/{batchid} |
8
+ [**get_batch_by_id**](BatchMessagesApi.md#get_batch_by_id) | **GET** /batch/{batchid} |
9
+ [**schedule_batch**](BatchMessagesApi.md#schedule_batch) | **POST** /batch/schedule |
10
+ [**send_batch**](BatchMessagesApi.md#send_batch) | **POST** /batch/send |
11
+
12
+
13
+ # **cancel_scheduled_batch_job**
14
+ > CancelledMessageResponse cancel_scheduled_batch_job(batchid)
15
+
16
+
17
+
18
+ Cancels a scheduled SMS message
19
+
20
+ ### Example
21
+ ```ruby
22
+ # load the gem
23
+ require 'swagger_client'
24
+ # setup authorization
25
+ SwaggerClient.configure do |config|
26
+ # Configure API key authorization: JWT
27
+ config.api_key['Authorization'] = 'YOUR API KEY'
28
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
29
+ #config.api_key_prefix['Authorization'] = 'Bearer'
30
+ end
31
+
32
+ api_instance = SwaggerClient::BatchMessagesApi.new
33
+
34
+ batchid = "batchid_example" # String | The ID of the batch you would like returned
35
+
36
+
37
+ begin
38
+ result = api_instance.cancel_scheduled_batch_job(batchid)
39
+ p result
40
+ rescue SwaggerClient::ApiError => e
41
+ puts "Exception when calling BatchMessagesApi->cancel_scheduled_batch_job: #{e}"
42
+ end
43
+ ```
44
+
45
+ ### Parameters
46
+
47
+ Name | Type | Description | Notes
48
+ ------------- | ------------- | ------------- | -------------
49
+ **batchid** | **String**| The ID of the batch you would like returned |
50
+
51
+ ### Return type
52
+
53
+ [**CancelledMessageResponse**](CancelledMessageResponse.md)
54
+
55
+ ### Authorization
56
+
57
+ [JWT](../README.md#JWT)
58
+
59
+ ### HTTP request headers
60
+
61
+ - **Content-Type**: application/json
62
+ - **Accept**: application/json;charset=UTF-8
63
+
64
+
65
+
66
+ # **get_batch_by_id**
67
+ > MessagesResponse get_batch_by_id(batchid)
68
+
69
+
70
+
71
+ Retrieve all messages in a batch with the given batch ID
72
+
73
+ ### Example
74
+ ```ruby
75
+ # load the gem
76
+ require 'swagger_client'
77
+ # setup authorization
78
+ SwaggerClient.configure do |config|
79
+ # Configure API key authorization: JWT
80
+ config.api_key['Authorization'] = 'YOUR API KEY'
81
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
82
+ #config.api_key_prefix['Authorization'] = 'Bearer'
83
+ end
84
+
85
+ api_instance = SwaggerClient::BatchMessagesApi.new
86
+
87
+ batchid = "batchid_example" # String | The ID of the batch you would like returned
88
+
89
+
90
+ begin
91
+ result = api_instance.get_batch_by_id(batchid)
92
+ p result
93
+ rescue SwaggerClient::ApiError => e
94
+ puts "Exception when calling BatchMessagesApi->get_batch_by_id: #{e}"
95
+ end
96
+ ```
97
+
98
+ ### Parameters
99
+
100
+ Name | Type | Description | Notes
101
+ ------------- | ------------- | ------------- | -------------
102
+ **batchid** | **String**| The ID of the batch you would like returned |
103
+
104
+ ### Return type
105
+
106
+ [**MessagesResponse**](MessagesResponse.md)
107
+
108
+ ### Authorization
109
+
110
+ [JWT](../README.md#JWT)
111
+
112
+ ### HTTP request headers
113
+
114
+ - **Content-Type**: application/json
115
+ - **Accept**: application/json;charset=UTF-8
116
+
117
+
118
+
119
+ # **schedule_batch**
120
+ > ScheduledBatchResponse schedule_batch(sms_message)
121
+
122
+
123
+
124
+ Schedules a batch of SMS messages to be sent at the date-time you specify
125
+
126
+ ### Example
127
+ ```ruby
128
+ # load the gem
129
+ require 'swagger_client'
130
+ # setup authorization
131
+ SwaggerClient.configure do |config|
132
+ # Configure API key authorization: JWT
133
+ config.api_key['Authorization'] = 'YOUR API KEY'
134
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
135
+ #config.api_key_prefix['Authorization'] = 'Bearer'
136
+ end
137
+
138
+ api_instance = SwaggerClient::BatchMessagesApi.new
139
+
140
+ sms_message = SwaggerClient::BatchMessage.new # BatchMessage | Message properties
141
+
142
+
143
+ begin
144
+ result = api_instance.schedule_batch(sms_message)
145
+ p result
146
+ rescue SwaggerClient::ApiError => e
147
+ puts "Exception when calling BatchMessagesApi->schedule_batch: #{e}"
148
+ end
149
+ ```
150
+
151
+ ### Parameters
152
+
153
+ Name | Type | Description | Notes
154
+ ------------- | ------------- | ------------- | -------------
155
+ **sms_message** | [**BatchMessage**](BatchMessage.md)| Message properties |
156
+
157
+ ### Return type
158
+
159
+ [**ScheduledBatchResponse**](ScheduledBatchResponse.md)
160
+
161
+ ### Authorization
162
+
163
+ [JWT](../README.md#JWT)
164
+
165
+ ### HTTP request headers
166
+
167
+ - **Content-Type**: application/json
168
+ - **Accept**: application/json;charset=UTF-8
169
+
170
+
171
+
172
+ # **send_batch**
173
+ > BatchMessageResponse send_batch(sms_message)
174
+
175
+
176
+
177
+ Send a single SMS message to multiple recipients
178
+
179
+ ### Example
180
+ ```ruby
181
+ # load the gem
182
+ require 'swagger_client'
183
+ # setup authorization
184
+ SwaggerClient.configure do |config|
185
+ # Configure API key authorization: JWT
186
+ config.api_key['Authorization'] = 'YOUR API KEY'
187
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
188
+ #config.api_key_prefix['Authorization'] = 'Bearer'
189
+ end
190
+
191
+ api_instance = SwaggerClient::BatchMessagesApi.new
192
+
193
+ sms_message = SwaggerClient::BatchMessage.new # BatchMessage | Message properties
194
+
195
+
196
+ begin
197
+ result = api_instance.send_batch(sms_message)
198
+ p result
199
+ rescue SwaggerClient::ApiError => e
200
+ puts "Exception when calling BatchMessagesApi->send_batch: #{e}"
201
+ end
202
+ ```
203
+
204
+ ### Parameters
205
+
206
+ Name | Type | Description | Notes
207
+ ------------- | ------------- | ------------- | -------------
208
+ **sms_message** | [**BatchMessage**](BatchMessage.md)| Message properties |
209
+
210
+ ### Return type
211
+
212
+ [**BatchMessageResponse**](BatchMessageResponse.md)
213
+
214
+ ### Authorization
215
+
216
+ [JWT](../README.md#JWT)
217
+
218
+ ### HTTP request headers
219
+
220
+ - **Content-Type**: application/json
221
+ - **Accept**: application/json;charset=UTF-8
222
+
223
+
224
+