semaphore-sms 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e7358f54b837825b64dd4bc1b141e17b18cce880
4
- data.tar.gz: 61e9d78419c12c8a810eeed68b3bf7cc9d3c1aa1
3
+ metadata.gz: 109bbcf088a8e6fd255a87164369fb4c45092dac
4
+ data.tar.gz: ece15bffbbd1ef1ba8b1041b154a0ea973500d36
5
5
  SHA512:
6
- metadata.gz: 5bb7f0a88a10d185a709097e5574320458f4ccfc0cd417de2c0b1e9647de60dc10c2c862e8c6821a487390ce2a663c06aa9325c7e45d11f328ac3f8428f6974d
7
- data.tar.gz: 84c048da5047661a273e35b8a6ada3c84621bdfe34032ac263b555091ea66b360ad2f4a80b73c6f4f23bf9264b57f6fc930a92ebc4a6b5b61308c23394013a6b
6
+ metadata.gz: 19878b0a47c50ec4e7dbf6e7d1271b41c46c18500abb298ca0fe4f5beb34b0b23d86f26b87795e2116bac280f60e8e8569624f52dc2abce7af8a16e88cf46761
7
+ data.tar.gz: ce7b95e4d4c381bfcab66933791b5138d0d71aa5aa6d60132bf74d1714cdf3647d2afc2b3248fd44f4f30dfae31914a66ed0e3ffadd285976025ea82d8e19b62
data/README.md CHANGED
@@ -136,6 +136,21 @@ require "semaphore-sms"
136
136
 
137
137
  client.messages
138
138
 
139
+ client.messages(
140
+ id: nil,
141
+ page: nil,
142
+ limit: nil,
143
+ start_date: nil,
144
+ end_date: nil,
145
+ network: nil,
146
+ status: nil
147
+ )
148
+
149
+ # Note: all params are optional.
150
+ Format is "YYYY-MM-DD" for date,
151
+ Format is lowercase (e.g. "globe", "smart") for network,
152
+ Format is lowercase (e.g. "pending", "success")
153
+
139
154
  ## Requesting for a specific message
140
155
 
141
156
  client.messages(id: 55871555)
@@ -143,17 +158,17 @@ require "semaphore-sms"
143
158
  ## Requesting for all transaction made
144
159
 
145
160
  client.transactions
146
- client.transactions(id: 1, limit: 100) # Page and Limit are optional. Limit default to 100.
161
+ client.transactions(id: 1, limit: 100) # Page and Limit are optional. Limit default to 100 and page 1.
147
162
 
148
163
  ## Requesting for all sender names
149
164
 
150
165
  client.sender_names
151
- client.sender_name(id: 1, limit: 100) # Page and Limit are optional. Limit default to 100.
166
+ client.sender_name(id: 1, limit: 100) # Page and Limit are optional. Limit default to 100 and page 1.
152
167
 
153
168
  ## Requesting for all users
154
169
 
155
170
  client.users
156
- client.users(id: 1, limit: 100) # Page and Limit are optional. Limit default to 100.
171
+ client.users(id: 1, limit: 100) # Page and Limit are optional. Limit default to 100 and page 1.
157
172
  ```
158
173
 
159
174
  ## Development
@@ -33,15 +33,23 @@ module Semaphore
33
33
  api_post("priority", options)
34
34
  end
35
35
 
36
- def messages(id: nil)
37
- api_get("messages#{id.nil? ? "" : "/#{id}"}")
36
+ def messages(id: nil, page: nil, limit: nil, start_date: nil, end_date: nil, network: nil, status: nil)
37
+ options = {
38
+ page: page,
39
+ limit: limit,
40
+ startDate: start_date,
41
+ endDate: end_date,
42
+ network: network,
43
+ status: status
44
+ }.compact
45
+ api_get("messages#{id.nil? ? "" : "/#{id}"}", options)
38
46
  end
39
47
 
40
48
  def account
41
49
  api_get("account")
42
50
  end
43
51
 
44
- def transactions(page: nil, limit: 100)
52
+ def transactions(page: nil, limit: nil)
45
53
  options = {
46
54
  page: page,
47
55
  limit: limit
@@ -49,7 +57,7 @@ module Semaphore
49
57
  api_get("account/transactions", options)
50
58
  end
51
59
 
52
- def sender_names(page: nil, limit: 100)
60
+ def sender_names(page: nil, limit: nil)
53
61
  options = {
54
62
  page: page,
55
63
  limit: limit
@@ -57,7 +65,7 @@ module Semaphore
57
65
  api_get("account/sendernames", options)
58
66
  end
59
67
 
60
- def users(page: nil, limit: 100)
68
+ def users(page: nil, limit: nil)
61
69
  options = {
62
70
  page: page,
63
71
  limit: limit
@@ -1,5 +1,5 @@
1
1
  module Semaphore
2
2
  module Sms
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semaphore-sms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Arnold Go