tms_client 0.4.1 → 0.5.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.
- data/Gemfile +3 -2
- data/README.md +43 -1
- data/Rakefile +16 -4
- data/bin/autospec +16 -0
- data/bin/htmldiff +16 -0
- data/bin/ldiff +16 -0
- data/bin/rake +16 -0
- data/bin/redcarpet +16 -0
- data/bin/rspec +16 -0
- data/bin/tt +16 -0
- data/bin/yard +16 -0
- data/bin/yardoc +16 -0
- data/bin/yri +16 -0
- data/lib/tms_client/client.rb +4 -2
- data/lib/tms_client/errors.rb +1 -1
- data/lib/tms_client/instance_resource.rb +5 -2
- data/lib/tms_client/resource/collections.rb +20 -0
- data/lib/tms_client/resource/email_message.rb +16 -8
- data/lib/tms_client/resource/ipaws_acknowledgement.rb +9 -0
- data/lib/tms_client/resource/ipaws_alert.rb +38 -0
- data/lib/tms_client/resource/ipaws_category.rb +7 -0
- data/lib/tms_client/resource/ipaws_cog_profile.rb +29 -0
- data/lib/tms_client/resource/ipaws_event_code.rb +7 -0
- data/lib/tms_client/resource/ipaws_nwem_area.rb +18 -0
- data/lib/tms_client/resource/ipaws_nwem_authorization.rb +9 -0
- data/lib/tms_client/resource/ipaws_nwem_auxilary_data.rb +8 -0
- data/lib/tms_client/resource/ipaws_response_type.rb +7 -0
- data/lib/tms_client/resource/ipaws_static_resource.rb +8 -0
- data/lib/tms_client/resource/sms_message.rb +14 -5
- data/lib/tms_client/resource/voice_message.rb +16 -7
- data/lib/tms_client/version.rb +1 -1
- data/lib/tms_client.rb +10 -2
- data/spec/client_spec.rb +6 -2
- data/spec/email_message_spec.rb +25 -9
- data/spec/instance_resource_spec.rb +19 -2
- data/spec/ipaws_acknowledgement_spec.rb +16 -0
- data/spec/ipaws_alerts_spec.rb +192 -0
- data/spec/ipaws_cog_profile_spec.rb +75 -0
- data/spec/ipaws_event_codes_spec.rb +35 -0
- data/spec/ipaws_nwem_areas_spec.rb +58 -0
- data/spec/ipaws_nwem_authorization_spec.rb +16 -0
- data/spec/mail/delivery_method_spec.rb +1 -1
- data/spec/sms_message_spec.rb +9 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/voice_message_spec.rb +63 -0
- data/spec/voice_messages_spec.rb +21 -0
- data/tms_client.gemspec +3 -1
- metadata +66 -7
- checksums.yaml +0 -15
data/Gemfile
CHANGED
@@ -2,11 +2,12 @@ source "https://rubygems.org"
|
|
2
2
|
gemspec
|
3
3
|
|
4
4
|
group :development, :test do
|
5
|
-
gem
|
5
|
+
gem "appraisal"
|
6
|
+
gem 'rspec', '~> 2.99'
|
7
|
+
gem 'rspec-its'
|
6
8
|
gem 'rake'
|
7
9
|
gem 'redcarpet', :platform => :ruby
|
8
10
|
gem 'yard'
|
9
|
-
gem 'guard-rspec'
|
10
11
|
gem 'mail'
|
11
12
|
gem 'rubygems-tasks', :git => 'https://github.com/postmodern/rubygems-tasks.git', :platform => :ruby
|
12
13
|
end
|
data/README.md
CHANGED
@@ -80,6 +80,37 @@ message.href # "/messages/voice/87"
|
|
80
80
|
message.get # <TMS::VoiceMessage href=/messages/voice/87 attributes={...}>
|
81
81
|
```
|
82
82
|
|
83
|
+
### Obtaining IPAWS Ack ###
|
84
|
+
```ruby
|
85
|
+
client.ipaws_acknowledgement.get
|
86
|
+
client.ipaws_acknowledgement.ACK # "PONG"
|
87
|
+
```
|
88
|
+
|
89
|
+
### Obtaining IPAWS COG Profile
|
90
|
+
```ruby
|
91
|
+
client.ipaws_cog_profile.get
|
92
|
+
client.ipaws_cog_profile.attributes # {:cogid=>"120082", :name=>"GovDelivery" ... }
|
93
|
+
```
|
94
|
+
|
95
|
+
### Determining NWEM COG Authorization ###
|
96
|
+
```ruby
|
97
|
+
client.ipaws_nwem_authorization.get
|
98
|
+
client.ipaws_nwem_authorization.cogid # true
|
99
|
+
```
|
100
|
+
|
101
|
+
### Obtaining NWEM Auxilary Data (Authorized areas) ###
|
102
|
+
```ruby
|
103
|
+
client.ipaws_nwem_areas.get
|
104
|
+
client.ipaws_nwem_areas.collection.first.countyFipsCd # "51013"
|
105
|
+
```
|
106
|
+
|
107
|
+
### Sending an IPAWS Alert ###
|
108
|
+
```ruby
|
109
|
+
alert = client.ipaws_alerts.build({ identifier: "CAP12-TEST-12345", sender: 'test@open.com' ...})
|
110
|
+
alert.post # true
|
111
|
+
alert.ipaws_response # { "identifier"=>"CAP12-TEST-1397743203", "statuses"=> [{"CHANNELNAME"=>"CAPEXCH" ... }]}
|
112
|
+
```
|
113
|
+
|
83
114
|
Metrics
|
84
115
|
-------
|
85
116
|
### Viewing recipients that clicked on a link in an email
|
@@ -209,9 +240,20 @@ rake yard
|
|
209
240
|
```
|
210
241
|
The generated documentation will be placed in the `doc` folder.
|
211
242
|
|
243
|
+
|
244
|
+
Running Tests
|
245
|
+
-------------
|
246
|
+
```ruby
|
247
|
+
appraisal install
|
248
|
+
# optionally specify an activesupport version to test against (2/3/4), e.g.
|
249
|
+
# appraisal 4 rake ## for ruby 2.1.2
|
250
|
+
appraisal rake
|
251
|
+
```
|
252
|
+
|
253
|
+
|
212
254
|
Compatibility
|
213
255
|
-------------
|
214
|
-
This project is tested and compatible with
|
256
|
+
This project is tested and compatible with MRI 1.9.3, JRuby 1.7.12, and MRI 2.1.2.
|
215
257
|
|
216
258
|
License
|
217
259
|
-------
|
data/Rakefile
CHANGED
@@ -1,13 +1,25 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "bundler/setup"
|
1
3
|
require 'rspec/core/rake_task'
|
2
|
-
|
3
|
-
require 'rubygems/tasks
|
4
|
+
unless defined?(JRUBY_VERSION)
|
5
|
+
require 'rubygems/tasks'
|
6
|
+
require 'rubygems/tasks/scm'
|
7
|
+
Gem::Tasks.new
|
8
|
+
end
|
4
9
|
require 'yard'
|
5
10
|
|
6
11
|
YARD::Rake::YardocTask.new do |t|
|
7
|
-
t.files
|
12
|
+
t.files = ['lib/**/*.rb']
|
8
13
|
end
|
9
14
|
|
10
15
|
RSpec::Core::RakeTask.new(:spec)
|
11
|
-
|
16
|
+
|
17
|
+
|
18
|
+
desc "Run spec with all supported versions of active support"
|
19
|
+
task :compatibility_spec do
|
20
|
+
[2, 3, 4].each do |n|
|
21
|
+
puts `ACTIVE_SUPPORT_VERSION='~> #{n}' bundle ; rake spec`
|
22
|
+
end
|
23
|
+
end
|
12
24
|
|
13
25
|
task :default => :spec
|
data/bin/autospec
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'autospec' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('rspec-core', 'autospec')
|
data/bin/htmldiff
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'htmldiff' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('diff-lcs', 'htmldiff')
|
data/bin/ldiff
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'ldiff' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('diff-lcs', 'ldiff')
|
data/bin/rake
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'rake' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('rake', 'rake')
|
data/bin/redcarpet
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'redcarpet' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('redcarpet', 'redcarpet')
|
data/bin/rspec
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'rspec' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('rspec-core', 'rspec')
|
data/bin/tt
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'tt' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('treetop', 'tt')
|
data/bin/yard
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'yard' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('yard', 'yard')
|
data/bin/yardoc
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'yardoc' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('yard', 'yardoc')
|
data/bin/yri
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'yri' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('yard', 'yri')
|
data/lib/tms_client/client.rb
CHANGED
@@ -19,10 +19,12 @@ class TMS::Client
|
|
19
19
|
# client = TMS::Client.new("auth_token", {
|
20
20
|
# :api_root => "https://tms.govdelivery.com",
|
21
21
|
# :logger => Logger.new(STDOUT)})
|
22
|
-
#
|
22
|
+
# client = TMS::Client.new("auth_token", {
|
23
|
+
# api_root: "https://tms.govdelivery.com",
|
24
|
+
# logger: false})
|
23
25
|
def initialize(auth_token, options = DEFAULTS)
|
24
26
|
@api_root = options[:api_root]
|
25
|
-
@logger = options
|
27
|
+
@logger = options.fetch(:logger, setup_logging(options[:debug]))
|
26
28
|
connect!(auth_token, options.except(:api_root, :logger, :debug))
|
27
29
|
discover!
|
28
30
|
end
|
data/lib/tms_client/errors.rb
CHANGED
@@ -98,13 +98,16 @@ module TMS::InstanceResource
|
|
98
98
|
def initialize(client, href=nil, attrs=nil)
|
99
99
|
super(client, href)
|
100
100
|
@attributes = {}
|
101
|
-
attrs ||= self.client.get(href).body if href
|
102
101
|
set_attributes_from_hash(attrs) if attrs
|
103
102
|
end
|
104
103
|
|
104
|
+
def attributes
|
105
|
+
@attributes
|
106
|
+
end
|
107
|
+
|
105
108
|
def get
|
106
109
|
raise TMS::Errors::InvalidGet if self.new_record?
|
107
|
-
process_response(client.get(self.href), :get)
|
110
|
+
process_response(client.get(self.href), :get) && self
|
108
111
|
end
|
109
112
|
|
110
113
|
def post
|
@@ -63,3 +63,23 @@ end
|
|
63
63
|
class TMS::CommandActions
|
64
64
|
include TMS::CollectionResource
|
65
65
|
end
|
66
|
+
|
67
|
+
class TMS::IpawsEventCodes
|
68
|
+
include TMS::CollectionResource
|
69
|
+
end
|
70
|
+
|
71
|
+
class TMS::IpawsCategories
|
72
|
+
include TMS::CollectionResource
|
73
|
+
end
|
74
|
+
|
75
|
+
class TMS::IpawsResponseTypes
|
76
|
+
include TMS::CollectionResource
|
77
|
+
end
|
78
|
+
|
79
|
+
class TMS::IpawsAlerts
|
80
|
+
include TMS::CollectionResource
|
81
|
+
end
|
82
|
+
|
83
|
+
class TMS::IpawsNwemAreas
|
84
|
+
include TMS::CollectionResource
|
85
|
+
end
|
@@ -1,21 +1,21 @@
|
|
1
1
|
module TMS #:nodoc:
|
2
2
|
# An EmailMessage is used to create and send a email to a collection of EmailRecipient
|
3
3
|
# objects. Certain metrics are available after the email is sent, including
|
4
|
-
# the collection of recipients who clicked or opened the email.
|
4
|
+
# the collection of recipients who clicked or opened the email.
|
5
5
|
#
|
6
|
-
# @attr from_name [String] The name of the person or entity sending the email.
|
7
|
-
# @attr from_email [String] Optional - the email address of the person or entity sending the email. Must be configured in TMS beforehand. Defaults to the account default from address.
|
6
|
+
# @attr from_name [String] The name of the person or entity sending the email.
|
7
|
+
# @attr from_email [String] Optional - the email address of the person or entity sending the email. Must be configured in TMS beforehand. Defaults to the account default from address.
|
8
8
|
# @attr reply_to [String] Optional - the email address used for the Reply-To header of this email. Defaults to the account default reply_to_email address (which itself defaults to the default from address if not specified).
|
9
9
|
# @attr errors_to [String] Optional - the email address used for the Errors-To header of this email. Defaults to the account default bounce_email address (which itself defaults to the default from address if not specified).
|
10
10
|
# @attr subject [String] The subject of the email.
|
11
11
|
# @attr body [String] The body of the email.
|
12
12
|
# @attr open_tracking_enabled [Boolean] Optional - Whether to track opens on this message. Defaults to true.
|
13
13
|
# @attr click_tracking_enabled [Boolean] Optional - Whether to track clicks on links in this message. Defaults to true.
|
14
|
-
# @attr macros [Hash] Optional - A dictionary of key/value pairs to use in the subject and body as default macros.
|
14
|
+
# @attr macros [Hash] Optional - A dictionary of key/value pairs to use in the subject and body as default macros.
|
15
15
|
# The message-level macros are used when a recipient has no value for a given macro key.
|
16
|
-
#
|
16
|
+
#
|
17
17
|
# @example Sending a message
|
18
|
-
# email_message = client.email_messages.build(:subject => "Great news!",
|
18
|
+
# email_message = client.email_messages.build(:subject => "Great news!",
|
19
19
|
# :body => "You win! <a href='http://example.com/'>click here</a>.",
|
20
20
|
# :from_email => 'foo@example.com')
|
21
21
|
# email_message.recipients.build(:email => "john@example.com")
|
@@ -34,7 +34,7 @@ module TMS #:nodoc:
|
|
34
34
|
# email_message.opened.collection # => [<#EmailRecipient>,...]
|
35
35
|
#
|
36
36
|
# @example Using macros
|
37
|
-
# email_message = client.email_messages.build(:subject => "Hello [[user]]",
|
37
|
+
# email_message = client.email_messages.build(:subject => "Hello [[user]]",
|
38
38
|
# :body => "Your name is [[name]]",
|
39
39
|
# :macros => {:user => "Sir or Madam", :name => "unknown"})
|
40
40
|
# email_message.recipients.build(:email => "jeff@example.com", :macros => {:user => "jexample", :name => "Jeff Example"})
|
@@ -69,5 +69,13 @@ module TMS #:nodoc:
|
|
69
69
|
##
|
70
70
|
# A CollectionResource of EmailRecipients that clicked on at least one link in this email
|
71
71
|
collection_attribute :clicked, 'EmailRecipients'
|
72
|
+
|
73
|
+
##
|
74
|
+
# A CollectionResource of EmailRecipients that sent successfully
|
75
|
+
collection_attribute :sent, 'EmailRecipients'
|
76
|
+
|
77
|
+
##
|
78
|
+
# A CollectionResource of EmailRecipients that failed, not neccessarily bounced
|
79
|
+
collection_attribute :failed, 'EmailRecipients'
|
72
80
|
end
|
73
|
-
end
|
81
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module TMS
|
2
|
+
class IpawsAlert
|
3
|
+
|
4
|
+
include InstanceResource
|
5
|
+
|
6
|
+
writeable_attributes(
|
7
|
+
:identifier,
|
8
|
+
:sender,
|
9
|
+
:sent,
|
10
|
+
:status,
|
11
|
+
:msgType,
|
12
|
+
:source,
|
13
|
+
:scope,
|
14
|
+
:restriction,
|
15
|
+
:addresses,
|
16
|
+
:code,
|
17
|
+
:note,
|
18
|
+
:references,
|
19
|
+
:incidents,
|
20
|
+
:info
|
21
|
+
)
|
22
|
+
|
23
|
+
attr_accessor :ipaws_response
|
24
|
+
|
25
|
+
def process_response(response, method)
|
26
|
+
# All IPAWS responses are 200, even if there are errors.
|
27
|
+
# Capture the IPAWS response on a 200 response to POST (create alert)
|
28
|
+
if method == :post && response.status == 200
|
29
|
+
self.ipaws_response = response.body
|
30
|
+
true
|
31
|
+
else
|
32
|
+
self.ipaws_response = nil
|
33
|
+
super
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module TMS
|
2
|
+
class IpawsCogProfile
|
3
|
+
|
4
|
+
include InstanceResource
|
5
|
+
|
6
|
+
readonly_attributes(
|
7
|
+
:cogid,
|
8
|
+
:name,
|
9
|
+
:description,
|
10
|
+
:categoryName,
|
11
|
+
:organizationName,
|
12
|
+
:cogEnabled,
|
13
|
+
:caeAuthorized,
|
14
|
+
:caeCmasAuthorized,
|
15
|
+
:eanAuthorized,
|
16
|
+
:allEventCode,
|
17
|
+
:allGeoCode,
|
18
|
+
:easAuthorized,
|
19
|
+
:cmasAlertAuthorized,
|
20
|
+
:cmamTextAuthorized,
|
21
|
+
:publicAlertAuthorized,
|
22
|
+
:broadcastAuthorized,
|
23
|
+
:email,
|
24
|
+
:eventCodes,
|
25
|
+
:geoCodes
|
26
|
+
)
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module TMS #:nodoc:
|
2
2
|
# An SMSMessage is used to create and send a text message to a collection of Recipient
|
3
3
|
# objects.
|
4
|
-
#
|
5
4
|
#
|
6
|
-
#
|
7
|
-
#
|
5
|
+
#
|
6
|
+
# @attr body [String] The content of the SMS. This field will be truncated to 160 characters.
|
7
|
+
#
|
8
8
|
# @example
|
9
9
|
# sms = client.sms_messages.build(:body => "Hello")
|
10
10
|
# sms.recipients.build(:phone => "+18001002000")
|
@@ -12,7 +12,7 @@ module TMS #:nodoc:
|
|
12
12
|
# sms.get
|
13
13
|
class SmsMessage
|
14
14
|
include InstanceResource
|
15
|
-
|
15
|
+
|
16
16
|
# @!parse attr_accessor :body
|
17
17
|
writeable_attributes :body
|
18
18
|
|
@@ -22,5 +22,14 @@ module TMS #:nodoc:
|
|
22
22
|
##
|
23
23
|
# A CollectionResource of Recipient objects
|
24
24
|
collection_attributes :recipients
|
25
|
+
|
26
|
+
##
|
27
|
+
# A CollectionResource of Recipients that sent successfully
|
28
|
+
collection_attribute :sent, 'Recipients'
|
29
|
+
|
30
|
+
##
|
31
|
+
# A CollectionResource of Recipients that failed
|
32
|
+
collection_attribute :failed, 'Recipients'
|
33
|
+
|
25
34
|
end
|
26
|
-
end
|
35
|
+
end
|
@@ -1,11 +1,12 @@
|
|
1
1
|
module TMS #:nodoc:
|
2
2
|
# A VoiceMessage is used to create and send a voice message to a collection of Recipient
|
3
|
-
# objects. The recipients are called and the provided +play_url+ is
|
4
|
-
# played to them. Accepted sound formats include +wav+, +mp3+, and +aiff+.
|
5
|
-
#
|
3
|
+
# objects. The recipients are called and the provided +play_url+ is
|
4
|
+
# played to them. Accepted sound formats include +wav+, +mp3+, and +aiff+.
|
5
|
+
#
|
6
6
|
#
|
7
7
|
# @attr play_url [String] The url to the sound file to be played back to the call recipients
|
8
|
-
#
|
8
|
+
# @attr say_text [String] A string to be read (and repeated on request) to the call recipients.
|
9
|
+
#
|
9
10
|
# @example
|
10
11
|
# voice_message = client.voice_messages.build(:play_url => "http://example.com/emergency_weather.mp3")
|
11
12
|
# voice_message.recipients.build(:phone => "+18001002000")
|
@@ -14,8 +15,8 @@ module TMS #:nodoc:
|
|
14
15
|
class VoiceMessage
|
15
16
|
include InstanceResource
|
16
17
|
|
17
|
-
# @!parse attr_accessor :play_url
|
18
|
-
writeable_attributes :play_url
|
18
|
+
# @!parse attr_accessor :play_url, :play_url
|
19
|
+
writeable_attributes :play_url, :say_text
|
19
20
|
|
20
21
|
# @!parse attr_reader :created_at, :completed_at, :status
|
21
22
|
readonly_attributes :created_at, :completed_at, :status
|
@@ -24,8 +25,16 @@ module TMS #:nodoc:
|
|
24
25
|
# A CollectionResource of Recipient objects
|
25
26
|
collection_attributes :recipients
|
26
27
|
|
28
|
+
##
|
29
|
+
# A CollectionResource of Recipients that sent successfully
|
30
|
+
collection_attribute :sent, 'Recipients'
|
31
|
+
|
32
|
+
##
|
33
|
+
# A CollectionResource of Recipients that failed
|
34
|
+
collection_attribute :failed, 'Recipients'
|
35
|
+
|
27
36
|
def self.to_s
|
28
37
|
"VoiceMessage"
|
29
38
|
end
|
30
39
|
end
|
31
|
-
end
|
40
|
+
end
|
data/lib/tms_client/version.rb
CHANGED