Class: Twilio::REST::Numbers::V2::BundleCloneInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, bundle_sid: nil) ⇒ BundleCloneInstance

Initialize the BundleCloneInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this BundleClone resource.

  • sid (String)

    The SID of the Call resource to fetch.



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 140

def initialize(version, payload , bundle_sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'bundle_sid' => payload['bundle_sid'],
        'account_sid' => payload['account_sid'],
        'regulation_sid' => payload['regulation_sid'],
        'friendly_name' => payload['friendly_name'],
        'status' => payload['status'],
        'valid_until' => Twilio.deserialize_iso8601_datetime(payload['valid_until']),
        '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'],
    }

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

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Bundle resource.

Returns:



182
183
184
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 182

def 
    @properties['account_sid']
end

#bundle_sidString

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

Returns:

  • (String)

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



176
177
178
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 176

def bundle_sid
    @properties['bundle_sid']
end

#contextBundleCloneContext

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

Returns:



167
168
169
170
171
172
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 167

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

#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:



246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 246

def create(
    target_account_sid: nil, 
    move_to_draft: :unset, 
    friendly_name: :unset
)

    context.create(
        target_account_sid: , 
        move_to_draft: move_to_draft, 
        friendly_name: friendly_name, 
    )
end

#date_createdTime

Returns The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



224
225
226
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 224

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



230
231
232
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 230

def date_updated
    @properties['date_updated']
end

#emailString

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

Returns:

  • (String)

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



212
213
214
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 212

def email
    @properties['email']
end

#friendly_nameString

Returns The string that you assigned to describe the resource.

Returns:

  • (String)

    The string that you assigned to describe the resource.



194
195
196
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 194

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



268
269
270
271
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 268

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

#regulation_sidString

Returns The unique string of a regulation that is associated to the Bundle resource.

Returns:

  • (String)

    The unique string of a regulation that is associated to the Bundle resource.



188
189
190
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 188

def regulation_sid
    @properties['regulation_sid']
end

#statusStatus

Returns:

  • (Status)


200
201
202
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 200

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.



218
219
220
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 218

def status_callback
    @properties['status_callback']
end

#to_sObject

Provide a user friendly representation



261
262
263
264
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 261

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

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



236
237
238
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 236

def url
    @properties['url']
end

#valid_untilTime

Returns The date and time in GMT in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format when the resource will be valid until.

Returns:



206
207
208
# File 'lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb', line 206

def valid_until
    @properties['valid_until']
end