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 that contains the resource



49
50
51
52
53
54
55
56
57
58
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 49

def initialize(version)
    super(version)
    

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

    
end

Instance Method Details

#fetch(subaccount_sid: :unset) ⇒ SettingInstance

Fetch the SettingInstance

Parameters:

  • (defaults to: :unset)

    The unique SID identifier of the Subaccount.

Returns:

  • Fetched SettingInstance



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 63

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

#fetch_with_metadata(subaccount_sid: :unset) ⇒ SettingInstance

Fetch the SettingInstanceMetadata

Parameters:

  • (defaults to: :unset)

    The unique SID identifier of the Subaccount.

Returns:

  • Fetched 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
111
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 87

def (
  subaccount_sid: :unset
)

    params = Twilio::Values.of({
        'SubaccountSid' => subaccount_sid,
    })
    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, params: params, headers: headers)
    setting_instance = SettingInstance.new(
        @version,
        response.body,
    )
    .new(
        @version,
        setting_instance,
        response.headers,
        response.status_code
    )
end

#inspectObject

Provide a detailed, user friendly representation



191
192
193
194
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 191

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

#to_sObject

Provide a user friendly representation



184
185
186
187
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 184

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:

  • (defaults to: :unset)

    A boolean flag to enable Advanced Features for Voice Insights.

  • (defaults to: :unset)

    A boolean flag to enable Voice Trace.

  • (defaults to: :unset)

    The unique SID identifier of the Subaccount.

Returns:

  • Updated SettingInstance



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 119

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

#update_with_metadata(advanced_features: :unset, voice_trace: :unset, subaccount_sid: :unset) ⇒ SettingInstance

Update the SettingInstanceMetadata

Parameters:

  • (defaults to: :unset)

    A boolean flag to enable Advanced Features for Voice Insights.

  • (defaults to: :unset)

    A boolean flag to enable Voice Trace.

  • (defaults to: :unset)

    The unique SID identifier of the Subaccount.

Returns:

  • Updated SettingInstance



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 150

def (
  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', })
    
    
    
    
    
    response = @version.('POST', @uri, data: data, headers: headers)
    setting_instance = SettingInstance.new(
        @version,
        response.body,
    )
    .new(
        @version,
        setting_instance,
        response.headers,
        response.status_code
    )
end