Class: Twilio::REST::Autopilot::V1::AssistantContext::StyleSheetContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb

Overview

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 [email protected].

Instance Method Summary collapse

Constructor Details

#initialize(version, assistant_sid) ⇒ StyleSheetContext

Initialize the StyleSheetContext

Parameters:



79
80
81
82
83
84
85
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb', line 79

def initialize(version, assistant_sid)
  super(version)

  # Path Solution
  @solution = {assistant_sid: assistant_sid, }
  @uri = "/Assistants/#{@solution[:assistant_sid]}/StyleSheet"
end

Instance Method Details

#fetchStyleSheetInstance

Fetch a StyleSheetInstance

Returns:



90
91
92
93
94
95
96
97
98
99
100
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb', line 90

def fetch
  params = Twilio::Values.of({})

  payload = @version.fetch(
      'GET',
      @uri,
      params,
  )

  StyleSheetInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
end

#inspectObject

Provide a detailed, user friendly representation



127
128
129
130
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb', line 127

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

#to_sObject

Provide a user friendly representation



120
121
122
123
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb', line 120

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

#update(style_sheet: :unset) ⇒ StyleSheetInstance

Update the StyleSheetInstance

Parameters:

  • style_sheet (Hash) (defaults to: :unset)

    The JSON string that describes the style sheet object.

Returns:



106
107
108
109
110
111
112
113
114
115
116
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb', line 106

def update(style_sheet: :unset)
  data = Twilio::Values.of({'StyleSheet' => Twilio.serialize_object(style_sheet), })

  payload = @version.update(
      'POST',
      @uri,
      data: data,
  )

  StyleSheetInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
end