Class: Gupshup::REST::Client
- Inherits:
-
Object
- Object
- Gupshup::REST::Client
- Defined in:
- lib/gupshup-rb/rest/client.rb
Overview
A client for accessing the Gupshup API.
Constant Summary collapse
- @@default_region =
'us1'
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#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.
-
#src_name ⇒ Object
Returns the value of attribute src_name.
-
#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 Gupshup Domain.
- #addresses(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::AddressInstance, Gupshup::REST::Api::V2010::AccountContext::AddressList
-
#api ⇒ Object
Access the Api Gupshup Domain.
- #applications(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::ApplicationInstance, Gupshup::REST::Api::V2010::AccountContext::ApplicationList
- #authorized_connect_apps(connect_app_sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::AuthorizedConnectAppInstance, Gupshup::REST::Api::V2010::AccountContext::AuthorizedConnectAppList
-
#autopilot ⇒ Object
Access the Autopilot Gupshup Domain.
- #available_phone_numbers(country_code = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryInstance, Gupshup::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryList
- #balance ⇒ Gupshup::REST::Api::V2010::AccountContext::BalanceInstance
-
#build_uri(uri) ⇒ Object
Build the final request uri.
-
#bulkexports ⇒ Object
Access the Bulkexports Gupshup Domain.
- #calls(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::CallInstance, Gupshup::REST::Api::V2010::AccountContext::CallList
-
#chat ⇒ Object
Access the Chat Gupshup Domain.
- #conferences(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::ConferenceInstance, Gupshup::REST::Api::V2010::AccountContext::ConferenceList
- #connect_apps(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::ConnectAppInstance, Gupshup::REST::Api::V2010::AccountContext::ConnectAppList
-
#content ⇒ Object
Access the Content Gupshup Domain.
-
#conversations ⇒ Object
Access the Conversations Gupshup Domain.
-
#events ⇒ Object
Access the Events Gupshup Domain.
-
#flex_api ⇒ Object
Access the FlexApi Gupshup Domain.
-
#frontline_api ⇒ Object
Access the FrontlineApi Gupshup Domain.
- #incoming_phone_numbers(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::IncomingPhoneNumberInstance, Gupshup::REST::Api::V2010::AccountContext::IncomingPhoneNumberList
-
#initialize(username = nil, password = nil, src_name = nil, region = nil, http_client = nil, logger = nil, user_agent_extensions = nil) ⇒ Client
constructor
Initializes the Gupshup Client.
-
#insights ⇒ Object
Access the Insights Gupshup Domain.
-
#ip_messaging ⇒ Object
Access the IpMessaging Gupshup Domain.
- #keys(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::KeyInstance, Gupshup::REST::Api::V2010::AccountContext::KeyList
-
#lookups ⇒ Object
Access the Lookups Gupshup Domain.
-
#media ⇒ Object
Access the Media Gupshup Domain.
- #messages(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::MessageInstance, Gupshup::REST::Api::V2010::AccountContext::MessageList
-
#messaging ⇒ Object
Access the Messaging Gupshup Domain.
-
#microvisor ⇒ Object
Access the Microvisor Gupshup Domain.
-
#monitor ⇒ Object
Access the Monitor Gupshup Domain.
- #new_keys ⇒ Gupshup::REST::Api::V2010::AccountContext::NewKeyInstance
- #new_signing_keys ⇒ Gupshup::REST::Api::V2010::AccountContext::NewSigningKeyInstance
- #notifications(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::NotificationInstance, Gupshup::REST::Api::V2010::AccountContext::NotificationList
-
#notify ⇒ Object
Access the Notify Gupshup Domain.
-
#numbers ⇒ Object
Access the Numbers Gupshup Domain.
-
#oauth ⇒ Object
Access the Oauth Gupshup Domain.
- #outgoing_caller_ids(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::OutgoingCallerIdInstance, Gupshup::REST::Api::V2010::AccountContext::OutgoingCallerIdList
-
#preview ⇒ Object
Access the Preview Gupshup Domain.
-
#pricing ⇒ Object
Access the Pricing Gupshup Domain.
-
#proxy ⇒ Object
Access the Proxy Gupshup Domain.
- #queues(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::QueueInstance, Gupshup::REST::Api::V2010::AccountContext::QueueList
- #recordings(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::RecordingInstance, Gupshup::REST::Api::V2010::AccountContext::RecordingList
-
#request(host, port, method, uri, params = {}, data = {}, headers = {}, auth = nil, timeout = nil) ⇒ Object
Makes a request to the Gupshup API using the configured http client Authentication information is automatically added if none is provided.
-
#routes ⇒ Object
Access the Routes Gupshup Domain.
-
#serverless ⇒ Object
Access the Serverless Gupshup Domain.
- #short_codes(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::ShortCodeInstance, Gupshup::REST::Api::V2010::AccountContext::ShortCodeList
- #signing_keys(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::SigningKeyInstance, Gupshup::REST::Api::V2010::AccountContext::SigningKeyList
- #sip ⇒ Gupshup::REST::Api::V2010::AccountContext::SipInstance
-
#studio ⇒ Object
Access the Studio Gupshup Domain.
-
#supersim ⇒ Object
Access the Supersim Gupshup Domain.
-
#sync ⇒ Object
Access the Sync Gupshup Domain.
-
#taskrouter ⇒ Object
Access the Taskrouter Gupshup Domain.
-
#to_s ⇒ Object
Provide a user friendly representation.
- #tokens ⇒ Gupshup::REST::Api::V2010::AccountContext::TokenInstance
- #transcriptions(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::TranscriptionInstance, Gupshup::REST::Api::V2010::AccountContext::TranscriptionList
-
#trunking ⇒ Object
Access the Trunking Gupshup Domain.
-
#trusthub ⇒ Object
Access the Trusthub Gupshup Domain.
- #usage ⇒ Gupshup::REST::Api::V2010::AccountContext::UsageInstance
-
#validate_ssl_certificate ⇒ Object
Validate the new SSL certificate for the Gupshup API.
- #validation_requests ⇒ Gupshup::REST::Api::V2010::AccountContext::ValidationRequestInstance
-
#verify ⇒ Object
Access the Verify Gupshup Domain.
-
#video ⇒ Object
Access the Video Gupshup Domain.
-
#voice ⇒ Object
Access the Voice Gupshup Domain.
-
#wireless ⇒ Object
Access the Wireless Gupshup Domain.
Constructor Details
#initialize(username = nil, password = nil, src_name = nil, region = nil, http_client = nil, logger = nil, user_agent_extensions = nil) ⇒ Client
Initializes the Gupshup Client
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/gupshup-rb/rest/client.rb', line 20 def initialize(username=nil, password=nil, src_name=nil, region=nil, http_client=nil, logger=nil, user_agent_extensions=nil) puts 'Gupshup' puts Gupshup binding.local_variables.each do |var_name| var_value = binding.local_variable_get(var_name) puts "#{var_name}: #{var_value}" end @src_name = src_name || Gupshup.src_name @api_key = password || Gupshup.api_key @auth = [@src_name, @api_key] @logger = logger || Gupshup.logger @user_agent_extensions = user_agent_extensions || [] # Domains @api = nil @content = nil @conversations = nil @events = nil @media = nil @messaging = nil @video = nil end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
16 17 18 |
# File 'lib/gupshup-rb/rest/client.rb', line 16 def api_key @api_key end |
#edge ⇒ Object
Returns the value of attribute edge.
16 17 18 |
# File 'lib/gupshup-rb/rest/client.rb', line 16 def edge @edge end |
#http_client ⇒ Object
Returns the value of attribute http_client.
16 17 18 |
# File 'lib/gupshup-rb/rest/client.rb', line 16 def http_client @http_client end |
#logger ⇒ Object
Returns the value of attribute logger.
16 17 18 |
# File 'lib/gupshup-rb/rest/client.rb', line 16 def logger @logger end |
#password ⇒ Object
Returns the value of attribute password.
16 17 18 |
# File 'lib/gupshup-rb/rest/client.rb', line 16 def password @password end |
#region ⇒ Object
Returns the value of attribute region.
16 17 18 |
# File 'lib/gupshup-rb/rest/client.rb', line 16 def region @region end |
#src_name ⇒ Object
Returns the value of attribute src_name.
16 17 18 |
# File 'lib/gupshup-rb/rest/client.rb', line 16 def src_name @src_name end |
#user_agent_extensions ⇒ Object
Returns the value of attribute user_agent_extensions.
16 17 18 |
# File 'lib/gupshup-rb/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/gupshup-rb/rest/client.rb', line 16 def username @username end |
Instance Method Details
#accounts ⇒ Object
Access the Accounts Gupshup Domain
144 145 146 |
# File 'lib/gupshup-rb/rest/client.rb', line 144 def accounts @accounts ||= Accounts.new self end |
#addresses(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::AddressInstance, Gupshup::REST::Api::V2010::AccountContext::AddressList
357 358 359 |
# File 'lib/gupshup-rb/rest/client.rb', line 357 def addresses(sid=:unset) self.api.v2010.account.addresses(sid) end |
#api ⇒ Object
Access the Api Gupshup Domain
150 151 152 |
# File 'lib/gupshup-rb/rest/client.rb', line 150 def api @api ||= Api.new self end |
#applications(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::ApplicationInstance, Gupshup::REST::Api::V2010::AccountContext::ApplicationList
366 367 368 |
# File 'lib/gupshup-rb/rest/client.rb', line 366 def applications(sid=:unset) self.api.v2010.account.applications(sid) end |
#authorized_connect_apps(connect_app_sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::AuthorizedConnectAppInstance, Gupshup::REST::Api::V2010::AccountContext::AuthorizedConnectAppList
374 375 376 |
# File 'lib/gupshup-rb/rest/client.rb', line 374 def (connect_app_sid=:unset) self.api.v2010.account.(connect_app_sid) end |
#autopilot ⇒ Object
Access the Autopilot Gupshup Domain
156 157 158 |
# File 'lib/gupshup-rb/rest/client.rb', line 156 def autopilot @autopilot ||= Autopilot.new self end |
#available_phone_numbers(country_code = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryInstance, Gupshup::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryList
384 385 386 |
# File 'lib/gupshup-rb/rest/client.rb', line 384 def available_phone_numbers(country_code=:unset) self.api.v2010.account.available_phone_numbers(country_code) end |
#balance ⇒ Gupshup::REST::Api::V2010::AccountContext::BalanceInstance
390 391 392 |
# File 'lib/gupshup-rb/rest/client.rb', line 390 def balance self.api.v2010.account.balance end |
#build_uri(uri) ⇒ Object
Build the final request uri
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/gupshup-rb/rest/client.rb', line 106 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 Gupshup Domain
342 343 344 |
# File 'lib/gupshup-rb/rest/client.rb', line 342 def bulkexports @bulkexports ||= Bulkexports.new self end |
#calls(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::CallInstance, Gupshup::REST::Api::V2010::AccountContext::CallList
399 400 401 |
# File 'lib/gupshup-rb/rest/client.rb', line 399 def calls(sid=:unset) self.api.v2010.account.calls(sid) end |
#chat ⇒ Object
Access the Chat Gupshup Domain
162 163 164 |
# File 'lib/gupshup-rb/rest/client.rb', line 162 def chat @chat ||= Chat.new self end |
#conferences(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::ConferenceInstance, Gupshup::REST::Api::V2010::AccountContext::ConferenceList
408 409 410 |
# File 'lib/gupshup-rb/rest/client.rb', line 408 def conferences(sid=:unset) self.api.v2010.account.conferences(sid) end |
#connect_apps(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::ConnectAppInstance, Gupshup::REST::Api::V2010::AccountContext::ConnectAppList
417 418 419 |
# File 'lib/gupshup-rb/rest/client.rb', line 417 def connect_apps(sid=:unset) self.api.v2010.account.connect_apps(sid) end |
#content ⇒ Object
Access the Content Gupshup Domain
168 169 170 |
# File 'lib/gupshup-rb/rest/client.rb', line 168 def content @content ||= Content.new self end |
#conversations ⇒ Object
Access the Conversations Gupshup Domain
174 175 176 |
# File 'lib/gupshup-rb/rest/client.rb', line 174 def conversations @conversations ||= Conversations.new self end |
#events ⇒ Object
Access the Events Gupshup Domain
180 181 182 |
# File 'lib/gupshup-rb/rest/client.rb', line 180 def events @events ||= Events.new self end |
#flex_api ⇒ Object
Access the FlexApi Gupshup Domain
186 187 188 |
# File 'lib/gupshup-rb/rest/client.rb', line 186 def flex_api @flex_api ||= FlexApi.new self end |
#frontline_api ⇒ Object
Access the FrontlineApi Gupshup Domain
192 193 194 |
# File 'lib/gupshup-rb/rest/client.rb', line 192 def frontline_api @frontline_api ||= FrontlineApi.new self end |
#incoming_phone_numbers(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::IncomingPhoneNumberInstance, Gupshup::REST::Api::V2010::AccountContext::IncomingPhoneNumberList
426 427 428 |
# File 'lib/gupshup-rb/rest/client.rb', line 426 def incoming_phone_numbers(sid=:unset) self.api.v2010.account.incoming_phone_numbers(sid) end |
#insights ⇒ Object
Access the Insights Gupshup Domain
198 199 200 |
# File 'lib/gupshup-rb/rest/client.rb', line 198 def insights @insights ||= Insights.new self end |
#ip_messaging ⇒ Object
Access the IpMessaging Gupshup Domain
204 205 206 |
# File 'lib/gupshup-rb/rest/client.rb', line 204 def ip_messaging @ip_messaging ||= IpMessaging.new self end |
#keys(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::KeyInstance, Gupshup::REST::Api::V2010::AccountContext::KeyList
435 436 437 |
# File 'lib/gupshup-rb/rest/client.rb', line 435 def keys(sid=:unset) self.api.v2010.account.keys(sid) end |
#lookups ⇒ Object
Access the Lookups Gupshup Domain
210 211 212 |
# File 'lib/gupshup-rb/rest/client.rb', line 210 def lookups @lookups ||= Lookups.new self end |
#media ⇒ Object
Access the Media Gupshup Domain
216 217 218 |
# File 'lib/gupshup-rb/rest/client.rb', line 216 def media @media ||= Media.new self end |
#messages(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::MessageInstance, Gupshup::REST::Api::V2010::AccountContext::MessageList
444 445 446 |
# File 'lib/gupshup-rb/rest/client.rb', line 444 def (sid=:unset) self.api.v2010.account.(sid) end |
#messaging ⇒ Object
Access the Messaging Gupshup Domain
222 223 224 |
# File 'lib/gupshup-rb/rest/client.rb', line 222 def messaging @messaging ||= Messaging.new self end |
#microvisor ⇒ Object
Access the Microvisor Gupshup Domain
348 349 350 |
# File 'lib/gupshup-rb/rest/client.rb', line 348 def microvisor @microvisor ||= Microvisor.new self end |
#monitor ⇒ Object
Access the Monitor Gupshup Domain
228 229 230 |
# File 'lib/gupshup-rb/rest/client.rb', line 228 def monitor @monitor ||= Monitor.new self end |
#new_keys ⇒ Gupshup::REST::Api::V2010::AccountContext::NewKeyInstance
450 451 452 |
# File 'lib/gupshup-rb/rest/client.rb', line 450 def new_keys self.api.v2010.account.new_keys end |
#new_signing_keys ⇒ Gupshup::REST::Api::V2010::AccountContext::NewSigningKeyInstance
456 457 458 |
# File 'lib/gupshup-rb/rest/client.rb', line 456 def new_signing_keys self.api.v2010.account.new_signing_keys end |
#notifications(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::NotificationInstance, Gupshup::REST::Api::V2010::AccountContext::NotificationList
465 466 467 |
# File 'lib/gupshup-rb/rest/client.rb', line 465 def notifications(sid=:unset) self.api.v2010.account.notifications(sid) end |
#notify ⇒ Object
Access the Notify Gupshup Domain
234 235 236 |
# File 'lib/gupshup-rb/rest/client.rb', line 234 def notify @notify ||= Notify.new self end |
#numbers ⇒ Object
Access the Numbers Gupshup Domain
240 241 242 |
# File 'lib/gupshup-rb/rest/client.rb', line 240 def numbers @numbers ||= Numbers.new self end |
#oauth ⇒ Object
Access the Oauth Gupshup Domain
246 247 248 |
# File 'lib/gupshup-rb/rest/client.rb', line 246 def oauth @oauth ||= Oauth.new self end |
#outgoing_caller_ids(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::OutgoingCallerIdInstance, Gupshup::REST::Api::V2010::AccountContext::OutgoingCallerIdList
474 475 476 |
# File 'lib/gupshup-rb/rest/client.rb', line 474 def outgoing_caller_ids(sid=:unset) self.api.v2010.account.outgoing_caller_ids(sid) end |
#preview ⇒ Object
Access the Preview Gupshup Domain
252 253 254 |
# File 'lib/gupshup-rb/rest/client.rb', line 252 def preview @preview ||= Preview.new self end |
#pricing ⇒ Object
Access the Pricing Gupshup Domain
258 259 260 |
# File 'lib/gupshup-rb/rest/client.rb', line 258 def pricing @pricing ||= Pricing.new self end |
#proxy ⇒ Object
Access the Proxy Gupshup Domain
264 265 266 |
# File 'lib/gupshup-rb/rest/client.rb', line 264 def proxy @proxy ||= Proxy.new self end |
#queues(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::QueueInstance, Gupshup::REST::Api::V2010::AccountContext::QueueList
483 484 485 |
# File 'lib/gupshup-rb/rest/client.rb', line 483 def queues(sid=:unset) self.api.v2010.account.queues(sid) end |
#recordings(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::RecordingInstance, Gupshup::REST::Api::V2010::AccountContext::RecordingList
492 493 494 |
# File 'lib/gupshup-rb/rest/client.rb', line 492 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 Gupshup API using the configured http client Authentication information is automatically added if none is provided
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 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 |
# File 'lib/gupshup-rb/rest/client.rb', line 47 def request(host, port, method, uri, params={}, data={}, headers={}, auth=nil, timeout=nil) auth ||= @auth ruby_config = RbConfig::CONFIG headers['User-Agent'] = "gupshup-rb/#{Gupshup::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 Gupshup 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 GUPSHUP API REQUEST--") end response end |
#routes ⇒ Object
Access the Routes Gupshup Domain
270 271 272 |
# File 'lib/gupshup-rb/rest/client.rb', line 270 def routes @routes ||= Routes.new self end |
#serverless ⇒ Object
Access the Serverless Gupshup Domain
276 277 278 |
# File 'lib/gupshup-rb/rest/client.rb', line 276 def serverless @serverless ||= Serverless.new self end |
#short_codes(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::ShortCodeInstance, Gupshup::REST::Api::V2010::AccountContext::ShortCodeList
515 516 517 |
# File 'lib/gupshup-rb/rest/client.rb', line 515 def short_codes(sid=:unset) self.api.v2010.account.short_codes(sid) end |
#signing_keys(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::SigningKeyInstance, Gupshup::REST::Api::V2010::AccountContext::SigningKeyList
500 501 502 |
# File 'lib/gupshup-rb/rest/client.rb', line 500 def signing_keys(sid=:unset) self.api.v2010.account.signing_keys(sid) end |
#sip ⇒ Gupshup::REST::Api::V2010::AccountContext::SipInstance
506 507 508 |
# File 'lib/gupshup-rb/rest/client.rb', line 506 def sip self.api.v2010.account.sip end |
#studio ⇒ Object
Access the Studio Gupshup Domain
282 283 284 |
# File 'lib/gupshup-rb/rest/client.rb', line 282 def studio @studio ||= Studio.new self end |
#supersim ⇒ Object
Access the Supersim Gupshup Domain
336 337 338 |
# File 'lib/gupshup-rb/rest/client.rb', line 336 def supersim @supersim ||= Supersim.new self end |
#sync ⇒ Object
Access the Sync Gupshup Domain
288 289 290 |
# File 'lib/gupshup-rb/rest/client.rb', line 288 def sync @sync ||= Sync.new self end |
#taskrouter ⇒ Object
Access the Taskrouter Gupshup Domain
294 295 296 |
# File 'lib/gupshup-rb/rest/client.rb', line 294 def taskrouter @taskrouter ||= Taskrouter.new self end |
#to_s ⇒ Object
Provide a user friendly representation
548 549 550 |
# File 'lib/gupshup-rb/rest/client.rb', line 548 def to_s "#<Gupshup::REST::Client #{@src_name}>" end |
#tokens ⇒ Gupshup::REST::Api::V2010::AccountContext::TokenInstance
521 522 523 |
# File 'lib/gupshup-rb/rest/client.rb', line 521 def tokens self.api.v2010.account.tokens end |
#transcriptions(sid = :unset) ⇒ Gupshup::REST::Api::V2010::AccountContext::TranscriptionInstance, Gupshup::REST::Api::V2010::AccountContext::TranscriptionList
530 531 532 |
# File 'lib/gupshup-rb/rest/client.rb', line 530 def transcriptions(sid=:unset) self.api.v2010.account.transcriptions(sid) end |
#trunking ⇒ Object
Access the Trunking Gupshup Domain
300 301 302 |
# File 'lib/gupshup-rb/rest/client.rb', line 300 def trunking @trunking ||= Trunking.new self end |
#trusthub ⇒ Object
Access the Trusthub Gupshup Domain
306 307 308 |
# File 'lib/gupshup-rb/rest/client.rb', line 306 def trusthub @trusthub ||= Trusthub.new self end |
#usage ⇒ Gupshup::REST::Api::V2010::AccountContext::UsageInstance
536 537 538 |
# File 'lib/gupshup-rb/rest/client.rb', line 536 def usage self.api.v2010.account.usage end |
#validate_ssl_certificate ⇒ Object
Validate the new SSL certificate for the Gupshup API
135 136 137 138 139 140 |
# File 'lib/gupshup-rb/rest/client.rb', line 135 def validate_ssl_certificate response = request('api.gupshup.com', '8443', 'GET', 'https://api.gupshup.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 ⇒ Gupshup::REST::Api::V2010::AccountContext::ValidationRequestInstance
542 543 544 |
# File 'lib/gupshup-rb/rest/client.rb', line 542 def validation_requests self.api.v2010.account.validation_requests end |
#verify ⇒ Object
Access the Verify Gupshup Domain
312 313 314 |
# File 'lib/gupshup-rb/rest/client.rb', line 312 def verify @verify ||= Verify.new self end |
#video ⇒ Object
Access the Video Gupshup Domain
318 319 320 |
# File 'lib/gupshup-rb/rest/client.rb', line 318 def video @video ||= Video.new self end |
#voice ⇒ Object
Access the Voice Gupshup Domain
324 325 326 |
# File 'lib/gupshup-rb/rest/client.rb', line 324 def voice @voice ||= Voice.new self end |
#wireless ⇒ Object
Access the Wireless Gupshup Domain
330 331 332 |
# File 'lib/gupshup-rb/rest/client.rb', line 330 def wireless @wireless ||= Wireless.new self end |