Class: Twilio::REST::Preview::Understand::AssistantContext::StyleSheetInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/understand/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, payload, assistant_sid: nil) ⇒ StyleSheetInstance

Initialize the StyleSheetInstance



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/twilio-ruby/rest/preview/understand/assistant/style_sheet.rb', line 131

def initialize(version, payload, assistant_sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'assistant_sid' => payload['assistant_sid'],
      'url' => payload['url'],
      'data' => payload['data'],
  }

  # Context
  @instance_context = nil
  @params = {'assistant_sid' => assistant_sid, }
end

Instance Method Details

#account_sidString



160
161
162
# File 'lib/twilio-ruby/rest/preview/understand/assistant/style_sheet.rb', line 160

def 
  @properties['account_sid']
end

#assistant_sidString



166
167
168
# File 'lib/twilio-ruby/rest/preview/understand/assistant/style_sheet.rb', line 166

def assistant_sid
  @properties['assistant_sid']
end

#contextStyleSheetContext

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



151
152
153
154
155
156
# File 'lib/twilio-ruby/rest/preview/understand/assistant/style_sheet.rb', line 151

def context
  unless @instance_context
    @instance_context = StyleSheetContext.new(@version, @params['assistant_sid'], )
  end
  @instance_context
end

#dataHash



178
179
180
# File 'lib/twilio-ruby/rest/preview/understand/assistant/style_sheet.rb', line 178

def data
  @properties['data']
end

#fetchStyleSheetInstance

Fetch a StyleSheetInstance



185
186
187
# File 'lib/twilio-ruby/rest/preview/understand/assistant/style_sheet.rb', line 185

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



206
207
208
209
# File 'lib/twilio-ruby/rest/preview/understand/assistant/style_sheet.rb', line 206

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

#to_sObject

Provide a user friendly representation



199
200
201
202
# File 'lib/twilio-ruby/rest/preview/understand/assistant/style_sheet.rb', line 199

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.Understand.StyleSheetInstance #{values}>"
end

#update(style_sheet: :unset) ⇒ StyleSheetInstance

Update the StyleSheetInstance



193
194
195
# File 'lib/twilio-ruby/rest/preview/understand/assistant/style_sheet.rb', line 193

def update(style_sheet: :unset)
  context.update(style_sheet: style_sheet, )
end

#urlString



172
173
174
# File 'lib/twilio-ruby/rest/preview/understand/assistant/style_sheet.rb', line 172

def url
  @properties['url']
end