Class: Twilio::REST::Insights::V1::SettingContext

Inherits:
Twilio::REST::InstanceContext show all
Defined in:
lib/twilio-ruby/rest/insights/v1/setting.rb

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ SettingContext

Initialize the SettingContext

Parameters:

  • version (Version)

    Version that contains the resource


66
67
68
69
70
71
72
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 66

def initialize(version)
  super(version)

  # Path Solution
  @solution = {}
  @uri = "/Voice/Settings"
end

Instance Method Details

#fetch(subaccount_sid: :unset) ⇒ SettingInstance

Fetch the SettingInstance

Parameters:

  • subaccount_sid (String) (defaults to: :unset)

    The subaccount_sid

Returns:


78
79
80
81
82
83
84
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 78

def fetch(subaccount_sid: :unset)
  params = Twilio::Values.of({'SubaccountSid' => subaccount_sid, })

  payload = @version.fetch('GET', @uri, params: params)

  SettingInstance.new(@version, payload, )
end

#inspectObject

Provide a detailed, user friendly representation


113
114
115
116
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 113

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Insights.V1.SettingContext #{context}>"
end

#to_sObject

Provide a user friendly representation


106
107
108
109
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 106

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

Parameters:

  • advanced_features (Boolean) (defaults to: :unset)

    The advanced_features

  • voice_trace (Boolean) (defaults to: :unset)

    The voice_trace

  • subaccount_sid (String) (defaults to: :unset)

    The subaccount_sid

Returns:


92
93
94
95
96
97
98
99
100
101
102
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 92

def update(advanced_features: :unset, voice_trace: :unset, subaccount_sid: :unset)
  data = Twilio::Values.of({
      'AdvancedFeatures' => advanced_features,
      'VoiceTrace' => voice_trace,
      'SubaccountSid' => subaccount_sid,
  })

  payload = @version.update('POST', @uri, data: data)

  SettingInstance.new(@version, payload, )
end