Class: Twilio::REST::Insights::V1::SettingInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ SettingInstance

Initialize the SettingInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Setting resource.

  • sid (String)

    The SID of the Call resource to fetch.



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 166

def initialize(version, payload )
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'advanced_features' => payload['advanced_features'],
        'voice_trace' => payload['voice_trace'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = {  }
end

Instance Method Details

#account_sidString

Returns The unique SID identifier of the Account.

Returns:

  • (String)

    The unique SID identifier of the Account.



195
196
197
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 195

def 
    @properties['account_sid']
end

#advanced_featuresBoolean

Returns A boolean flag indicating whether Advanced Features for Voice Insights are enabled.

Returns:

  • (Boolean)

    A boolean flag indicating whether Advanced Features for Voice Insights are enabled.



201
202
203
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 201

def advanced_features
    @properties['advanced_features']
end

#contextSettingContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



186
187
188
189
190
191
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 186

def context
    unless @instance_context
        @instance_context = SettingContext.new(@version )
    end
    @instance_context
end

#fetch(subaccount_sid: :unset) ⇒ SettingInstance

Fetch the SettingInstance

Parameters:

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

    The unique SID identifier of the Subaccount.

Returns:



221
222
223
224
225
226
227
228
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 221

def fetch(
    subaccount_sid: :unset
)

    context.fetch(
        subaccount_sid: subaccount_sid, 
    )
end

#inspectObject

Provide a detailed, user friendly representation



258
259
260
261
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 258

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Insights.V1.SettingInstance #{values}>"
end

#to_sObject

Provide a user friendly representation



251
252
253
254
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 251

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Insights.V1.SettingInstance #{values}>"
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:



236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 236

def update(
    advanced_features: :unset, 
    voice_trace: :unset, 
    subaccount_sid: :unset
)

    context.update(
        advanced_features: advanced_features, 
        voice_trace: voice_trace, 
        subaccount_sid: subaccount_sid, 
    )
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



213
214
215
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 213

def url
    @properties['url']
end

#voice_traceBoolean

Returns A boolean flag indicating whether Voice Trace is enabled.

Returns:

  • (Boolean)

    A boolean flag indicating whether Voice Trace is enabled.



207
208
209
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 207

def voice_trace
    @properties['voice_trace']
end