Class: Telerivet::Route

Inherits:
Entity
  • Object
show all
Defined in:
lib/telerivet/route.rb

Overview

Represents a custom route that can be used to send messages via one or more basic routes (phones).

Custom Routes were formerly referred to simply as "Routes" within Telerivet. API methods, parameters, and properties related to Custom Routes continue to use the term "Route" to maintain backwards compatibility.

Fields:

- id (string, max 34 characters)
  * Telerivet's internal ID for the route
  * Read-only

- name
  * The name of the route
  * Updatable via API

- vars (Hash)
  * Custom variables stored for this route. Variable names may be up to 32 characters in
      length and can contain the characters a-z, A-Z, 0-9, and _.
      Values may be strings, numbers, or boolean (true/false).
      String values may be up to 4096 bytes in length when encoded as UTF-8.
      Up to 100 variables are supported per object.
      Setting a variable to null will delete the variable.
  * Updatable via API

- url
  * URL to this route in the Telerivet web app
  * Read-only

- project_id
  * ID of the project this route belongs to
  * Read-only

- actions (array of RoutingAction)
  * Array of routing action objects. Allowed action types: `use_phone`, `condition`.
  * Updatable via API

Instance Method Summary collapse

Methods inherited from Entity

#get, #initialize, #load, #set, #set_data, #to_s, #vars

Constructor Details

This class inherits a constructor from Telerivet::Entity

Instance Method Details

#actionsObject



72
73
74
# File 'lib/telerivet/route.rb', line 72

def actions
    get('actions')
end

#actions=(value) ⇒ Object



76
77
78
# File 'lib/telerivet/route.rb', line 76

def actions=(value)
    set('actions', value)
end

#get_base_api_pathObject



80
81
82
# File 'lib/telerivet/route.rb', line 80

def get_base_api_path()
    "/projects/#{get('project_id')}/routes/#{get('id')}"
end

#idObject



52
53
54
# File 'lib/telerivet/route.rb', line 52

def id
    get('id')
end

#nameObject



56
57
58
# File 'lib/telerivet/route.rb', line 56

def name
    get('name')
end

#name=(value) ⇒ Object



60
61
62
# File 'lib/telerivet/route.rb', line 60

def name=(value)
    set('name', value)
end

#project_idObject



68
69
70
# File 'lib/telerivet/route.rb', line 68

def project_id
    get('project_id')
end

#saveObject

Saves any fields, custom variables, or routing actions that have changed for this custom route.



48
49
50
# File 'lib/telerivet/route.rb', line 48

def save()
    super
end

#urlObject



64
65
66
# File 'lib/telerivet/route.rb', line 64

def url
    get('url')
end