Class: Twilio::REST::Numbers::V2::HostedNumberOrderContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ HostedNumberOrderContext

Initialize the HostedNumberOrderContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The SID of the HostedNumberOrder resource to update.



236
237
238
239
240
241
242
243
244
# File 'lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb', line 236

def initialize(version, sid)
    super(version)

    # Path Solution
    @solution = { sid: sid,  }
    @uri = "/HostedNumber/Orders/#{@solution[:sid]}"

    
end

Instance Method Details

#deleteBoolean

Delete the HostedNumberOrderInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



248
249
250
251
252
253
254
255
# File 'lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb', line 248

def delete

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

#fetchHostedNumberOrderInstance

Fetch the HostedNumberOrderInstance

Returns:



260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb', line 260

def fetch

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

#inspectObject

Provide a detailed, user friendly representation



318
319
320
321
# File 'lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb', line 318

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

#to_sObject

Provide a user friendly representation



311
312
313
314
# File 'lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb', line 311

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

#update(status: nil, verification_call_delay: :unset, verification_call_extension: :unset) ⇒ HostedNumberOrderInstance

Update the HostedNumberOrderInstance

Parameters:

  • status (Status) (defaults to: nil)
  • verification_call_delay (String) (defaults to: :unset)

    The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive.

  • verification_call_extension (String) (defaults to: :unset)

    The numerical extension to dial when making the ownership verification call.

Returns:



282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb', line 282

def update(
    status: nil, 
    verification_call_delay: :unset, 
    verification_call_extension: :unset
)

    data = Twilio::Values.of({
        'Status' => status,
        'VerificationCallDelay' => verification_call_delay,
        'VerificationCallExtension' => verification_call_extension,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.update('POST', @uri, data: data, headers: headers)
    HostedNumberOrderInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end