Class: Twilio::REST::Numbers::V2::RegulatoryComplianceList::RegulationInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb

Instance Method Summary collapse

Constructor Details

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

Initialize the RegulationInstance

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 Regulation resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 421

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

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

Instance Method Details

#contextRegulationContext

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

Returns:



445
446
447
448
449
450
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 445

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

#end_user_typeEndUserType

Returns:

  • (EndUserType)


478
479
480
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 478

def end_user_type
    @properties['end_user_type']
end

#fetch(include_constraints: :unset) ⇒ RegulationInstance

Fetch the RegulationInstance

Parameters:

  • include_constraints (Boolean) (defaults to: :unset)

    A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields

Returns:



498
499
500
501
502
503
504
505
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 498

def fetch(
    include_constraints: :unset
)

    context.fetch(
        include_constraints: include_constraints, 
    )
end

#friendly_nameString

Returns A human-readable description that is assigned to describe the Regulation resource. Examples can include Germany: Mobile - Business.

Returns:

  • (String)

    A human-readable description that is assigned to describe the Regulation resource. Examples can include Germany: Mobile - Business.



460
461
462
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 460

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



516
517
518
519
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 516

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

#iso_countryString

Returns The ISO country code of the phone number’s country.

Returns:

  • (String)

    The ISO country code of the phone number’s country.



466
467
468
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 466

def iso_country
    @properties['iso_country']
end

#number_typeString

Returns The type of phone number restricted by the regulatory requirement. For example, Germany mobile phone numbers provisioned by businesses require a business name with commercial register proof from the Handelsregisterauszug and a proof of address from Handelsregisterauszug or a trade license by Gewerbeanmeldung.

Returns:

  • (String)

    The type of phone number restricted by the regulatory requirement. For example, Germany mobile phone numbers provisioned by businesses require a business name with commercial register proof from the Handelsregisterauszug and a proof of address from Handelsregisterauszug or a trade license by Gewerbeanmeldung.



472
473
474
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 472

def number_type
    @properties['number_type']
end

#requirementsHash

Returns The SID of an object that holds the regulatory information of the phone number country, phone number type, and end user type.

Returns:

  • (Hash)

    The SID of an object that holds the regulatory information of the phone number country, phone number type, and end user type.



484
485
486
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 484

def requirements
    @properties['requirements']
end

#sidString

Returns The unique string that identifies the Regulation resource.

Returns:

  • (String)

    The unique string that identifies the Regulation resource.



454
455
456
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 454

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



509
510
511
512
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 509

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

#urlString

Returns The absolute URL of the Regulation resource.

Returns:

  • (String)

    The absolute URL of the Regulation resource.



490
491
492
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/regulation.rb', line 490

def url
    @properties['url']
end