Class: Twilio::REST::Insights::V1::SettingContext
- Inherits:
-
Twilio::REST::InstanceContext
- Object
- Twilio::REST::InstanceContext
- Twilio::REST::Insights::V1::SettingContext
- Defined in:
- lib/twilio-ruby/rest/insights/v1/setting.rb
Instance Method Summary collapse
-
#fetch(subaccount_sid: :unset) ⇒ SettingInstance
Fetch the SettingInstance.
-
#initialize(version) ⇒ SettingContext
constructor
Initialize the SettingContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(advanced_features: :unset, voice_trace: :unset, subaccount_sid: :unset) ⇒ SettingInstance
Update the SettingInstance.
Constructor Details
#initialize(version) ⇒ SettingContext
Initialize the SettingContext
48 49 50 51 52 53 54 55 56 |
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 48 def initialize(version) super(version) # Path Solution @solution = { } @uri = "/Voice/Settings" end |
Instance Method Details
#fetch(subaccount_sid: :unset) ⇒ SettingInstance
Fetch the SettingInstance
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 61 def fetch( subaccount_sid: :unset ) params = Twilio::Values.of({ 'SubaccountSid' => subaccount_sid, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, params: params, headers: headers) SettingInstance.new( @version, payload, ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
122 123 124 125 |
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 122 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Insights.V1.SettingContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
115 116 117 118 |
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 115 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Insights.V1.SettingContext #{context}>" end |
#update(advanced_features: :unset, voice_trace: :unset, subaccount_sid: :unset) ⇒ SettingInstance
Update the SettingInstance
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 87 def update( advanced_features: :unset, voice_trace: :unset, subaccount_sid: :unset ) data = Twilio::Values.of({ 'AdvancedFeatures' => advanced_features, 'VoiceTrace' => voice_trace, 'SubaccountSid' => subaccount_sid, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) SettingInstance.new( @version, payload, ) end |