portatext 1.3.1 → 1.4.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.
- checksums.yaml +4 -4
- data/lib/portatext/command/api/campaigns.rb +16 -0
- data/lib/portatext/command/api/services.rb +37 -0
- data/lib/portatext/command/api/settings.rb +5 -2
- data/lib/portatext/command/api/sms.rb +4 -0
- data/lib/portatext.rb +1 -1
- data/portatext.gemspec +1 -1
- metadata +3 -3
- data/lib/portatext/command/api/sms_campaign.rb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63784633a089b44c9a5255016f19fbfb06d94df7
|
4
|
+
data.tar.gz: eb24e9015bb78a150231c53e0e2d0a718e1523ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f209e1bf0c09563c528a817556e7a307826f24df441ac308a3e6a127aa3a960f5bf58c4c75a9c3a4da0c9be31eb7e043f0b42f58cdeace5bd845a11452e233aa
|
7
|
+
data.tar.gz: aa504008c39ded3ea3cde9783d80bdf37f1802417fe2be4ce405dfefc6dfc043bb47599f17a71c3bfe80857228ae8fb7c362b69e23c2afc09291ebac7048f66c
|
@@ -32,6 +32,22 @@ module PortaText
|
|
32
32
|
set :file, file
|
33
33
|
end
|
34
34
|
|
35
|
+
def use_template(template_id, variables)
|
36
|
+
set :settings, template_id: template_id, variables: variables
|
37
|
+
end
|
38
|
+
|
39
|
+
def text(text)
|
40
|
+
set :settings, text: text
|
41
|
+
end
|
42
|
+
|
43
|
+
def from_service(service_id)
|
44
|
+
set :service_id, service_id
|
45
|
+
end
|
46
|
+
|
47
|
+
def all_subscribers
|
48
|
+
set :all_subscribers, true
|
49
|
+
end
|
50
|
+
|
35
51
|
# rubocop:disable Metrics/MethodLength
|
36
52
|
def endpoint(_method)
|
37
53
|
unless @args[:file].nil?
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module PortaText
|
2
|
+
module Command
|
3
|
+
module Api
|
4
|
+
# The sms_services endpoint.
|
5
|
+
# https://github.com/PortaText/docs/wiki/REST-API#api_sms_services
|
6
|
+
#
|
7
|
+
# Author:: Marcelo Gornstein (mailto:marcelog@portatext.com)
|
8
|
+
# Copyright:: Copyright (c) 2015 PortaText
|
9
|
+
# License:: Apache-2.0
|
10
|
+
class Services < Base
|
11
|
+
def id(id)
|
12
|
+
set :id, id
|
13
|
+
end
|
14
|
+
|
15
|
+
def save_to(file)
|
16
|
+
set :accept_file, file
|
17
|
+
end
|
18
|
+
|
19
|
+
def page(page)
|
20
|
+
set :page, page
|
21
|
+
end
|
22
|
+
|
23
|
+
def endpoint(_method)
|
24
|
+
base = 'sms_services'
|
25
|
+
return base if @args[:id].nil?
|
26
|
+
id = @args[:id]
|
27
|
+
@args.delete :id
|
28
|
+
page = @args[:page]
|
29
|
+
@args.delete :page
|
30
|
+
return "#{base}/#{id}/subscribers" unless @args[:accept_file].nil?
|
31
|
+
return "#{base}/#{id}/subscribers?page=#{page}" unless page.nil?
|
32
|
+
"#{base}/#{id}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -24,9 +24,8 @@ module PortaText
|
|
24
24
|
set :email_on_inbound_sms, email
|
25
25
|
end
|
26
26
|
|
27
|
-
def enable_autorecharges(when_credit,
|
27
|
+
def enable_autorecharges(when_credit, total)
|
28
28
|
set :autorecharge_enabled, true
|
29
|
-
set :autorecharge_card_id, card_id
|
30
29
|
set :autorecharge_total, total
|
31
30
|
set :autorecharge_when_credit, when_credit
|
32
31
|
end
|
@@ -35,6 +34,10 @@ module PortaText
|
|
35
34
|
set :autorecharge_enabled, false
|
36
35
|
end
|
37
36
|
|
37
|
+
def default_credit_card(card_id)
|
38
|
+
set :default_card_id, card_id
|
39
|
+
end
|
40
|
+
|
38
41
|
def endpoint(_method)
|
39
42
|
'me/settings'
|
40
43
|
end
|
data/lib/portatext.rb
CHANGED
@@ -31,11 +31,11 @@ require_relative 'portatext/command/api/contact_lists'
|
|
31
31
|
require_relative 'portatext/command/api/did_search'
|
32
32
|
require_relative 'portatext/command/api/blacklist'
|
33
33
|
require_relative 'portatext/command/api/campaigns'
|
34
|
-
require_relative 'portatext/command/api/sms_campaign'
|
35
34
|
require_relative 'portatext/command/api/campaign_lifecycle'
|
36
35
|
require_relative 'portatext/command/api/my_password'
|
37
36
|
require_relative 'portatext/command/api/contacts'
|
38
37
|
require_relative 'portatext/command/api/number_verify'
|
38
|
+
require_relative 'portatext/command/api/services'
|
39
39
|
|
40
40
|
# The PortaText namespace.
|
41
41
|
#
|
data/portatext.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: portatext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PortaText
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|
@@ -155,9 +155,9 @@ files:
|
|
155
155
|
- lib/portatext/command/api/my_password.rb
|
156
156
|
- lib/portatext/command/api/number_verify.rb
|
157
157
|
- lib/portatext/command/api/recharge.rb
|
158
|
+
- lib/portatext/command/api/services.rb
|
158
159
|
- lib/portatext/command/api/settings.rb
|
159
160
|
- lib/portatext/command/api/sms.rb
|
160
|
-
- lib/portatext/command/api/sms_campaign.rb
|
161
161
|
- lib/portatext/command/api/tariffs.rb
|
162
162
|
- lib/portatext/command/api/templates.rb
|
163
163
|
- lib/portatext/command/api/timezones.rb
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module PortaText
|
2
|
-
module Command
|
3
|
-
module Api
|
4
|
-
# An SMS campaign.
|
5
|
-
# https://github.com/PortaText/docs/wiki/REST-API#api_campaigns
|
6
|
-
#
|
7
|
-
# Author:: Marcelo Gornstein (mailto:marcelog@portatext.com)
|
8
|
-
# Copyright:: Copyright (c) 2015 PortaText
|
9
|
-
# License:: Apache-2.0
|
10
|
-
class SmsCampaign < Campaigns
|
11
|
-
def use_template(template_id, variables)
|
12
|
-
set :settings, template_id: template_id, variables: variables
|
13
|
-
end
|
14
|
-
|
15
|
-
def text(text)
|
16
|
-
set :settings, text: text
|
17
|
-
end
|
18
|
-
|
19
|
-
def initialize
|
20
|
-
super
|
21
|
-
set :type, 'sms'
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|