Class: Twilio::REST::Numbers::V1::PortingPortInInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, port_in_request_sid: nil) ⇒ PortingPortInInstance

Initialize the PortingPortInInstance

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

  • sid (String)

    The SID of the Call resource to fetch.



136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 136

def initialize(version, payload , port_in_request_sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'port_in_request_sid' => payload['port_in_request_sid'],
        'url' => payload['url'],
    }

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

Instance Method Details

#contextPortingPortInContext

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

Returns:



154
155
156
157
158
159
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 154

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

#deleteBoolean

Delete the PortingPortInInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



176
177
178
179
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 176

def delete

    context.delete
end

#inspectObject

Provide a detailed, user friendly representation



190
191
192
193
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 190

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

#port_in_request_sidString

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

Returns:

  • (String)

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



163
164
165
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 163

def port_in_request_sid
    @properties['port_in_request_sid']
end

#to_sObject

Provide a user friendly representation



183
184
185
186
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 183

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

#urlString

Returns:

  • (String)


169
170
171
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 169

def url
    @properties['url']
end