seven_api 0.6.0 → 0.6.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/.gitignore +7 -6
- data/.idea/inspectionProfiles/Project_Default.xml +5 -5
- data/.idea/ruby-client.iml +48 -13
- data/Gemfile +2 -2
- data/LICENSE +21 -21
- data/README.md +1 -1
- data/Rakefile +5 -5
- data/doc/SevenApi/Client.html +8 -8
- data/doc/SevenApi/Contacts/Action.html +0 -0
- data/doc/SevenApi/Contacts.html +0 -0
- data/doc/SevenApi/Endpoint.html +0 -0
- data/doc/SevenApi/Hooks/Action.html +0 -0
- data/doc/SevenApi/Hooks/EventType.html +0 -0
- data/doc/SevenApi/Hooks/RequestMethod.html +0 -0
- data/doc/SevenApi/Hooks/Validator.html +26 -26
- data/doc/SevenApi/Hooks.html +0 -0
- data/doc/SevenApi/Journal/Type.html +0 -0
- data/doc/SevenApi/Journal/Validator.html +18 -18
- data/doc/SevenApi/Journal.html +0 -0
- data/doc/SevenApi/Lookup/Type.html +0 -0
- data/doc/SevenApi/Lookup.html +0 -0
- data/doc/SevenApi/Resource.html +13 -13
- data/doc/SevenApi/Resources/Analytics.html +2 -2
- data/doc/SevenApi/Resources/Balance.html +2 -2
- data/doc/SevenApi/Resources/Contacts.html +6 -6
- data/doc/SevenApi/Resources/Hooks.html +10 -10
- data/doc/SevenApi/Resources/Journal.html +2 -2
- data/doc/SevenApi/Resources/Lookup.html +8 -8
- data/doc/SevenApi/Resources/Pricing.html +2 -2
- data/doc/SevenApi/Resources/Sms.html +2 -2
- data/doc/SevenApi/Resources/Status.html +2 -2
- data/doc/SevenApi/Resources/Subaccounts.html +18 -18
- data/doc/SevenApi/Resources/ValidateForVoice.html +2 -2
- data/doc/SevenApi/Resources/Voice.html +2 -2
- data/doc/SevenApi/Resources.html +0 -0
- data/doc/SevenApi/Sms/Type.html +0 -0
- data/doc/SevenApi/Sms.html +0 -0
- data/doc/SevenApi/Subaccounts/Action.html +0 -0
- data/doc/SevenApi/Subaccounts/Validator.html +29 -29
- data/doc/SevenApi/Subaccounts.html +0 -0
- data/doc/SevenApi/Util.html +39 -39
- data/doc/SevenApi.html +0 -0
- data/document.sh +3 -0
- data/lib/seven_api/client.rb +32 -32
- data/lib/seven_api/contacts.rb +5 -5
- data/lib/seven_api/endpoint.rb +0 -0
- data/lib/seven_api/hooks.rb +69 -68
- data/lib/seven_api/journal.rb +39 -39
- data/lib/seven_api/lookup.rb +12 -12
- data/lib/seven_api/numbers.rb +9 -9
- data/lib/seven_api/paginated.rb +10 -10
- data/lib/seven_api/rcs.rb +0 -0
- data/lib/seven_api/resource.rb +1 -2
- data/lib/seven_api/resources/analytics.rb +54 -54
- data/lib/seven_api/resources/balance.rb +19 -19
- data/lib/seven_api/resources/contacts.rb +56 -56
- data/lib/seven_api/resources/groups.rb +56 -56
- data/lib/seven_api/resources/hooks.rb +40 -40
- data/lib/seven_api/resources/journal.rb +20 -20
- data/lib/seven_api/resources/lookup.rb +63 -63
- data/lib/seven_api/resources/numbers.rb +70 -69
- data/lib/seven_api/resources/pricing.rb +20 -20
- data/lib/seven_api/resources/rcs.rb +3 -3
- data/lib/seven_api/resources/sms.rb +29 -20
- data/lib/seven_api/resources/status.rb +20 -20
- data/lib/seven_api/resources/subaccounts.rb +65 -65
- data/lib/seven_api/resources/validate_for_voice.rb +20 -20
- data/lib/seven_api/resources/voice.rb +29 -20
- data/lib/seven_api/sms.rb +9 -9
- data/lib/seven_api/subaccounts.rb +55 -55
- data/lib/seven_api/util.rb +68 -68
- data/lib/seven_api/version.rb +5 -5
- data/lib/seven_api.rb +6 -6
- data/release.sh +4 -4
- data/seven_api.gemspec +0 -0
- data/spec/EnvKeyStore.rb +14 -14
- data/spec/matchers.rb +22 -22
- data/spec/seven_api/analytics_spec.rb +49 -49
- data/spec/seven_api/balance_spec.rb +18 -18
- data/spec/seven_api/client_spec.rb +15 -15
- data/spec/seven_api/contacts_spec.rb +100 -100
- data/spec/seven_api/groups_spec.rb +74 -74
- data/spec/seven_api/hooks_spec.rb +108 -108
- data/spec/seven_api/instance_spec.rb +22 -22
- data/spec/seven_api/journal_spec.rb +86 -86
- data/spec/seven_api/lookup_spec.rb +197 -197
- data/spec/seven_api/numbers_spec.rb +135 -135
- data/spec/seven_api/pricing_spec.rb +76 -76
- data/spec/seven_api/rcs_spec.rb +0 -0
- data/spec/seven_api/sms_spec.rb +103 -103
- data/spec/seven_api/subaccounts_spec.rb +121 -121
- data/spec/seven_api/validate_for_voice_spec.rb +19 -19
- data/spec/seven_api/voice_spec.rb +51 -51
- data/spec/seven_api_spec.rb +9 -9
- metadata +4 -6
@@ -1,51 +1,51 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'seven_api/resources/voice'
|
5
|
-
|
6
|
-
RSpec.describe SevenApi, 'voice' do
|
7
|
-
def assert_response(response)
|
8
|
-
expect(response).to be_a(String)
|
9
|
-
|
10
|
-
code, id, cost = response.split("\n")
|
11
|
-
|
12
|
-
expect(Integer(code)).to be_an_instance_of(Integer)
|
13
|
-
expect(id.to_f).to be_an_instance_of(Float) if id != ''
|
14
|
-
expect(cost.to_f).to be_an_instance_of(Float)
|
15
|
-
end
|
16
|
-
|
17
|
-
def request(text, extra_params = {})
|
18
|
-
stub = <<~TEXT
|
19
|
-
301
|
20
|
-
|
21
|
-
0.1
|
22
|
-
TEXT
|
23
|
-
|
24
|
-
params = {
|
25
|
-
from: nil,
|
26
|
-
text: text,
|
27
|
-
to: '491716992343'
|
28
|
-
}.merge(extra_params)
|
29
|
-
|
30
|
-
helper = Helper.new(SevenApi::Resources::Voice)
|
31
|
-
assert_response(helper.request(helper.resource.method(:send), stub, params))
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'calls a number with text input' do
|
35
|
-
request('Your glasses are ready for pickup.')
|
36
|
-
end
|
37
|
-
|
38
|
-
it 'calls a number with xml input' do
|
39
|
-
text = <<~XML
|
40
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
41
|
-
<Response>
|
42
|
-
<Say voice="woman" language="en-EN">
|
43
|
-
Your glasses are ready for pickup.
|
44
|
-
</Say>
|
45
|
-
<Record maxlength="20" />
|
46
|
-
</Response>
|
47
|
-
XML
|
48
|
-
|
49
|
-
request(text, { xml: true })
|
50
|
-
end
|
51
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
require 'seven_api/resources/voice'
|
5
|
+
|
6
|
+
RSpec.describe SevenApi, 'voice' do
|
7
|
+
def assert_response(response)
|
8
|
+
expect(response).to be_a(String)
|
9
|
+
|
10
|
+
code, id, cost = response.split("\n")
|
11
|
+
|
12
|
+
expect(Integer(code)).to be_an_instance_of(Integer)
|
13
|
+
expect(id.to_f).to be_an_instance_of(Float) if id != ''
|
14
|
+
expect(cost.to_f).to be_an_instance_of(Float)
|
15
|
+
end
|
16
|
+
|
17
|
+
def request(text, extra_params = {})
|
18
|
+
stub = <<~TEXT
|
19
|
+
301
|
20
|
+
|
21
|
+
0.1
|
22
|
+
TEXT
|
23
|
+
|
24
|
+
params = {
|
25
|
+
from: nil,
|
26
|
+
text: text,
|
27
|
+
to: '491716992343'
|
28
|
+
}.merge(extra_params)
|
29
|
+
|
30
|
+
helper = Helper.new(SevenApi::Resources::Voice)
|
31
|
+
assert_response(helper.request(helper.resource.method(:send), stub, params))
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'calls a number with text input' do
|
35
|
+
request('Your glasses are ready for pickup.')
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'calls a number with xml input' do
|
39
|
+
text = <<~XML
|
40
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
41
|
+
<Response>
|
42
|
+
<Say voice="woman" language="en-EN">
|
43
|
+
Your glasses are ready for pickup.
|
44
|
+
</Say>
|
45
|
+
<Record maxlength="20" />
|
46
|
+
</Response>
|
47
|
+
XML
|
48
|
+
|
49
|
+
request(text, { xml: true })
|
50
|
+
end
|
51
|
+
end
|
data/spec/seven_api_spec.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe SevenApi do
|
6
|
-
it 'has a version number' do
|
7
|
-
expect(SevenApi::VERSION).not_to be nil
|
8
|
-
end
|
9
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe SevenApi do
|
6
|
+
it 'has a version number' do
|
7
|
+
expect(SevenApi::VERSION).not_to be nil
|
8
|
+
end
|
9
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seven_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- seven communications GmbH & Co. KG
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: bundler
|
@@ -131,6 +130,7 @@ files:
|
|
131
130
|
- doc/js/jquery.js
|
132
131
|
- doc/method_list.html
|
133
132
|
- doc/top-level-namespace.html
|
133
|
+
- document.sh
|
134
134
|
- lib/seven_api.rb
|
135
135
|
- lib/seven_api/client.rb
|
136
136
|
- lib/seven_api/contacts.rb
|
@@ -187,7 +187,6 @@ homepage: https://github.com/seven-io/ruby-client
|
|
187
187
|
licenses:
|
188
188
|
- MIT
|
189
189
|
metadata: {}
|
190
|
-
post_install_message:
|
191
190
|
rdoc_options: []
|
192
191
|
require_paths:
|
193
192
|
- lib
|
@@ -202,8 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
202
201
|
- !ruby/object:Gem::Version
|
203
202
|
version: '0'
|
204
203
|
requirements: []
|
205
|
-
rubygems_version: 3.
|
206
|
-
signing_key:
|
204
|
+
rubygems_version: 3.6.7
|
207
205
|
specification_version: 4
|
208
206
|
summary: Official API Client for the seven SMS Gateway
|
209
207
|
test_files:
|