Class: Twilio::REST::Numbers::V2::BulkHostedNumberOrderInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, bulk_hosting_sid: nil) ⇒ BulkHostedNumberOrderInstance

Initialize the BulkHostedNumberOrderInstance

Parameters:

  • Version that contains the resource

  • payload that contains response from Twilio

  • The SID of the Account that created this BulkHostedNumberOrder resource.

  • The SID of the Call resource to fetch.



324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 324

def initialize(version, payload , bulk_hosting_sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'bulk_hosting_sid' => payload['bulk_hosting_sid'],
        'request_status' => payload['request_status'],
        'friendly_name' => payload['friendly_name'],
        'notification_email' => payload['notification_email'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_completed' => Twilio.deserialize_iso8601_datetime(payload['date_completed']),
        'url' => payload['url'],
        'total_count' => payload['total_count'] == nil ? payload['total_count'] : payload['total_count'].to_i,
        'results' => payload['results'],
    }

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

Instance Method Details

#bulk_hosting_sidString

Returns A 34 character string that uniquely identifies this BulkHostedNumberOrder.

Returns:

  • A 34 character string that uniquely identifies this BulkHostedNumberOrder.



359
360
361
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 359

def bulk_hosting_sid
    @properties['bulk_hosting_sid']
end

#contextBulkHostedNumberOrderContext

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

Returns:

  • CallContext for this CallInstance



350
351
352
353
354
355
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 350

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

#date_completedTime

Returns The date that this resource was completed, given as [GMT RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



389
390
391
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 389

def date_completed
    @properties['date_completed']
end

#date_createdTime

Returns The date this resource was created, given as [GMT RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



383
384
385
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 383

def date_created
    @properties['date_created']
end

#fetch(order_status: :unset) ⇒ BulkHostedNumberOrderInstance

Fetch the BulkHostedNumberOrderInstance

Parameters:

Returns:

  • Fetched BulkHostedNumberOrderInstance



415
416
417
418
419
420
421
422
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 415

def fetch(
    order_status: :unset
)

    context.fetch(
        order_status: order_status, 
    )
end

#friendly_nameString

Returns A 128 character string that is a human-readable text that describes this resource.

Returns:

  • A 128 character string that is a human-readable text that describes this resource.



371
372
373
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 371

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



433
434
435
436
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 433

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

#notification_emailString

Returns Email address used for send notifications about this Bulk hosted number request.

Returns:

  • Email address used for send notifications about this Bulk hosted number request.



377
378
379
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 377

def notification_email
    @properties['notification_email']
end

#request_statusRequestStatus

Returns:



365
366
367
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 365

def request_status
    @properties['request_status']
end

#resultsArray<Hash>

Returns Contains a list of all the individual hosting orders and their information, for this Bulk request. Each result object is grouped by its order status. To see a complete list of order status, please check ‘www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/hosted-number-order-resource#status-values’.

Returns:



407
408
409
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 407

def results
    @properties['results']
end

#to_sObject

Provide a user friendly representation



426
427
428
429
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 426

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

#total_countString

Returns The total count of phone numbers in this Bulk hosting request.

Returns:

  • The total count of phone numbers in this Bulk hosting request.



401
402
403
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 401

def total_count
    @properties['total_count']
end

#urlString

Returns The URL of this BulkHostedNumberOrder resource.

Returns:

  • The URL of this BulkHostedNumberOrder resource.



395
396
397
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 395

def url
    @properties['url']
end