Class: Twilio::REST::PricingClient
- Inherits:
-
BaseClient
- Object
- BaseClient
- Twilio::REST::PricingClient
- Defined in:
- lib/twilio-ruby/rest/pricing_client.rb
Constant Summary collapse
- API_VERSION =
'v1'
Constants inherited from BaseClient
Instance Attribute Summary collapse
-
#phone_numbers ⇒ Object
readonly
Returns the value of attribute phone_numbers.
-
#voice ⇒ Object
readonly
Returns the value of attribute voice.
Attributes inherited from BaseClient
#account_sid, #last_request, #last_response
Instance Method Summary collapse
-
#initialize(*args) ⇒ PricingClient
constructor
Instantiate a new HTTP client to talk to Twilio’s Pricing API.
-
#inspect ⇒ Object
:nodoc:.
Methods included from Utils
Methods included from Util
Methods inherited from BaseClient
Constructor Details
#initialize(*args) ⇒ PricingClient
Instantiate a new HTTP client to talk to Twilio’s Pricing API. The parameters account_sid
and auth_token
are required, unless you have configured them already using the block configure syntax, and used to generate the HTTP basic auth header in each request. The options
parameter is a hash of connection configuration options. the following keys are supported:
host: 'pricing.twilio.com'
The domain to which you’d like the client to make HTTP requests. Useful for testing. Defaults to ‘pricing.twilio.com’.
port: 443
The port on which to connect to the above domain. Defaults to 443 and should be left that way except in testing environments.
use_ssl: true
Declare whether ssl should be used for connections to the above domain. Defaults to true and should be left alone except when testing.
ssl_verify_peer: true
Declare whether to verify the host’s ssl cert when setting up the connection to the above domain. Defaults to true, but can be turned off to avoid ssl certificate verification failures in environments without the necessary ca certificates.
ssl_ca_file: '/path/to/ca/file'
Specify the path to the certificate authority bundle you’d like to use to verify Twilio’s SSL certificate on each request. If not specified, a certificate bundle extraced from Firefox is packaged with the gem and used by default.
timeout: 30
Set the time in seconds to wait before timing out the HTTP request. Defaults to 30 seconds. If you aren’t fetching giant pages of call or SMS logs you can safely decrease this to something like 3 seconds or lower. In paricular if you are sending SMS you can set this to 1 second or less and swallow the exception if you don’t care about the response.
proxy_addr: 'proxy.host.domain'
The domain of a proxy through which you’d like the client to make HTTP requests. Defaults to nil.
proxy_port: 3128
The port on which to connect to the above proxy. Defaults to nil.
proxy_user: 'username'
The user name to use for authentication with the proxy. Defaults to nil.
proxy_pass: 'password'
The password to use for authentication with the proxy. Defaults to nil.
retry_limit: 1
The number of times to retry a request that has failed before throwing an exception. Defaults to one.
84 85 86 |
# File 'lib/twilio-ruby/rest/pricing_client.rb', line 84 def initialize(*args) super(*args) end |
Instance Attribute Details
#phone_numbers ⇒ Object (readonly)
Returns the value of attribute phone_numbers.
14 15 16 |
# File 'lib/twilio-ruby/rest/pricing_client.rb', line 14 def phone_numbers @phone_numbers end |
#voice ⇒ Object (readonly)
Returns the value of attribute voice.
14 15 16 |
# File 'lib/twilio-ruby/rest/pricing_client.rb', line 14 def voice @voice end |
Instance Method Details
#inspect ⇒ Object
:nodoc:
88 89 90 |
# File 'lib/twilio-ruby/rest/pricing_client.rb', line 88 def inspect # :nodoc: "<Twilio::REST::PricingClient @account_sid=#{@account_sid}>" end |