Class: Twilio::REST::Numbers::V2::BundleCloneContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Numbers::V2::BundleCloneContext
- Defined in:
- lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb
Instance Method Summary collapse
-
#create(target_account_sid: nil, move_to_draft: :unset, friendly_name: :unset) ⇒ BundleCloneInstance
Create the BundleCloneInstance.
-
#initialize(version, bundle_sid) ⇒ BundleCloneContext
constructor
Initialize the BundleCloneContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, bundle_sid) ⇒ BundleCloneContext
Initialize the BundleCloneContext
49 50 51 52 53 54 55 56 57 |
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 49 def initialize(version, bundle_sid) super(version) # Path Solution @solution = { bundle_sid: bundle_sid, } @uri = "/RegulatoryCompliance/Bundles/#{@solution[:bundle_sid]}/Clones" end |
Instance Method Details
#create(target_account_sid: nil, move_to_draft: :unset, friendly_name: :unset) ⇒ BundleCloneInstance
Create the BundleCloneInstance
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 64 def create( target_account_sid: nil, move_to_draft: :unset, friendly_name: :unset ) data = Twilio::Values.of({ 'TargetAccountSid' => target_account_sid, 'MoveToDraft' => move_to_draft, 'FriendlyName' => friendly_name, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.create('POST', @uri, data: data, headers: headers) BundleCloneInstance.new( @version, payload, bundle_sid: @solution[:bundle_sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
100 101 102 103 |
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 100 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Numbers.V2.BundleCloneContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
93 94 95 96 |
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 93 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Numbers.V2.BundleCloneContext #{context}>" end |