Class: Twilio::REST::Numbers::V2::RegulatoryComplianceList::BundleContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb,
lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb,
lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.rb,
lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/replace_items.rb,
lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.rb

Defined Under Namespace

Classes: BundleCopyInstance, BundleCopyList, BundleCopyPage, EvaluationContext, EvaluationInstance, EvaluationList, EvaluationPage, ItemAssignmentContext, ItemAssignmentInstance, ItemAssignmentList, ItemAssignmentPage, ReplaceItemsInstance, ReplaceItemsList, ReplaceItemsPage

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ BundleContext

Initialize the BundleContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

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


292
293
294
295
296
297
298
299
300
301
302
303
304
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 292

def initialize(version, sid)
  super(version)

  # Path Solution
  @solution = {sid: sid, }
  @uri = "/RegulatoryCompliance/Bundles/#{@solution[:sid]}"

  # Dependents
  @evaluations = nil
  @item_assignments = nil
  @bundle_copies = nil
  @replace_items = nil
end

Instance Method Details

#bundle_copiesBundleCopyList, BundleCopyContext

Access the bundle_copies

Returns:


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

def bundle_copies
  unless @bundle_copies
    @bundle_copies = BundleCopyList.new(@version, bundle_sid: @solution[:sid], )
  end

  @bundle_copies
end

#deleteBoolean

Delete the BundleInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


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

def delete
   @version.delete('DELETE', @uri)
end

#evaluations(sid = :unset) ⇒ EvaluationList, EvaluationContext

Access the evaluations

Returns:

Raises:

  • (ArgumentError)

349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 349

def evaluations(sid=:unset)
  raise ArgumentError, 'sid cannot be nil' if sid.nil?

  if sid != :unset
    return EvaluationContext.new(@version, @solution[:sid], sid, )
  end

  unless @evaluations
    @evaluations = EvaluationList.new(@version, bundle_sid: @solution[:sid], )
  end

  @evaluations
end

#fetchBundleInstance

Fetch the BundleInstance

Returns:


309
310
311
312
313
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 309

def fetch
  payload = @version.fetch('GET', @uri)

  BundleInstance.new(@version, payload, sid: @solution[:sid], )
end

#inspectObject

Provide a detailed, user friendly representation


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

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Numbers.V2.BundleContext #{context}>"
end

#item_assignments(sid = :unset) ⇒ ItemAssignmentList, ItemAssignmentContext

Access the item_assignments

Returns:

Raises:

  • (ArgumentError)

367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 367

def item_assignments(sid=:unset)
  raise ArgumentError, 'sid cannot be nil' if sid.nil?

  if sid != :unset
    return ItemAssignmentContext.new(@version, @solution[:sid], sid, )
  end

  unless @item_assignments
    @item_assignments = ItemAssignmentList.new(@version, bundle_sid: @solution[:sid], )
  end

  @item_assignments
end

#replace_itemsReplaceItemsList, ReplaceItemsContext

Access the replace_items

Returns:


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

def replace_items
  unless @replace_items
    @replace_items = ReplaceItemsList.new(@version, bundle_sid: @solution[:sid], )
  end

  @replace_items
end

#to_sObject

Provide a user friendly representation


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

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Numbers.V2.BundleContext #{context}>"
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:


325
326
327
328
329
330
331
332
333
334
335
336
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 325

def update(status: :unset, status_callback: :unset, friendly_name: :unset, email: :unset)
  data = Twilio::Values.of({
      'Status' => status,
      'StatusCallback' => status_callback,
      'FriendlyName' => friendly_name,
      'Email' => email,
  })

  payload = @version.update('POST', @uri, data: data)

  BundleInstance.new(@version, payload, sid: @solution[:sid], )
end