Class: Twilio::REST::Lookups::V2::LookupOverrideInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/lookups/v2/lookup_override.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, field: nil, phone_number: nil) ⇒ LookupOverrideInstance

Initialize the LookupOverrideInstance

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

  • sid (String)

    The SID of the Call resource to fetch.



418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 418

def initialize(version, payload , field: nil, phone_number: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'phone_number' => payload['phone_number'],
        'original_line_type' => payload['original_line_type'],
        'overridden_line_type' => payload['overridden_line_type'],
        'override_reason' => payload['override_reason'],
        'override_timestamp' => Twilio.deserialize_iso8601_datetime(payload['override_timestamp']),
        'overridden_by_account_sid' => payload['overridden_by_account_sid'],
        'code' => payload['code'],
        'message' => payload['message'],
        'more_info' => payload['more_info'],
        'status' => payload['status'],
        'field' => payload['field'],
        'limit' => payload['limit'],
        'bucket' => payload['bucket'],
        'owner' => payload['owner'],
        'ttl' => payload['ttl'],
    }

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

Instance Method Details

#bucketString

Returns Name of the bucket.

Returns:

  • (String)

    Name of the bucket



531
532
533
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 531

def bucket
    @properties['bucket']
end

#codeString

Returns Twilio-specific error code.

Returns:

  • (String)

    Twilio-specific error code



495
496
497
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 495

def code
    @properties['code']
end

#contextLookupOverrideContext

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

Returns:



450
451
452
453
454
455
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 450

def context
    unless @instance_context
        @instance_context = LookupOverrideContext.new(@version , @params['field'], @params['phone_number'])
    end
    @instance_context
end

#create(overrides_request: :unset) ⇒ LookupOverrideInstance

Create the LookupOverrideInstance

Parameters:

  • overrides_request (OverridesRequest) (defaults to: :unset)

Returns:



551
552
553
554
555
556
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 551

def create(overrides_request: :unset
)

    context.create(
    )
end

#deleteBoolean

Delete the LookupOverrideInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



561
562
563
564
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 561

def delete

    context.delete
end

#fetchLookupOverrideInstance

Fetch the LookupOverrideInstance

Returns:



569
570
571
572
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 569

def fetch

    context.fetch
end

#fieldString

Returns Limit of requests for the bucket.

Returns:

  • (String)

    Limit of requests for the bucket



519
520
521
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 519

def field
    @properties['field']
end

#inspectObject

Provide a detailed, user friendly representation



594
595
596
597
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 594

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

#limitString

Returns Limit of requests for the bucket.

Returns:

  • (String)

    Limit of requests for the bucket



525
526
527
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 525

def limit
    @properties['limit']
end

#messageString

Returns Error message.

Returns:

  • (String)

    Error message



501
502
503
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 501

def message
    @properties['message']
end

#more_infoString

Returns Link to Error Code References.

Returns:

  • (String)

    Link to Error Code References



507
508
509
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 507

def more_info
    @properties['more_info']
end

#original_line_typeString

Returns The original line type.

Returns:

  • (String)

    The original line type



465
466
467
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 465

def original_line_type
    @properties['original_line_type']
end

#overridden_by_account_sidString

Returns The Account SID for the user who made the override.

Returns:

  • (String)

    The Account SID for the user who made the override



489
490
491
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 489

def 
    @properties['overridden_by_account_sid']
end

#overridden_line_typeString

Returns The new line type after the override.

Returns:

  • (String)

    The new line type after the override



471
472
473
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 471

def overridden_line_type
    @properties['overridden_line_type']
end

#override_reasonString

Returns The reason for the override.

Returns:

  • (String)

    The reason for the override



477
478
479
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 477

def override_reason
    @properties['override_reason']
end

#override_timestampTime

Returns:

  • (Time)


483
484
485
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 483

def override_timestamp
    @properties['override_timestamp']
end

#ownerString

Returns Owner of the rule.

Returns:

  • (String)

    Owner of the rule



537
538
539
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 537

def owner
    @properties['owner']
end

#phone_numberString

Returns The phone number for which the override was created.

Returns:

  • (String)

    The phone number for which the override was created



459
460
461
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 459

def phone_number
    @properties['phone_number']
end

#statusString

Returns HTTP response status code.

Returns:

  • (String)

    HTTP response status code



513
514
515
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 513

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



587
588
589
590
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 587

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

#ttlString

Returns Time to live of the rule.

Returns:

  • (String)

    Time to live of the rule



543
544
545
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 543

def ttl
    @properties['ttl']
end

#update(overrides_request: :unset) ⇒ LookupOverrideInstance

Update the LookupOverrideInstance

Parameters:

  • overrides_request (OverridesRequest) (defaults to: :unset)

Returns:



578
579
580
581
582
583
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 578

def update(overrides_request: :unset
)

    context.update(
    )
end