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

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

  • sid (String) —

    The SID of the Call resource to fetch.



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 233

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

Returns The SID of the Account that created the Bundle resource.

Returns:

  • (String) —

    The SID of the Account that created the Bundle resource.



276
277
278
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 276

def 
    @properties['account_sid']
end

#bundle_sid ⇒ String

Returns The unique string that we created to identify the Bundle resource.

Returns:

  • (String) —

    The unique string that we created to identify the Bundle resource.



270
271
272
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 270

def bundle_sid
    @properties['bundle_sid']
end

#context ⇒ BundleCloneContext

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

Returns:



261
262
263
264
265
266
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 261

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

Parameters:

  • target_account_sid (String) (defaults to: nil) —

    The SID of the Account where the bundle needs to be cloned.

  • move_to_draft (Boolean) (defaults to: :unset) —

    If set to true, the cloned bundle will be in the DRAFT state, else it will be twilio-approved

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

    The string that you assigned to describe the cloned bundle.

Returns:



340
341
342
343
344
345
346
347
348
349
350
351
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 340

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_created ⇒ Time

Returns The date and time in GMT when the resource was created specified in ISO 8601 format.

Returns:

  • (Time) —

    The date and time in GMT when the resource was created specified in ISO 8601 format.



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

def date_created
    @properties['date_created']
end

#date_updated ⇒ Time

Returns The date and time in GMT when the resource was last updated specified in ISO 8601 format.

Returns:

  • (Time) —

    The date and time in GMT when the resource was last updated specified in ISO 8601 format.



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

def date_updated
    @properties['date_updated']
end

#email ⇒ String

Returns The email address that will receive updates when the Bundle resource changes status.

Returns:

  • (String) —

    The email address that will receive updates when the Bundle resource changes status.



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

def email
    @properties['email']
end

#friendly_name ⇒ String

Returns The string that you assigned to describe the resource.

Returns:

  • (String) —

    The string that you assigned to describe the resource.



288
289
290
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 288

def friendly_name
    @properties['friendly_name']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



362
363
364
365
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 362

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

#regulation_sid ⇒ String

Returns The unique string of a regulation that is associated to the Bundle resource.

Returns:

  • (String) —

    The unique string of a regulation that is associated to the Bundle resource.



282
283
284
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 282

def regulation_sid
    @properties['regulation_sid']
end

#status ⇒ Status

Returns:

  • (Status)


294
295
296
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 294

def status
    @properties['status']
end

#status_callback ⇒ String

Returns The URL we call to inform your application of status changes.

Returns:

  • (String) —

    The URL we call to inform your application of status changes.



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

def status_callback
    @properties['status_callback']
end

#to_s ⇒ Object

Provide a user friendly representation



355
356
357
358
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 355

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

#url ⇒ String

Returns The URL of this resource.

Returns:

  • (String) —

    The URL of this resource.



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

def url
    @properties['url']
end

#valid_until ⇒ Time

Returns The date and time in GMT in ISO 8601 format when the resource will be valid until.

Returns:

  • (Time) —

    The date and time in GMT in ISO 8601 format when the resource will be valid until.



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

def valid_until
    @properties['valid_until']
end