class Twilio::REST::Wireless::V1::RatePlanContext
Public Class Methods
new(version, sid)
click to toggle source
Initialize the RatePlanContext
@param [Version] version Version
that contains the resource @param [String] sid The SID of the RatePlan resource to fetch. @return [RatePlanContext] RatePlanContext
Calls superclass method
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/wireless/v1/rate_plan.rb 206 def initialize(version, sid) 207 super(version) 208 209 # Path Solution 210 @solution = {sid: sid, } 211 @uri = "/RatePlans/#{@solution[:sid]}" 212 end
Public Instance Methods
delete()
click to toggle source
Delete the RatePlanInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/wireless/v1/rate_plan.rb 242 def delete 243 @version.delete('DELETE', @uri) 244 end
fetch()
click to toggle source
Fetch the RatePlanInstance
@return [RatePlanInstance] Fetched RatePlanInstance
# File lib/twilio-ruby/rest/wireless/v1/rate_plan.rb 217 def fetch 218 payload = @version.fetch('GET', @uri) 219 220 RatePlanInstance.new(@version, payload, sid: @solution[:sid], ) 221 end
inspect()
click to toggle source
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/wireless/v1/rate_plan.rb 255 def inspect 256 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 257 "#<Twilio.Wireless.V1.RatePlanContext #{context}>" 258 end
to_s()
click to toggle source
Provide a user friendly representation
# File lib/twilio-ruby/rest/wireless/v1/rate_plan.rb 248 def to_s 249 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 250 "#<Twilio.Wireless.V1.RatePlanContext #{context}>" 251 end
update(unique_name: :unset, friendly_name: :unset)
click to toggle source
Update the RatePlanInstance
@param [String] unique_name An application-defined string that uniquely
identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource.
@param [String] friendly_name A descriptive string that you create to describe
the resource. It does not have to be unique.
@return [RatePlanInstance] Updated RatePlanInstance
# File lib/twilio-ruby/rest/wireless/v1/rate_plan.rb 231 def update(unique_name: :unset, friendly_name: :unset) 232 data = Twilio::Values.of({'UniqueName' => unique_name, 'FriendlyName' => friendly_name, }) 233 234 payload = @version.update('POST', @uri, data: data) 235 236 RatePlanInstance.new(@version, payload, sid: @solution[:sid], ) 237 end