Class: Twilio::REST::Client
- Inherits:
-
Object
- Object
- Twilio::REST::Client
- Defined in:
- lib/twilio-ruby/rest/client.rb
Overview
A client for accessing the Twilio API.
Constant Summary collapse
- @@default_region =
'us1'
Instance Attribute Summary collapse
-
#account_sid ⇒ Object
Returns the value of attribute account_sid.
-
#auth_token ⇒ Object
Returns the value of attribute auth_token.
-
#edge ⇒ Object
Returns the value of attribute edge.
-
#http_client ⇒ Object
Returns the value of attribute http_client.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#password ⇒ Object
Returns the value of attribute password.
-
#region ⇒ Object
Returns the value of attribute region.
-
#user_agent_extensions ⇒ Object
Returns the value of attribute user_agent_extensions.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#accounts ⇒ Object
Access the Accounts Twilio Domain.
- #addresses(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::AddressInstance, Twilio::REST::Api::V2010::AccountContext::AddressList
-
#api ⇒ Object
Access the Api Twilio Domain.
- #applications(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::ApplicationInstance, Twilio::REST::Api::V2010::AccountContext::ApplicationList
- #authorized_connect_apps(connect_app_sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::AuthorizedConnectAppInstance, Twilio::REST::Api::V2010::AccountContext::AuthorizedConnectAppList
-
#autopilot ⇒ Object
Access the Autopilot Twilio Domain.
- #available_phone_numbers(country_code = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryInstance, Twilio::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryList
- #balance ⇒ Twilio::REST::Api::V2010::AccountContext::BalanceInstance
-
#build_uri(uri) ⇒ Object
Build the final request uri.
-
#bulkexports ⇒ Object
Access the Bulkexports Twilio Domain.
- #calls(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::CallInstance, Twilio::REST::Api::V2010::AccountContext::CallList
-
#chat ⇒ Object
Access the Chat Twilio Domain.
- #conferences(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::ConferenceInstance, Twilio::REST::Api::V2010::AccountContext::ConferenceList
- #connect_apps(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::ConnectAppInstance, Twilio::REST::Api::V2010::AccountContext::ConnectAppList
-
#content ⇒ Object
Access the Content Twilio Domain.
-
#conversations ⇒ Object
Access the Conversations Twilio Domain.
-
#events ⇒ Object
Access the Events Twilio Domain.
-
#flex_api ⇒ Object
Access the FlexApi Twilio Domain.
-
#frontline_api ⇒ Object
Access the FrontlineApi Twilio Domain.
- #incoming_phone_numbers(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::IncomingPhoneNumberInstance, Twilio::REST::Api::V2010::AccountContext::IncomingPhoneNumberList
-
#initialize(username = nil, password = nil, account_sid = nil, region = nil, http_client = nil, logger = nil, user_agent_extensions = nil) ⇒ Client
constructor
Initializes the Twilio Client.
-
#insights ⇒ Object
Access the Insights Twilio Domain.
-
#ip_messaging ⇒ Object
Access the IpMessaging Twilio Domain.
- #keys(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::KeyInstance, Twilio::REST::Api::V2010::AccountContext::KeyList
-
#lookups ⇒ Object
Access the Lookups Twilio Domain.
-
#media ⇒ Object
Access the Media Twilio Domain.
- #messages(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::MessageInstance, Twilio::REST::Api::V2010::AccountContext::MessageList
-
#messaging ⇒ Object
Access the Messaging Twilio Domain.
-
#microvisor ⇒ Object
Access the Microvisor Twilio Domain.
-
#monitor ⇒ Object
Access the Monitor Twilio Domain.
- #new_keys ⇒ Twilio::REST::Api::V2010::AccountContext::NewKeyInstance
- #new_signing_keys ⇒ Twilio::REST::Api::V2010::AccountContext::NewSigningKeyInstance
- #notifications(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::NotificationInstance, Twilio::REST::Api::V2010::AccountContext::NotificationList
-
#notify ⇒ Object
Access the Notify Twilio Domain.
-
#numbers ⇒ Object
Access the Numbers Twilio Domain.
-
#oauth ⇒ Object
Access the Oauth Twilio Domain.
- #outgoing_caller_ids(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::OutgoingCallerIdInstance, Twilio::REST::Api::V2010::AccountContext::OutgoingCallerIdList
-
#preview ⇒ Object
Access the Preview Twilio Domain.
-
#pricing ⇒ Object
Access the Pricing Twilio Domain.
-
#proxy ⇒ Object
Access the Proxy Twilio Domain.
- #queues(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::QueueInstance, Twilio::REST::Api::V2010::AccountContext::QueueList
- #recordings(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::RecordingInstance, Twilio::REST::Api::V2010::AccountContext::RecordingList
-
#request(host, port, method, uri, params = {}, data = {}, headers = {}, auth = nil, timeout = nil) ⇒ Object
Makes a request to the Twilio API using the configured http client Authentication information is automatically added if none is provided.
-
#routes ⇒ Object
Access the Routes Twilio Domain.
-
#serverless ⇒ Object
Access the Serverless Twilio Domain.
- #short_codes(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::ShortCodeInstance, Twilio::REST::Api::V2010::AccountContext::ShortCodeList
- #signing_keys(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::SigningKeyInstance, Twilio::REST::Api::V2010::AccountContext::SigningKeyList
- #sip ⇒ Twilio::REST::Api::V2010::AccountContext::SipInstance
-
#studio ⇒ Object
Access the Studio Twilio Domain.
-
#supersim ⇒ Object
Access the Supersim Twilio Domain.
-
#sync ⇒ Object
Access the Sync Twilio Domain.
-
#taskrouter ⇒ Object
Access the Taskrouter Twilio Domain.
-
#to_s ⇒ Object
Provide a user friendly representation.
- #tokens ⇒ Twilio::REST::Api::V2010::AccountContext::TokenInstance
- #transcriptions(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::TranscriptionInstance, Twilio::REST::Api::V2010::AccountContext::TranscriptionList
-
#trunking ⇒ Object
Access the Trunking Twilio Domain.
-
#trusthub ⇒ Object
Access the Trusthub Twilio Domain.
- #usage ⇒ Twilio::REST::Api::V2010::AccountContext::UsageInstance
-
#validate_ssl_certificate ⇒ Object
Validate the new SSL certificate for the Twilio API.
- #validation_requests ⇒ Twilio::REST::Api::V2010::AccountContext::ValidationRequestInstance
-
#verify ⇒ Object
Access the Verify Twilio Domain.
-
#video ⇒ Object
Access the Video Twilio Domain.
-
#voice ⇒ Object
Access the Voice Twilio Domain.
-
#wireless ⇒ Object
Access the Wireless Twilio Domain.
Constructor Details
#initialize(username = nil, password = nil, account_sid = nil, region = nil, http_client = nil, logger = nil, user_agent_extensions = nil) ⇒ Client
Initializes the Twilio Client
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/twilio-ruby/rest/client.rb', line 20 def initialize(username=nil, password=nil, account_sid=nil, region=nil, http_client=nil, logger=nil, user_agent_extensions=nil) @username = username || Twilio.account_sid @password = password || Twilio.auth_token @region = region || Twilio.region @edge = Twilio.edge @account_sid = account_sid || @username @auth_token = @password @auth = [@username, @password] @http_client = http_client || Twilio.http_client || Twilio::HTTP::Client.new @logger = logger || Twilio.logger @user_agent_extensions = user_agent_extensions || [] # Domains @accounts = nil @api = nil @autopilot = nil @chat = nil @content = nil @conversations = nil @events = nil @flex_api = nil @frontline_api = nil @insights = nil @ip_messaging = nil @lookups = nil @media = nil @messaging = nil @monitor = nil @notify = nil @numbers = nil @oauth = nil @preview = nil @pricing = nil @proxy = nil @routes = nil @serverless = nil @studio = nil @sync = nil @taskrouter = nil @trunking = nil @trusthub = nil @verify = nil @video = nil @voice = nil @wireless = nil @supersim = nil @bulkexports = nil @microvisor = nil end |
Instance Attribute Details
#account_sid ⇒ Object
Returns the value of attribute account_sid.
16 17 18 |
# File 'lib/twilio-ruby/rest/client.rb', line 16 def account_sid @account_sid end |
#auth_token ⇒ Object
Returns the value of attribute auth_token.
16 17 18 |
# File 'lib/twilio-ruby/rest/client.rb', line 16 def auth_token @auth_token end |
#edge ⇒ Object
Returns the value of attribute edge.
16 17 18 |
# File 'lib/twilio-ruby/rest/client.rb', line 16 def edge @edge end |
#http_client ⇒ Object
Returns the value of attribute http_client.
16 17 18 |
# File 'lib/twilio-ruby/rest/client.rb', line 16 def http_client @http_client end |
#logger ⇒ Object
Returns the value of attribute logger.
16 17 18 |
# File 'lib/twilio-ruby/rest/client.rb', line 16 def logger @logger end |
#password ⇒ Object
Returns the value of attribute password.
16 17 18 |
# File 'lib/twilio-ruby/rest/client.rb', line 16 def password @password end |
#region ⇒ Object
Returns the value of attribute region.
16 17 18 |
# File 'lib/twilio-ruby/rest/client.rb', line 16 def region @region end |
#user_agent_extensions ⇒ Object
Returns the value of attribute user_agent_extensions.
16 17 18 |
# File 'lib/twilio-ruby/rest/client.rb', line 16 def user_agent_extensions @user_agent_extensions end |
#username ⇒ Object
Returns the value of attribute username.
16 17 18 |
# File 'lib/twilio-ruby/rest/client.rb', line 16 def username @username end |
Instance Method Details
#accounts ⇒ Object
Access the Accounts Twilio Domain
170 171 172 |
# File 'lib/twilio-ruby/rest/client.rb', line 170 def accounts @accounts ||= Accounts.new self end |
#addresses(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::AddressInstance, Twilio::REST::Api::V2010::AccountContext::AddressList
383 384 385 |
# File 'lib/twilio-ruby/rest/client.rb', line 383 def addresses(sid=:unset) self.api.v2010.account.addresses(sid) end |
#api ⇒ Object
Access the Api Twilio Domain
176 177 178 |
# File 'lib/twilio-ruby/rest/client.rb', line 176 def api @api ||= Api.new self end |
#applications(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::ApplicationInstance, Twilio::REST::Api::V2010::AccountContext::ApplicationList
392 393 394 |
# File 'lib/twilio-ruby/rest/client.rb', line 392 def applications(sid=:unset) self.api.v2010.account.applications(sid) end |
#authorized_connect_apps(connect_app_sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::AuthorizedConnectAppInstance, Twilio::REST::Api::V2010::AccountContext::AuthorizedConnectAppList
400 401 402 |
# File 'lib/twilio-ruby/rest/client.rb', line 400 def (connect_app_sid=:unset) self.api.v2010.account.(connect_app_sid) end |
#autopilot ⇒ Object
Access the Autopilot Twilio Domain
182 183 184 |
# File 'lib/twilio-ruby/rest/client.rb', line 182 def autopilot @autopilot ||= Autopilot.new self end |
#available_phone_numbers(country_code = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryInstance, Twilio::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryList
410 411 412 |
# File 'lib/twilio-ruby/rest/client.rb', line 410 def available_phone_numbers(country_code=:unset) self.api.v2010.account.available_phone_numbers(country_code) end |
#balance ⇒ Twilio::REST::Api::V2010::AccountContext::BalanceInstance
416 417 418 |
# File 'lib/twilio-ruby/rest/client.rb', line 416 def balance self.api.v2010.account.balance end |
#build_uri(uri) ⇒ Object
Build the final request uri
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/twilio-ruby/rest/client.rb', line 132 def build_uri(uri) if @region.nil? and @edge.nil? return uri end parsed_url = URI(uri) pieces = parsed_url.host.split('.') product = pieces[0] domain = pieces[-2, 2] new_edge = @edge new_region = @region if pieces.length == 4 new_region ||= pieces[1] elsif pieces.length == 5 new_edge ||= pieces[1] new_region ||= pieces[2] end if !new_edge.nil? && new_region.nil? new_region = @@default_region end parsed_url.host = [product, new_edge, new_region, domain].select {|item| !item.nil?}.join('.') parsed_url.to_s end |
#bulkexports ⇒ Object
Access the Bulkexports Twilio Domain
368 369 370 |
# File 'lib/twilio-ruby/rest/client.rb', line 368 def bulkexports @bulkexports ||= Bulkexports.new self end |
#calls(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::CallInstance, Twilio::REST::Api::V2010::AccountContext::CallList
425 426 427 |
# File 'lib/twilio-ruby/rest/client.rb', line 425 def calls(sid=:unset) self.api.v2010.account.calls(sid) end |
#chat ⇒ Object
Access the Chat Twilio Domain
188 189 190 |
# File 'lib/twilio-ruby/rest/client.rb', line 188 def chat @chat ||= Chat.new self end |
#conferences(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::ConferenceInstance, Twilio::REST::Api::V2010::AccountContext::ConferenceList
434 435 436 |
# File 'lib/twilio-ruby/rest/client.rb', line 434 def conferences(sid=:unset) self.api.v2010.account.conferences(sid) end |
#connect_apps(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::ConnectAppInstance, Twilio::REST::Api::V2010::AccountContext::ConnectAppList
443 444 445 |
# File 'lib/twilio-ruby/rest/client.rb', line 443 def connect_apps(sid=:unset) self.api.v2010.account.connect_apps(sid) end |
#content ⇒ Object
Access the Content Twilio Domain
194 195 196 |
# File 'lib/twilio-ruby/rest/client.rb', line 194 def content @content ||= Content.new self end |
#conversations ⇒ Object
Access the Conversations Twilio Domain
200 201 202 |
# File 'lib/twilio-ruby/rest/client.rb', line 200 def conversations @conversations ||= Conversations.new self end |
#events ⇒ Object
Access the Events Twilio Domain
206 207 208 |
# File 'lib/twilio-ruby/rest/client.rb', line 206 def events @events ||= Events.new self end |
#flex_api ⇒ Object
Access the FlexApi Twilio Domain
212 213 214 |
# File 'lib/twilio-ruby/rest/client.rb', line 212 def flex_api @flex_api ||= FlexApi.new self end |
#frontline_api ⇒ Object
Access the FrontlineApi Twilio Domain
218 219 220 |
# File 'lib/twilio-ruby/rest/client.rb', line 218 def frontline_api @frontline_api ||= FrontlineApi.new self end |
#incoming_phone_numbers(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::IncomingPhoneNumberInstance, Twilio::REST::Api::V2010::AccountContext::IncomingPhoneNumberList
452 453 454 |
# File 'lib/twilio-ruby/rest/client.rb', line 452 def incoming_phone_numbers(sid=:unset) self.api.v2010.account.incoming_phone_numbers(sid) end |
#insights ⇒ Object
Access the Insights Twilio Domain
224 225 226 |
# File 'lib/twilio-ruby/rest/client.rb', line 224 def insights @insights ||= Insights.new self end |
#ip_messaging ⇒ Object
Access the IpMessaging Twilio Domain
230 231 232 |
# File 'lib/twilio-ruby/rest/client.rb', line 230 def ip_messaging @ip_messaging ||= IpMessaging.new self end |
#keys(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::KeyInstance, Twilio::REST::Api::V2010::AccountContext::KeyList
461 462 463 |
# File 'lib/twilio-ruby/rest/client.rb', line 461 def keys(sid=:unset) self.api.v2010.account.keys(sid) end |
#lookups ⇒ Object
Access the Lookups Twilio Domain
236 237 238 |
# File 'lib/twilio-ruby/rest/client.rb', line 236 def lookups @lookups ||= Lookups.new self end |
#media ⇒ Object
Access the Media Twilio Domain
242 243 244 |
# File 'lib/twilio-ruby/rest/client.rb', line 242 def media @media ||= Media.new self end |
#messages(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::MessageInstance, Twilio::REST::Api::V2010::AccountContext::MessageList
470 471 472 |
# File 'lib/twilio-ruby/rest/client.rb', line 470 def (sid=:unset) self.api.v2010.account.(sid) end |
#messaging ⇒ Object
Access the Messaging Twilio Domain
248 249 250 |
# File 'lib/twilio-ruby/rest/client.rb', line 248 def messaging @messaging ||= Messaging.new self end |
#microvisor ⇒ Object
Access the Microvisor Twilio Domain
374 375 376 |
# File 'lib/twilio-ruby/rest/client.rb', line 374 def microvisor @microvisor ||= Microvisor.new self end |
#monitor ⇒ Object
Access the Monitor Twilio Domain
254 255 256 |
# File 'lib/twilio-ruby/rest/client.rb', line 254 def monitor @monitor ||= Monitor.new self end |
#new_keys ⇒ Twilio::REST::Api::V2010::AccountContext::NewKeyInstance
476 477 478 |
# File 'lib/twilio-ruby/rest/client.rb', line 476 def new_keys self.api.v2010.account.new_keys end |
#new_signing_keys ⇒ Twilio::REST::Api::V2010::AccountContext::NewSigningKeyInstance
482 483 484 |
# File 'lib/twilio-ruby/rest/client.rb', line 482 def new_signing_keys self.api.v2010.account.new_signing_keys end |
#notifications(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::NotificationInstance, Twilio::REST::Api::V2010::AccountContext::NotificationList
491 492 493 |
# File 'lib/twilio-ruby/rest/client.rb', line 491 def notifications(sid=:unset) self.api.v2010.account.notifications(sid) end |
#notify ⇒ Object
Access the Notify Twilio Domain
260 261 262 |
# File 'lib/twilio-ruby/rest/client.rb', line 260 def notify @notify ||= Notify.new self end |
#numbers ⇒ Object
Access the Numbers Twilio Domain
266 267 268 |
# File 'lib/twilio-ruby/rest/client.rb', line 266 def numbers @numbers ||= Numbers.new self end |
#oauth ⇒ Object
Access the Oauth Twilio Domain
272 273 274 |
# File 'lib/twilio-ruby/rest/client.rb', line 272 def oauth @oauth ||= Oauth.new self end |
#outgoing_caller_ids(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::OutgoingCallerIdInstance, Twilio::REST::Api::V2010::AccountContext::OutgoingCallerIdList
500 501 502 |
# File 'lib/twilio-ruby/rest/client.rb', line 500 def outgoing_caller_ids(sid=:unset) self.api.v2010.account.outgoing_caller_ids(sid) end |
#preview ⇒ Object
Access the Preview Twilio Domain
278 279 280 |
# File 'lib/twilio-ruby/rest/client.rb', line 278 def preview @preview ||= Preview.new self end |
#pricing ⇒ Object
Access the Pricing Twilio Domain
284 285 286 |
# File 'lib/twilio-ruby/rest/client.rb', line 284 def pricing @pricing ||= Pricing.new self end |
#proxy ⇒ Object
Access the Proxy Twilio Domain
290 291 292 |
# File 'lib/twilio-ruby/rest/client.rb', line 290 def proxy @proxy ||= Proxy.new self end |
#queues(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::QueueInstance, Twilio::REST::Api::V2010::AccountContext::QueueList
509 510 511 |
# File 'lib/twilio-ruby/rest/client.rb', line 509 def queues(sid=:unset) self.api.v2010.account.queues(sid) end |
#recordings(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::RecordingInstance, Twilio::REST::Api::V2010::AccountContext::RecordingList
518 519 520 |
# File 'lib/twilio-ruby/rest/client.rb', line 518 def recordings(sid=:unset) self.api.v2010.account.recordings(sid) end |
#request(host, port, method, uri, params = {}, data = {}, headers = {}, auth = nil, timeout = nil) ⇒ Object
Makes a request to the Twilio API using the configured http client Authentication information is automatically added if none is provided
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/twilio-ruby/rest/client.rb', line 73 def request(host, port, method, uri, params={}, data={}, headers={}, auth=nil, timeout=nil) auth ||= @auth ruby_config = RbConfig::CONFIG headers['User-Agent'] = "twilio-ruby/#{Twilio::VERSION} (#{ruby_config["host_os"]} #{ruby_config["host_cpu"]}) Ruby/#{RUBY_VERSION}" headers['Accept-Charset'] = 'utf-8' user_agent_extensions.each { |extension| headers['User-Agent'] += " #{extension}" } if method == 'POST' && !headers['Content-Type'] headers['Content-Type'] = 'application/x-www-form-urlencoded' end unless headers['Accept'] headers['Accept'] = 'application/json' end uri = build_uri(uri) if @logger @logger.debug("--BEGIN Twilio API Request--") @logger.debug("Request Method: <#{method}>") headers.each do |key, value| unless key.downcase == 'authorization' @logger.debug("#{key}:#{value}") end end url = URI(uri) @logger.debug("Host:#{url.host}") @logger.debug("Path:#{url.path}") @logger.debug("Query:#{url.query}") @logger.debug("Request Params:#{params}") end response = @http_client.request( host, port, method, uri, params, data, headers, auth, timeout ) if @logger @logger.debug("Response Status Code:#{response.status_code}") @logger.debug("Response Headers:#{response.headers}") @logger.debug("--END TWILIO API REQUEST--") end response end |
#routes ⇒ Object
Access the Routes Twilio Domain
296 297 298 |
# File 'lib/twilio-ruby/rest/client.rb', line 296 def routes @routes ||= Routes.new self end |
#serverless ⇒ Object
Access the Serverless Twilio Domain
302 303 304 |
# File 'lib/twilio-ruby/rest/client.rb', line 302 def serverless @serverless ||= Serverless.new self end |
#short_codes(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::ShortCodeInstance, Twilio::REST::Api::V2010::AccountContext::ShortCodeList
541 542 543 |
# File 'lib/twilio-ruby/rest/client.rb', line 541 def short_codes(sid=:unset) self.api.v2010.account.short_codes(sid) end |
#signing_keys(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::SigningKeyInstance, Twilio::REST::Api::V2010::AccountContext::SigningKeyList
526 527 528 |
# File 'lib/twilio-ruby/rest/client.rb', line 526 def signing_keys(sid=:unset) self.api.v2010.account.signing_keys(sid) end |
#sip ⇒ Twilio::REST::Api::V2010::AccountContext::SipInstance
532 533 534 |
# File 'lib/twilio-ruby/rest/client.rb', line 532 def sip self.api.v2010.account.sip end |
#studio ⇒ Object
Access the Studio Twilio Domain
308 309 310 |
# File 'lib/twilio-ruby/rest/client.rb', line 308 def studio @studio ||= Studio.new self end |
#supersim ⇒ Object
Access the Supersim Twilio Domain
362 363 364 |
# File 'lib/twilio-ruby/rest/client.rb', line 362 def supersim @supersim ||= Supersim.new self end |
#sync ⇒ Object
Access the Sync Twilio Domain
314 315 316 |
# File 'lib/twilio-ruby/rest/client.rb', line 314 def sync @sync ||= Sync.new self end |
#taskrouter ⇒ Object
Access the Taskrouter Twilio Domain
320 321 322 |
# File 'lib/twilio-ruby/rest/client.rb', line 320 def taskrouter @taskrouter ||= Taskrouter.new self end |
#to_s ⇒ Object
Provide a user friendly representation
574 575 576 |
# File 'lib/twilio-ruby/rest/client.rb', line 574 def to_s "#<Twilio::REST::Client #{@account_sid}>" end |
#tokens ⇒ Twilio::REST::Api::V2010::AccountContext::TokenInstance
547 548 549 |
# File 'lib/twilio-ruby/rest/client.rb', line 547 def tokens self.api.v2010.account.tokens end |
#transcriptions(sid = :unset) ⇒ Twilio::REST::Api::V2010::AccountContext::TranscriptionInstance, Twilio::REST::Api::V2010::AccountContext::TranscriptionList
556 557 558 |
# File 'lib/twilio-ruby/rest/client.rb', line 556 def transcriptions(sid=:unset) self.api.v2010.account.transcriptions(sid) end |
#trunking ⇒ Object
Access the Trunking Twilio Domain
326 327 328 |
# File 'lib/twilio-ruby/rest/client.rb', line 326 def trunking @trunking ||= Trunking.new self end |
#trusthub ⇒ Object
Access the Trusthub Twilio Domain
332 333 334 |
# File 'lib/twilio-ruby/rest/client.rb', line 332 def trusthub @trusthub ||= Trusthub.new self end |
#usage ⇒ Twilio::REST::Api::V2010::AccountContext::UsageInstance
562 563 564 |
# File 'lib/twilio-ruby/rest/client.rb', line 562 def usage self.api.v2010.account.usage end |
#validate_ssl_certificate ⇒ Object
Validate the new SSL certificate for the Twilio API
161 162 163 164 165 166 |
# File 'lib/twilio-ruby/rest/client.rb', line 161 def validate_ssl_certificate response = request('api.twilio.com', '8443', 'GET', 'https://api.twilio.com:8443/.json') if response.status_code < 200 || response.status_code >= 300 raise RestError.new 'Unexpected response from certificate endpoint', response end end |
#validation_requests ⇒ Twilio::REST::Api::V2010::AccountContext::ValidationRequestInstance
568 569 570 |
# File 'lib/twilio-ruby/rest/client.rb', line 568 def validation_requests self.api.v2010.account.validation_requests end |
#verify ⇒ Object
Access the Verify Twilio Domain
338 339 340 |
# File 'lib/twilio-ruby/rest/client.rb', line 338 def verify @verify ||= Verify.new self end |
#video ⇒ Object
Access the Video Twilio Domain
344 345 346 |
# File 'lib/twilio-ruby/rest/client.rb', line 344 def video @video ||= Video.new self end |
#voice ⇒ Object
Access the Voice Twilio Domain
350 351 352 |
# File 'lib/twilio-ruby/rest/client.rb', line 350 def voice @voice ||= Voice.new self end |
#wireless ⇒ Object
Access the Wireless Twilio Domain
356 357 358 |
# File 'lib/twilio-ruby/rest/client.rb', line 356 def wireless @wireless ||= Wireless.new self end |