Class: Twilio::REST::Numbers::V1::PortingPortInPhoneNumberContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, port_in_request_sid, phone_number_sid) ⇒ PortingPortInPhoneNumberContext

Initialize the PortingPortInPhoneNumberContext

Parameters:

  • version (Version)

    Version that contains the resource

  • port_in_request_sid (String)

    The SID of the Port In request. This is a unique identifier of the port in request.

  • phone_number_sid (String)

    The SID of the Phone number. This is a unique identifier of the phone number.



50
51
52
53
54
55
56
57
58
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 50

def initialize(version, port_in_request_sid, phone_number_sid)
    super(version)

    # Path Solution
    @solution = { port_in_request_sid: port_in_request_sid, phone_number_sid: phone_number_sid,  }
    @uri = "/Porting/PortIn/#{@solution[:port_in_request_sid]}/PhoneNumber/#{@solution[:phone_number_sid]}"

    
end

Instance Method Details

#deleteBoolean

Delete the PortingPortInPhoneNumberInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



62
63
64
65
66
67
68
69
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 62

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    @version.delete('DELETE', @uri, headers: headers)
end

#fetchPortingPortInPhoneNumberInstance

Fetch the PortingPortInPhoneNumberInstance

Returns:



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 74

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    PortingPortInPhoneNumberInstance.new(
        @version,
        payload,
        port_in_request_sid: @solution[:port_in_request_sid],
        phone_number_sid: @solution[:phone_number_sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



101
102
103
104
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 101

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Numbers.V1.PortingPortInPhoneNumberContext #{context}>"
end

#to_sObject

Provide a user friendly representation



94
95
96
97
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 94

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Numbers.V1.PortingPortInPhoneNumberContext #{context}>"
end