Class: Twilio::REST::Numbers::V1::PortingPortInContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, port_in_request_sid) ⇒ PortingPortInContext

Initialize the PortingPortInContext

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.



69
70
71
72
73
74
75
76
77
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 69

def initialize(version, port_in_request_sid)
    super(version)

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

    
end

Instance Method Details

#deleteBoolean

Delete the PortingPortInInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



81
82
83
84
85
86
87
88
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 81

def delete

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

#fetchPortingPortInInstance

Fetch the PortingPortInInstance

Returns:



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 93

def fetch

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

#inspectObject

Provide a detailed, user friendly representation



119
120
121
122
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 119

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

#to_sObject

Provide a user friendly representation



112
113
114
115
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 112

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