class Twilio::REST::Autopilot::V1::AssistantContext::StyleSheetContext

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.

Public Class Methods

new(version, assistant_sid) click to toggle source

Initialize the StyleSheetContext @param [Version] version Version that contains the resource @param [String] assistant_sid The SID of the

{Assistant}[https://www.twilio.com/docs/autopilot/api/assistant] that is the
parent of the resource to fetch.

@return [StyleSheetContext] StyleSheetContext

Calls superclass method Twilio::REST::InstanceContext::new
   # File lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb
79 def initialize(version, assistant_sid)
80   super(version)
81 
82   # Path Solution
83   @solution = {assistant_sid: assistant_sid, }
84   @uri = "/Assistants/#{@solution[:assistant_sid]}/StyleSheet"
85 end

Public Instance Methods

fetch() click to toggle source

Fetch the StyleSheetInstance @return [StyleSheetInstance] Fetched StyleSheetInstance

   # File lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb
90 def fetch
91   payload = @version.fetch('GET', @uri)
92 
93   StyleSheetInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
94 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb
117 def inspect
118   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
119   "#<Twilio.Autopilot.V1.StyleSheetContext #{context}>"
120 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb
110 def to_s
111   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
112   "#<Twilio.Autopilot.V1.StyleSheetContext #{context}>"
113 end
update(style_sheet: :unset) click to toggle source

Update the StyleSheetInstance @param [Hash] style_sheet The JSON string that describes the style sheet object. @return [StyleSheetInstance] Updated StyleSheetInstance

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb
100 def update(style_sheet: :unset)
101   data = Twilio::Values.of({'StyleSheet' => Twilio.serialize_object(style_sheet), })
102 
103   payload = @version.update('POST', @uri, data: data)
104 
105   StyleSheetInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
106 end