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

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • sid (String) (defaults to: nil)

    The unique string that identifies the End-User Type resource.


189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 189

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

Returns:


210
211
212
213
214
215
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 210

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

#fetchEndUserTypeInstance

Fetch the EndUserTypeInstance

Returns:


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

def fetch
  context.fetch
end

#fieldsArray[Hash]

Returns The required information for creating an End-User.

Returns:

  • (Array[Hash])

    The required information for creating an End-User.


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

def fields
  @properties['fields']
end

#friendly_nameString

Returns A human-readable description of the End-User Type resource.

Returns:

  • (String)

    A human-readable description of the End-User Type resource


225
226
227
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 225

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation


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

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

#machine_nameString

Returns A machine-readable description of the End-User Type resource.

Returns:

  • (String)

    A machine-readable description of the End-User Type resource


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

def machine_name
  @properties['machine_name']
end

#sidString

Returns The unique string that identifies the End-User Type resource.

Returns:

  • (String)

    The unique string that identifies the End-User Type resource


219
220
221
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 219

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation


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

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

#urlString

Returns The absolute URL of the End-User Type resource.

Returns:

  • (String)

    The absolute URL of the End-User Type resource


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

def url
  @properties['url']
end