Class: Twilio::REST::Numbers::V2::RegulatoryComplianceList::BundleInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb

Instance Method Summary collapse

Constructor Details

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

Initialize the BundleInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • sid (String) (defaults to: nil)

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



331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 331

def initialize(version, payload, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'account_sid' => payload['account_sid'],
      'regulation_sid' => payload['regulation_sid'],
      'friendly_name' => payload['friendly_name'],
      'status' => payload['status'],
      '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'],
      'links' => payload['links'],
  }

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

Instance Method Details

#account_sidString

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource



373
374
375
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 373

def 
  @properties['account_sid']
end

#contextBundleContext

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

Returns:



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

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

#date_createdTime

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

Returns:

  • (Time)

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



409
410
411
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 409

def date_created
  @properties['date_created']
end

#date_updatedTime

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

Returns:

  • (Time)

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



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

def date_updated
  @properties['date_updated']
end

#emailString

Returns The email address.

Returns:

  • (String)

    The email address



397
398
399
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 397

def email
  @properties['email']
end

#fetchBundleInstance

Fetch a BundleInstance

Returns:



434
435
436
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 434

def fetch
  context.fetch
end

#friendly_nameString

Returns The string that you assigned to describe the resource.

Returns:

  • (String)

    The string that you assigned to describe the resource



385
386
387
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 385

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



473
474
475
476
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 473

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

#item_assignmentsitem_assignments

Access the item_assignments

Returns:



460
461
462
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 460

def item_assignments
  context.item_assignments
end

Returns The URLs of the Assigned Items of the Bundle resource.

Returns:

  • (String)

    The URLs of the Assigned Items of the Bundle resource



427
428
429
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 427

def links
  @properties['links']
end

#regulation_sidString

Returns The unique string of a regulation.

Returns:

  • (String)

    The unique string of a regulation.



379
380
381
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 379

def regulation_sid
  @properties['regulation_sid']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource.



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

def sid
  @properties['sid']
end

#statusbundle.Status

Returns The verification status of the Bundle resource.

Returns:

  • (bundle.Status)

    The verification status of the Bundle resource



391
392
393
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 391

def status
  @properties['status']
end

#status_callbackString

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.



403
404
405
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 403

def status_callback
  @properties['status_callback']
end

#to_sObject

Provide a user friendly representation



466
467
468
469
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 466

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

#update(status: :unset, status_callback: :unset, friendly_name: :unset, email: :unset) ⇒ BundleInstance

Update the BundleInstance

Parameters:

  • status (bundle.Status) (defaults to: :unset)

    The verification status of the Bundle resource.

  • status_callback (String) (defaults to: :unset)

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

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

    The string that you assigned to describe the resource.

  • email (String) (defaults to: :unset)

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

Returns:



448
449
450
451
452
453
454
455
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 448

def update(status: :unset, status_callback: :unset, friendly_name: :unset, email: :unset)
  context.update(
      status: status,
      status_callback: status_callback,
      friendly_name: friendly_name,
      email: email,
  )
end

#urlString

Returns The absolute URL of the Bundle resource.

Returns:

  • (String)

    The absolute URL of the Bundle resource



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

def url
  @properties['url']
end