Class: Twilio::REST::Autopilot::V1::AssistantContext::FieldTypeContext::FieldValueContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.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, field_type_sid, sid) ⇒ FieldValueContext

Initialize the FieldValueContext

Parameters:

  • version (Version)

    Version that contains the resource

  • assistant_sid (String)

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

  • field_type_sid (String)

    The SID of the Field Type associated with the Field Value to fetch.

  • sid (String)

    The Twilio-provided string that uniquely identifies the FieldValue resource to fetch.



172
173
174
175
176
177
178
179
180
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb', line 172

def initialize(version, assistant_sid, field_type_sid, sid)
    super(version)

    # Path Solution
    @solution = { assistant_sid: assistant_sid, field_type_sid: field_type_sid, sid: sid,  }
    @uri = "/Assistants/#{@solution[:assistant_sid]}/FieldTypes/#{@solution[:field_type_sid]}/FieldValues/#{@solution[:sid]}"

    
end

Instance Method Details

#deleteBoolean

Delete the FieldValueInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



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

def delete

    @version.delete('DELETE', @uri)
end

#fetchFieldValueInstance

Fetch the FieldValueInstance

Returns:



192
193
194
195
196
197
198
199
200
201
202
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb', line 192

def fetch

    payload = @version.fetch('GET', @uri)
    FieldValueInstance.new(
        @version,
        payload,
        assistant_sid: @solution[:assistant_sid],
        field_type_sid: @solution[:field_type_sid],
        sid: @solution[:sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



214
215
216
217
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb', line 214

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

#to_sObject

Provide a user friendly representation



207
208
209
210
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb', line 207

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