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



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

Parameters:

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

    The unique SID identifier of the Subaccount.

Returns:



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

#inspectObject

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_sObject

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

Parameters:

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

    A boolean flag to enable Advanced Features for Voice Insights.

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

    A boolean flag to enable Voice Trace.

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

    The unique SID identifier of the Subaccount.

Returns:



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