Class: Twilio::REST::Numbers::V2::RegulatoryComplianceList::EndUserTypeInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/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

  • account_sid (String)

    The SID of the Account that created this EndUserType resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



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

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:



231
232
233
234
235
236
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb', line 231

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

#fetchEndUserTypeInstance

Fetch the EndUserTypeInstance

Returns:



271
272
273
274
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb', line 271

def fetch

    context.fetch
end

#fieldsArray<Hash>

Returns The required information for creating an End-User. The required fields will change as regulatory needs change and will differ for businesses and individuals.

Returns:

  • (Array<Hash>)

    The required information for creating an End-User. The required fields will change as regulatory needs change and will differ for businesses and individuals.



258
259
260
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb', line 258

def fields
    @properties['fields']
end

#friendly_nameString

Returns A human-readable description that is assigned to describe the End-User Type resource. Examples can include first name, last name, email, business name, etc.

Returns:

  • (String)

    A human-readable description that is assigned to describe the End-User Type resource. Examples can include first name, last name, email, business name, etc



246
247
248
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb', line 246

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



285
286
287
288
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb', line 285

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

#machine_nameString

Returns A machine-readable description of the End-User Type resource. Examples can include first_name, last_name, email, business_name, etc.

Returns:

  • (String)

    A machine-readable description of the End-User Type resource. Examples can include first_name, last_name, email, business_name, etc.



252
253
254
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb', line 252

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.



240
241
242
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb', line 240

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



278
279
280
281
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb', line 278

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



264
265
266
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb', line 264

def url
    @properties['url']
end