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 (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 BulkHostedNumberOrder resource.

  • sid (String) —

    The SID of the Call resource to fetch.



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 265

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_sid ⇒ String

Returns A 34 character string that uniquely identifies this BulkHostedNumberOrder.

Returns:

  • (String) —

    A 34 character string that uniquely identifies this BulkHostedNumberOrder.



300
301
302
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 300

def bulk_hosting_sid
    @properties['bulk_hosting_sid']
end

#context ⇒ BulkHostedNumberOrderContext

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

Returns:



291
292
293
294
295
296
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 291

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

#date_completed ⇒ Time

Returns The date that this resource was completed, given as GMT RFC 2822 format.

Returns:

  • (Time) —

    The date that this resource was completed, given as GMT RFC 2822 format.



330
331
332
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 330

def date_completed
    @properties['date_completed']
end

#date_created ⇒ Time

Returns The date this resource was created, given as GMT RFC 2822 format.

Returns:

  • (Time) —

    The date this resource was created, given as GMT RFC 2822 format.



324
325
326
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 324

def date_created
    @properties['date_created']
end

#fetch(order_status: :unset) ⇒ BulkHostedNumberOrderInstance

Fetch the BulkHostedNumberOrderInstance

Parameters:

  • order_status (String) (defaults to: :unset) —

    Order status can be used for filtering on Hosted Number Order status values. To see a complete list of order statuses, please check 'https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/hosted-number-order-resource#status-values'.

Returns:



356
357
358
359
360
361
362
363
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 356

def fetch(
  order_status: :unset
)

    context.fetch(
        order_status: order_status, 
    )
end

#friendly_name ⇒ String

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

Returns:

  • (String) —

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



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

def friendly_name
    @properties['friendly_name']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



374
375
376
377
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 374

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

#notification_email ⇒ String

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

Returns:

  • (String) —

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



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

def notification_email
    @properties['notification_email']
end

#request_status ⇒ RequestStatus

Returns:

  • (RequestStatus)


306
307
308
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 306

def request_status
    @properties['request_status']
end

#results ⇒ Array<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 'https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/hosted-number-order-resource#status-values'.

Returns:

  • (Array<Hash>) —

    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 'https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/hosted-number-order-resource#status-values'.



348
349
350
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 348

def results
    @properties['results']
end

#to_s ⇒ Object

Provide a user friendly representation



367
368
369
370
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 367

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

#total_count ⇒ String

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

Returns:

  • (String) —

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



342
343
344
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 342

def total_count
    @properties['total_count']
end

#url ⇒ String

Returns The URL of this BulkHostedNumberOrder resource.

Returns:

  • (String) —

    The URL of this BulkHostedNumberOrder resource.



336
337
338
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 336

def url
    @properties['url']
end