Class: TMS::VoiceMessage

Inherits:
Object
  • Object
show all
Includes:
InstanceResource
Defined in:
lib/tms_client/resource/voice_message.rb

Overview

A VoiceMessage is used to create and send a voice message to a collection of Recipient objects. The recipients are called and the provided play_url is played to them. Accepted sound formats include wav, mp3, and aiff.

Examples:

voice_message = client.voice_messages.build(:play_url => "http://example.com/emergency_weather.mp3")
voice_message.recipients.build(:phone => "+18001002000")
voice_message.post
voice_message.get

Instance Attribute Summary collapse

Attributes included from InstanceResource

#response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from InstanceResource

included

Instance Attribute Details

#completed_atObject (readonly)

Returns the value of attribute completed_at.



1
2
3
# File 'lib/tms_client/resource/voice_message.rb', line 1

def completed_at
  @completed_at
end

#created_atObject (readonly)

Returns the value of attribute created_at.



1
2
3
# File 'lib/tms_client/resource/voice_message.rb', line 1

def created_at
  @created_at
end

#play_urlString

The url to the sound file to be played back to the call recipients

Returns:

  • (String)

    the current value of play_url



15
16
17
# File 'lib/tms_client/resource/voice_message.rb', line 15

def play_url
  @play_url
end

#say_textString

A string to be read (and repeated on request) to the call recipients.

Returns:

  • (String)

    the current value of say_text



15
16
17
# File 'lib/tms_client/resource/voice_message.rb', line 15

def say_text
  @say_text
end

#statusObject (readonly)

Returns the value of attribute status.



1
2
3
# File 'lib/tms_client/resource/voice_message.rb', line 1

def status
  @status
end

Class Method Details

.to_sObject



36
37
38
# File 'lib/tms_client/resource/voice_message.rb', line 36

def self.to_s
  "VoiceMessage"
end

Instance Method Details

#failedObject

A CollectionResource of Recipients that failed



34
# File 'lib/tms_client/resource/voice_message.rb', line 34

collection_attribute :failed, 'Recipients'

#recipientsObject

A CollectionResource of Recipient objects



26
# File 'lib/tms_client/resource/voice_message.rb', line 26

collection_attributes :recipients

#sentObject

A CollectionResource of Recipients that sent successfully



30
# File 'lib/tms_client/resource/voice_message.rb', line 30

collection_attribute :sent, 'Recipients'