Class: Twilio::REST::Trusthub::V1::EndUserTypeInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ EndUserTypeInstance

Initialize the EndUserTypeInstance



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 209

def initialize(version, payload , sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'friendly_name' => payload['friendly_name'],
        'machine_name' => payload['machine_name'],
        'fields' => payload['fields'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#contextEndUserTypeContext

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



230
231
232
233
234
235
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 230

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

#fetchEndUserTypeInstance

Fetch the EndUserTypeInstance



270
271
272
273
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 270

def fetch

    context.fetch
end

#fieldsArray<Hash>



257
258
259
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 257

def fields
    @properties['fields']
end

#friendly_nameString



245
246
247
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 245

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



284
285
286
287
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 284

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

#machine_nameString



251
252
253
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 251

def machine_name
    @properties['machine_name']
end

#sidString



239
240
241
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 239

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



277
278
279
280
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 277

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

#urlString



263
264
265
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 263

def url
    @properties['url']
end