Class: Twilio::REST::Numbers::V2::BundleCloneContext

Inherits:
InstanceContext show all
Defined in:
lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, bundle_sid) ⇒ BundleCloneContext

Initialize the BundleCloneContext

Parameters:

  • version (Version)

    Version that contains the resource

  • bundle_sid (String)

    The unique string that identifies the Bundle to be cloned.



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

Parameters:

  • target_account_sid (String) (defaults to: nil)

    The SID of the [Account](www.twilio.com/docs/iam/api/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:



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' => ,
        '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

#inspectObject

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_sObject

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