Class: Twilio::REST::Autopilot::V1::AssistantContext::StyleSheetInstance

Inherits:
InstanceResource
  • 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, payload, assistant_sid: nil) ⇒ StyleSheetInstance

Initialize the StyleSheetInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • assistant_sid (String) (defaults to: nil)

    The SID of the [Assistant](www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource.



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb', line 144

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

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource



173
174
175
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb', line 173

def 
  @properties['account_sid']
end

#assistant_sidString

Returns The SID of the Assistant that is the parent of the resource.

Returns:

  • (String)

    The SID of the Assistant that is the parent of the resource



179
180
181
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb', line 179

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

Returns:



164
165
166
167
168
169
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb', line 164

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

#dataHash

Returns The JSON string that describes the style sheet object.

Returns:

  • (Hash)

    The JSON string that describes the style sheet object



191
192
193
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb', line 191

def data
  @properties['data']
end

#fetchStyleSheetInstance

Fetch a StyleSheetInstance

Returns:



198
199
200
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb', line 198

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



219
220
221
222
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb', line 219

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

#to_sObject

Provide a user friendly representation



212
213
214
215
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb', line 212

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



206
207
208
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb', line 206

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

#urlString

Returns The absolute URL of the StyleSheet resource.

Returns:

  • (String)

    The absolute URL of the StyleSheet resource



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

def url
  @properties['url']
end