Class: Twilio::REST::Numbers::V2::BundleCloneInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, bundle_sid: nil) ⇒ BundleCloneInstance

Initialize the BundleCloneInstance



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 292

def initialize(version, payload , bundle_sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'bundle_sid' => payload['bundle_sid'],
        'account_sid' => payload['account_sid'],
        'regulation_sid' => payload['regulation_sid'],
        'friendly_name' => payload['friendly_name'],
        'status' => payload['status'],
        'valid_until' => Twilio.deserialize_iso8601_datetime(payload['valid_until']),
        'email' => payload['email'],
        'status_callback' => payload['status_callback'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'url' => payload['url'],
    }

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

Instance Method Details

#account_sidString



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

def 
    @properties['account_sid']
end

#bundle_sidString



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

def bundle_sid
    @properties['bundle_sid']
end

#contextBundleCloneContext

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



320
321
322
323
324
325
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 320

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

#create(target_account_sid: nil, move_to_draft: :unset, friendly_name: :unset) ⇒ BundleCloneInstance

Create the BundleCloneInstance



399
400
401
402
403
404
405
406
407
408
409
410
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 399

def create(
    target_account_sid: nil, 
    move_to_draft: :unset, 
    friendly_name: :unset
)

    context.create(
        target_account_sid: , 
        move_to_draft: move_to_draft, 
        friendly_name: friendly_name, 
    )
end

#date_createdTime



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

def date_created
    @properties['date_created']
end

#date_updatedTime



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

def date_updated
    @properties['date_updated']
end

#emailString



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

def email
    @properties['email']
end

#friendly_nameString



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

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



421
422
423
424
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 421

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

#regulation_sidString



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

def regulation_sid
    @properties['regulation_sid']
end

#statusStatus



353
354
355
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 353

def status
    @properties['status']
end

#status_callbackString



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

def status_callback
    @properties['status_callback']
end

#to_sObject

Provide a user friendly representation



414
415
416
417
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 414

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

#urlString



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

def url
    @properties['url']
end

#valid_untilTime



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

def valid_until
    @properties['valid_until']
end