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, 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) (defaults to: nil)

    The SID of the Call resource to fetch.



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 132

def initialize(version, payload , sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_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 = { 'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString

Returns A 34 character string that uniquely identifies the account.

Returns:

  • (String)

    A 34 character string that uniquely identifies the account.



173
174
175
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 173

def 
    @properties['account_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:



158
159
160
161
162
163
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 158

def context
    unless @instance_context
        @instance_context = BulkHostedNumberOrderContext.new(@version , @params['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:



203
204
205
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 203

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:



197
198
199
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 197

def date_created
    @properties['date_created']
end

#fetch(order_status: :unset) ⇒ BulkHostedNumberOrderInstance

Fetch the BulkHostedNumberOrderInstance

Parameters:

Returns:



229
230
231
232
233
234
235
236
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 229

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:

  • (String)

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



185
186
187
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 185

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



247
248
249
250
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 247

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:

  • (String)

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



191
192
193
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 191

def notification_email
    @properties['notification_email']
end

#request_statusRequestStatus

Returns:

  • (RequestStatus)


179
180
181
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 179

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:



221
222
223
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 221

def results
    @properties['results']
end

#sidString

Returns A 34 character string that uniquely identifies this BulkHostedNumberOrder.

Returns:

  • (String)

    A 34 character string that uniquely identifies this BulkHostedNumberOrder.



167
168
169
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 167

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



240
241
242
243
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 240

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:

  • (String)

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



215
216
217
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 215

def total_count
    @properties['total_count']
end

#urlString

Returns The URL of this BulkHostedNumberOrder resource.

Returns:

  • (String)

    The URL of this BulkHostedNumberOrder resource.



209
210
211
# File 'lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb', line 209

def url
    @properties['url']
end