telerivet 1.1.7 → 1.2.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/lib/telerivet.rb +34 -31
- data/lib/telerivet/broadcast.rb +275 -0
- data/lib/telerivet/contact.rb +3 -0
- data/lib/telerivet/contactservicestate.rb +7 -7
- data/lib/telerivet/datarow.rb +7 -7
- data/lib/telerivet/datatable.rb +8 -9
- data/lib/telerivet/group.rb +7 -7
- data/lib/telerivet/label.rb +10 -7
- data/lib/telerivet/message.rb +36 -1
- data/lib/telerivet/mobilemoneyreceipt.rb +7 -7
- data/lib/telerivet/phone.rb +10 -7
- data/lib/telerivet/project.rb +195 -31
- data/lib/telerivet/route.rb +7 -7
- data/lib/telerivet/scheduledmessage.rb +35 -8
- data/lib/telerivet/service.rb +41 -41
- metadata +4 -3
data/lib/telerivet/route.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
module Telerivet
|
3
|
-
|
1
|
+
|
2
|
+
module Telerivet
|
3
|
+
|
4
4
|
#
|
5
5
|
# Represents a custom route that can be used to send messages via one or more Phones.
|
6
6
|
#
|
@@ -24,7 +24,7 @@ module Telerivet
|
|
24
24
|
# * ID of the project this route belongs to
|
25
25
|
# * Read-only
|
26
26
|
#
|
27
|
-
class Route < Entity
|
27
|
+
class Route < Entity
|
28
28
|
#
|
29
29
|
# Saves any fields or custom variables that have changed for this route.
|
30
30
|
#
|
@@ -52,6 +52,6 @@ class Route < Entity
|
|
52
52
|
"/projects/#{get('project_id')}/routes/#{get('id')}"
|
53
53
|
end
|
54
54
|
|
55
|
-
end
|
56
|
-
|
57
|
-
end
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
module Telerivet
|
3
|
-
|
1
|
+
|
2
|
+
module Telerivet
|
3
|
+
|
4
4
|
#
|
5
5
|
# Represents a scheduled message within Telerivet.
|
6
6
|
#
|
@@ -45,9 +45,24 @@ module Telerivet
|
|
45
45
|
# call flow)
|
46
46
|
# * Read-only
|
47
47
|
#
|
48
|
+
# - audio_url
|
49
|
+
# * For voice calls, the URL of an MP3 file to play when the contact answers the call
|
50
|
+
# * Read-only
|
51
|
+
#
|
52
|
+
# - tts_lang
|
53
|
+
# * For voice calls, the language of the text-to-speech voice
|
54
|
+
# * Allowed values: en-US, en-GB, en-GB-WLS, en-AU, en-IN, da-DK, nl-NL, fr-FR, fr-CA,
|
55
|
+
# de-DE, is-IS, it-IT, pl-PL, pt-BR, pt-PT, ru-RU, es-ES, es-US, sv-SE
|
56
|
+
# * Read-only
|
57
|
+
#
|
58
|
+
# - tts_voice
|
59
|
+
# * For voice calls, the text-to-speech voice
|
60
|
+
# * Allowed values: female, male
|
61
|
+
# * Read-only
|
62
|
+
#
|
48
63
|
# - message_type
|
49
64
|
# * Type of scheduled message
|
50
|
-
# * Allowed values: sms, ussd
|
65
|
+
# * Allowed values: sms, ussd, call
|
51
66
|
# * Read-only
|
52
67
|
#
|
53
68
|
# - time_created (UNIX timestamp)
|
@@ -94,7 +109,7 @@ module Telerivet
|
|
94
109
|
# * ID of the project this scheduled message belongs to
|
95
110
|
# * Read-only
|
96
111
|
#
|
97
|
-
class ScheduledMessage < Entity
|
112
|
+
class ScheduledMessage < Entity
|
98
113
|
#
|
99
114
|
# Saves any fields or custom variables that have changed for this scheduled message.
|
100
115
|
#
|
@@ -145,6 +160,18 @@ class ScheduledMessage < Entity
|
|
145
160
|
get('service_id')
|
146
161
|
end
|
147
162
|
|
163
|
+
def audio_url
|
164
|
+
get('audio_url')
|
165
|
+
end
|
166
|
+
|
167
|
+
def tts_lang
|
168
|
+
get('tts_lang')
|
169
|
+
end
|
170
|
+
|
171
|
+
def tts_voice
|
172
|
+
get('tts_voice')
|
173
|
+
end
|
174
|
+
|
148
175
|
def message_type
|
149
176
|
get('message_type')
|
150
177
|
end
|
@@ -189,6 +216,6 @@ class ScheduledMessage < Entity
|
|
189
216
|
"/projects/#{get('project_id')}/scheduled/#{get('id')}"
|
190
217
|
end
|
191
218
|
|
192
|
-
end
|
193
|
-
|
194
|
-
end
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|
data/lib/telerivet/service.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
module Telerivet
|
2
|
-
|
1
|
+
module Telerivet
|
2
|
+
|
3
3
|
#
|
4
4
|
# Represents an automated service on Telerivet, for example a poll, auto-reply, webhook
|
5
5
|
# service, etc.
|
@@ -74,8 +74,8 @@ module Telerivet
|
|
74
74
|
# question), and "question_type" (either "multiple_choice", "missed_call", or "open").
|
75
75
|
# * Read-only
|
76
76
|
#
|
77
|
-
class Service < Entity
|
78
|
-
|
77
|
+
class Service < Entity
|
78
|
+
|
79
79
|
#
|
80
80
|
# Manually invoke this service in a particular context.
|
81
81
|
#
|
@@ -94,7 +94,7 @@ class Service < Entity
|
|
94
94
|
#
|
95
95
|
# - context
|
96
96
|
# * The name of the context in which this service is invoked
|
97
|
-
# * Allowed values: message, contact, project
|
97
|
+
# * Allowed values: message, call, contact, project
|
98
98
|
# * Required
|
99
99
|
#
|
100
100
|
# - event
|
@@ -112,24 +112,24 @@ class Service < Entity
|
|
112
112
|
# Returns:
|
113
113
|
# object
|
114
114
|
#
|
115
|
-
def invoke(options)
|
116
|
-
invoke_result = @api.do_request('POST', get_base_api_path() + '/invoke', options)
|
117
|
-
|
118
|
-
if invoke_result.has_key?('sent_messages')
|
119
|
-
require_relative 'message'
|
120
|
-
|
121
|
-
sent_messages = []
|
122
|
-
|
123
|
-
invoke_result['sent_messages'].each { |sent_message_data|
|
124
|
-
sent_messages.push(Message.new(@api, sent_message_data))
|
125
|
-
}
|
126
|
-
|
127
|
-
invoke_result['sent_messages'] = sent_messages
|
128
|
-
end
|
129
|
-
|
130
|
-
return invoke_result
|
131
|
-
end
|
132
|
-
|
115
|
+
def invoke(options)
|
116
|
+
invoke_result = @api.do_request('POST', get_base_api_path() + '/invoke', options)
|
117
|
+
|
118
|
+
if invoke_result.has_key?('sent_messages')
|
119
|
+
require_relative 'message'
|
120
|
+
|
121
|
+
sent_messages = []
|
122
|
+
|
123
|
+
invoke_result['sent_messages'].each { |sent_message_data|
|
124
|
+
sent_messages.push(Message.new(@api, sent_message_data))
|
125
|
+
}
|
126
|
+
|
127
|
+
invoke_result['sent_messages'] = sent_messages
|
128
|
+
end
|
129
|
+
|
130
|
+
return invoke_result
|
131
|
+
end
|
132
|
+
|
133
133
|
#
|
134
134
|
# Gets the current state for a particular contact for this service.
|
135
135
|
#
|
@@ -145,11 +145,11 @@ class Service < Entity
|
|
145
145
|
# Returns:
|
146
146
|
# Telerivet::ContactServiceState
|
147
147
|
#
|
148
|
-
def get_contact_state(contact)
|
149
|
-
require_relative 'contactservicestate'
|
150
|
-
ContactServiceState.new(@api, @api.do_request('GET', get_base_api_path() + '/states/' + contact.id))
|
151
|
-
end
|
152
|
-
|
148
|
+
def get_contact_state(contact)
|
149
|
+
require_relative 'contactservicestate'
|
150
|
+
ContactServiceState.new(@api, @api.do_request('GET', get_base_api_path() + '/states/' + contact.id))
|
151
|
+
end
|
152
|
+
|
153
153
|
#
|
154
154
|
# Initializes or updates the current state for a particular contact for the given service. If
|
155
155
|
# the state id is null, the contact's state will be reset.
|
@@ -173,11 +173,11 @@ class Service < Entity
|
|
173
173
|
# Returns:
|
174
174
|
# Telerivet::ContactServiceState
|
175
175
|
#
|
176
|
-
def set_contact_state(contact, options)
|
177
|
-
require_relative 'contactservicestate'
|
178
|
-
ContactServiceState.new(@api, @api.do_request('POST', get_base_api_path() + '/states/' + contact.id, options))
|
179
|
-
end
|
180
|
-
|
176
|
+
def set_contact_state(contact, options)
|
177
|
+
require_relative 'contactservicestate'
|
178
|
+
ContactServiceState.new(@api, @api.do_request('POST', get_base_api_path() + '/states/' + contact.id, options))
|
179
|
+
end
|
180
|
+
|
181
181
|
#
|
182
182
|
# Resets the current state for a particular contact for the given service.
|
183
183
|
#
|
@@ -189,11 +189,11 @@ class Service < Entity
|
|
189
189
|
# Returns:
|
190
190
|
# Telerivet::ContactServiceState
|
191
191
|
#
|
192
|
-
def reset_contact_state(contact)
|
193
|
-
require_relative 'contactservicestate'
|
194
|
-
ContactServiceState.new(@api, @api.do_request('DELETE', get_base_api_path() + '/states/' + contact.id))
|
195
|
-
end
|
196
|
-
|
192
|
+
def reset_contact_state(contact)
|
193
|
+
require_relative 'contactservicestate'
|
194
|
+
ContactServiceState.new(@api, @api.do_request('DELETE', get_base_api_path() + '/states/' + contact.id))
|
195
|
+
end
|
196
|
+
|
197
197
|
#
|
198
198
|
# Query the current states of contacts for this service.
|
199
199
|
#
|
@@ -304,6 +304,6 @@ class Service < Entity
|
|
304
304
|
"/projects/#{get('project_id')}/services/#{get('id')}"
|
305
305
|
end
|
306
306
|
|
307
|
-
end
|
308
|
-
|
309
|
-
end
|
307
|
+
end
|
308
|
+
|
309
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: telerivet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesse Young
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby client library for Telerivet REST API
|
14
14
|
email: support@telerivet.com
|
@@ -19,6 +19,7 @@ files:
|
|
19
19
|
- lib/cacert.pem
|
20
20
|
- lib/telerivet.rb
|
21
21
|
- lib/telerivet/apicursor.rb
|
22
|
+
- lib/telerivet/broadcast.rb
|
22
23
|
- lib/telerivet/contact.rb
|
23
24
|
- lib/telerivet/contactservicestate.rb
|
24
25
|
- lib/telerivet/datarow.rb
|
@@ -53,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
54
|
version: '0'
|
54
55
|
requirements: []
|
55
56
|
rubyforge_project:
|
56
|
-
rubygems_version: 2.
|
57
|
+
rubygems_version: 2.6.7
|
57
58
|
signing_key:
|
58
59
|
specification_version: 4
|
59
60
|
summary: Telerivet REST API Client
|