Class: Twilio::REST::Numbers::V2::RegulatoryComplianceList::BundleContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Numbers::V2::RegulatoryComplianceList::BundleContext
- 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, BundleCopyListResponse, BundleCopyPage, BundleCopyPageMetadata, EvaluationContext, EvaluationInstance, EvaluationInstanceMetadata, EvaluationList, EvaluationListResponse, EvaluationPage, EvaluationPageMetadata, ItemAssignmentContext, ItemAssignmentInstance, ItemAssignmentInstanceMetadata, ItemAssignmentList, ItemAssignmentListResponse, ItemAssignmentPage, ItemAssignmentPageMetadata, ReplaceItemsInstance, ReplaceItemsList, ReplaceItemsListResponse, ReplaceItemsPage, ReplaceItemsPageMetadata
Instance Method Summary collapse
-
#bundle_copies ⇒ BundleCopyList, BundleCopyContext
Access the bundle_copies.
-
#delete ⇒ Boolean
Delete the BundleInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the BundleInstanceMetadata.
-
#evaluations(sid = :unset) ⇒ EvaluationList, EvaluationContext
Access the evaluations.
-
#fetch ⇒ BundleInstance
Fetch the BundleInstance.
-
#fetch_with_metadata ⇒ BundleInstance
Fetch the BundleInstanceMetadata.
-
#initialize(version, sid) ⇒ BundleContext
constructor
Initialize the BundleContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#item_assignments(sid = :unset) ⇒ ItemAssignmentList, ItemAssignmentContext
Access the item_assignments.
-
#replace_items ⇒ ReplaceItemsList, ReplaceItemsContext
Access the replace_items.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(status: :unset, status_callback: :unset, friendly_name: :unset, email: :unset) ⇒ BundleInstance
Update the BundleInstance.
-
#update_with_metadata(status: :unset, status_callback: :unset, friendly_name: :unset, email: :unset) ⇒ BundleInstance
Update the BundleInstanceMetadata.
Constructor Details
#initialize(version, sid) ⇒ BundleContext
Initialize the BundleContext
371 372 373 374 375 376 377 378 379 380 381 382 383 384 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 371 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/RegulatoryCompliance/Bundles/#{@solution[:sid]}" # Dependents @replace_items = nil @bundle_copies = nil @item_assignments = nil @evaluations = nil end |
Instance Method Details
#bundle_copies ⇒ BundleCopyList, BundleCopyContext
Access the bundle_copies
552 553 554 555 556 557 558 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 552 def bundle_copies unless @bundle_copies @bundle_copies = BundleCopyList.new( @version, bundle_sid: @solution[:sid], ) end @bundle_copies end |
#delete ⇒ Boolean
Delete the BundleInstance
388 389 390 391 392 393 394 395 396 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 388 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#delete_with_metadata ⇒ Boolean
Delete the BundleInstanceMetadata
401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 401 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) bundle_instance = BundleInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) BundleInstanceMetadata.new(@version, bundle_instance, response.headers, response.status_code) end |
#evaluations(sid = :unset) ⇒ EvaluationList, EvaluationContext
Access the evaluations
582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 582 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 |
#fetch ⇒ BundleInstance
Fetch the BundleInstance
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 420 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) BundleInstance.new( @version, payload, sid: @solution[:sid], ) end |
#fetch_with_metadata ⇒ BundleInstance
Fetch the BundleInstanceMetadata
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 439 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) bundle_instance = BundleInstance.new( @version, response.body, sid: @solution[:sid], ) BundleInstanceMetadata.new( @version, bundle_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
607 608 609 610 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 607 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
563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 563 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_items ⇒ ReplaceItemsList, ReplaceItemsContext
Access the replace_items
541 542 543 544 545 546 547 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 541 def replace_items unless @replace_items @replace_items = ReplaceItemsList.new( @version, bundle_sid: @solution[:sid], ) end @replace_items end |
#to_s ⇒ Object
Provide a user friendly representation
600 601 602 603 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 600 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
468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 468 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, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) BundleInstance.new( @version, payload, sid: @solution[:sid], ) end |
#update_with_metadata(status: :unset, status_callback: :unset, friendly_name: :unset, email: :unset) ⇒ BundleInstance
Update the BundleInstanceMetadata
503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb', line 503 def ( status: :unset, status_callback: :unset, friendly_name: :unset, email: :unset ) data = Twilio::Values.of({ 'Status' => status, 'StatusCallback' => status_callback, 'FriendlyName' => friendly_name, 'Email' => email, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('POST', @uri, data: data, headers: headers) bundle_instance = BundleInstance.new( @version, response.body, sid: @solution[:sid], ) BundleInstanceMetadata.new( @version, bundle_instance, response.headers, response.status_code ) end |