class Twilio::REST::Voice::V1::ConnectionPolicyInstance

Public Class Methods

new(version, payload, sid: nil) click to toggle source

Initialize the ConnectionPolicyInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] sid The unique string that we created to identify the Connection

Policy resource to fetch.

@return [ConnectionPolicyInstance] ConnectionPolicyInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/voice/v1/connection_policy.rb
243 def initialize(version, payload, sid: nil)
244   super(version)
245 
246   # Marshaled Properties
247   @properties = {
248       'account_sid' => payload['account_sid'],
249       'sid' => payload['sid'],
250       'friendly_name' => payload['friendly_name'],
251       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
252       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
253       'url' => payload['url'],
254       'links' => payload['links'],
255   }
256 
257   # Context
258   @instance_context = nil
259   @params = {'sid' => sid || @properties['sid'], }
260 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/voice/v1/connection_policy.rb
275 def account_sid
276   @properties['account_sid']
277 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [ConnectionPolicyContext] ConnectionPolicyContext for this ConnectionPolicyInstance

    # File lib/twilio-ruby/rest/voice/v1/connection_policy.rb
266 def context
267   unless @instance_context
268     @instance_context = ConnectionPolicyContext.new(@version, @params['sid'], )
269   end
270   @instance_context
271 end
date_created() click to toggle source

@return [Time] The RFC 2822 date and time in GMT when the resource was created

    # File lib/twilio-ruby/rest/voice/v1/connection_policy.rb
293 def date_created
294   @properties['date_created']
295 end
date_updated() click to toggle source

@return [Time] The RFC 2822 date and time in GMT when the resource was last updated

    # File lib/twilio-ruby/rest/voice/v1/connection_policy.rb
299 def date_updated
300   @properties['date_updated']
301 end
delete() click to toggle source

Delete the ConnectionPolicyInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/voice/v1/connection_policy.rb
334 def delete
335   context.delete
336 end
fetch() click to toggle source

Fetch the ConnectionPolicyInstance @return [ConnectionPolicyInstance] Fetched ConnectionPolicyInstance

    # File lib/twilio-ruby/rest/voice/v1/connection_policy.rb
318 def fetch
319   context.fetch
320 end
friendly_name() click to toggle source

@return [String] The string that you assigned to describe the resource

    # File lib/twilio-ruby/rest/voice/v1/connection_policy.rb
287 def friendly_name
288   @properties['friendly_name']
289 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/voice/v1/connection_policy.rb
354 def inspect
355   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
356   "<Twilio.Voice.V1.ConnectionPolicyInstance #{values}>"
357 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/voice/v1/connection_policy.rb
281 def sid
282   @properties['sid']
283 end
targets() click to toggle source

Access the targets @return [targets] targets

    # File lib/twilio-ruby/rest/voice/v1/connection_policy.rb
341 def targets
342   context.targets
343 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/voice/v1/connection_policy.rb
347 def to_s
348   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
349   "<Twilio.Voice.V1.ConnectionPolicyInstance #{values}>"
350 end
update(friendly_name: :unset) click to toggle source

Update the ConnectionPolicyInstance @param [String] friendly_name A descriptive string that you create to describe

the resource. It is not unique and can be up to 255 characters long.

@return [ConnectionPolicyInstance] Updated ConnectionPolicyInstance

    # File lib/twilio-ruby/rest/voice/v1/connection_policy.rb
327 def update(friendly_name: :unset)
328   context.update(friendly_name: friendly_name, )
329 end
url() click to toggle source

@return [String] The absolute URL of the resource

    # File lib/twilio-ruby/rest/voice/v1/connection_policy.rb
305 def url
306   @properties['url']
307 end