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


125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 125

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 account_sid.

Returns:

  • (String)

    The account_sid


154
155
156
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 154

def 
  @properties['account_sid']
end

#advanced_featuresBoolean

Returns The advanced_features.

Returns:

  • (Boolean)

    The advanced_features


160
161
162
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 160

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:


145
146
147
148
149
150
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 145

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 subaccount_sid

Returns:


180
181
182
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 180

def fetch(subaccount_sid: :unset)
  context.fetch(subaccount_sid: subaccount_sid, )
end

#inspectObject

Provide a detailed, user friendly representation


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

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

#to_sObject

Provide a user friendly representation


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

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)

    The advanced_features

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

    The voice_trace

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

    The subaccount_sid

Returns:


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

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.

Returns:

  • (String)

    The url


172
173
174
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 172

def url
  @properties['url']
end

#voice_traceBoolean

Returns The voice_trace.

Returns:

  • (Boolean)

    The voice_trace


166
167
168
# File 'lib/twilio-ruby/rest/insights/v1/setting.rb', line 166

def voice_trace
  @properties['voice_trace']
end