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.



184
185
186
187
188
189
190
191
192
193
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 184

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



197
198
199
200
201
202
203
204
205
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 197

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    

    @version.delete('DELETE', @uri, headers: headers)
end

#delete_with_metadataBoolean

Delete the PortingPortInInstanceMetadata

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 210

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
      response = @version.('DELETE', @uri, headers: headers)
      portingPortIn_instance = PortingPortInInstance.new(
          @version,
          response.body,
          account_sid: @solution[:account_sid],
          sid: @solution[:sid],
      )
      PortingPortInInstanceMetadata.new(@version, portingPortIn_instance, response.headers, response.status_code)
end

#fetchPortingPortInInstance

Fetch the PortingPortInInstance

Returns:



229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 229

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

#fetch_with_metadataPortingPortInInstance

Fetch the PortingPortInInstanceMetadata

Returns:



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 248

def 

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

#inspectObject

Provide a detailed, user friendly representation



280
281
282
283
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 280

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

#to_sObject

Provide a user friendly representation



273
274
275
276
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 273

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