Class: Twilio::REST::Numbers::V1::PortingBulkPortabilityInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ PortingBulkPortabilityInstance

Initialize the PortingBulkPortabilityInstance

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 PortingBulkPortability resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb', line 145

def initialize(version, payload , sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'status' => payload['status'],
        'datetime_created' => Twilio.deserialize_iso8601_datetime(payload['datetime_created']),
        'phone_numbers' => payload['phone_numbers'],
        'url' => payload['url'],
    }

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

Instance Method Details

#contextPortingBulkPortabilityContext

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

Returns:



166
167
168
169
170
171
# File 'lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb', line 166

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

#datetime_createdTime

Returns The date that the Portability check was created, given in ISO 8601 format.

Returns:

  • (Time)

    The date that the Portability check was created, given in ISO 8601 format.



187
188
189
# File 'lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb', line 187

def datetime_created
    @properties['datetime_created']
end

#fetchPortingBulkPortabilityInstance

Fetch the PortingBulkPortabilityInstance

Returns:



206
207
208
209
# File 'lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb', line 206

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



220
221
222
223
# File 'lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb', line 220

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

#phone_numbersArray<Hash>

Returns Contains a list with all the information of the requested phone numbers. Each phone number contains the following properties: ‘phone_number`: The phone number which portability is to be checked. `portable`: Boolean flag specifying if phone number is portable or not. `not_portable_reason`: Reason why the phone number cannot be ported into Twilio, `null` otherwise. `not_portable_reason_code`: The Portability Reason Code for the phone number if it cannot be ported in Twilio, `null` otherwise. `pin_and_account_number_required`: Boolean flag specifying if PIN and account number is required for the phone number. `number_type`: The type of the requested phone number. `country` Country the phone number belongs to. `messaging_carrier` Current messaging carrier of the phone number. `voice_carrier` Current voice carrier of the phone number.

Returns:

  • (Array<Hash>)

    Contains a list with all the information of the requested phone numbers. Each phone number contains the following properties: ‘phone_number`: The phone number which portability is to be checked. `portable`: Boolean flag specifying if phone number is portable or not. `not_portable_reason`: Reason why the phone number cannot be ported into Twilio, `null` otherwise. `not_portable_reason_code`: The Portability Reason Code for the phone number if it cannot be ported in Twilio, `null` otherwise. `pin_and_account_number_required`: Boolean flag specifying if PIN and account number is required for the phone number. `number_type`: The type of the requested phone number. `country` Country the phone number belongs to. `messaging_carrier` Current messaging carrier of the phone number. `voice_carrier` Current voice carrier of the phone number.



193
194
195
# File 'lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb', line 193

def phone_numbers
    @properties['phone_numbers']
end

#sidString

Returns A 34 character string that uniquely identifies this Portability check.

Returns:

  • (String)

    A 34 character string that uniquely identifies this Portability check.



175
176
177
# File 'lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb', line 175

def sid
    @properties['sid']
end

#statusStatus

Returns:

  • (Status)


181
182
183
# File 'lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb', line 181

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



213
214
215
216
# File 'lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb', line 213

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

#urlString

Returns This is the url of the request that you’re trying to reach out to locate the resource.

Returns:

  • (String)

    This is the url of the request that you’re trying to reach out to locate the resource.



199
200
201
# File 'lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb', line 199

def url
    @properties['url']
end