Class: Twilio::REST::Preview::Wireless::RatePlanContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Preview::Wireless::RatePlanContext
- Defined in:
- lib/twilio-ruby/rest/preview/wireless/rate_plan.rb
Overview
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the RatePlanInstance.
-
#fetch ⇒ RatePlanInstance
Fetch the RatePlanInstance.
-
#initialize(version, sid) ⇒ RatePlanContext
constructor
Initialize the RatePlanContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(unique_name: :unset, friendly_name: :unset) ⇒ RatePlanInstance
Update the RatePlanInstance.
Constructor Details
#initialize(version, sid) ⇒ RatePlanContext
Initialize the RatePlanContext
180 181 182 183 184 185 186 187 188 |
# File 'lib/twilio-ruby/rest/preview/wireless/rate_plan.rb', line 180 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/RatePlans/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the RatePlanInstance
192 193 194 195 |
# File 'lib/twilio-ruby/rest/preview/wireless/rate_plan.rb', line 192 def delete @version.delete('DELETE', @uri) end |
#fetch ⇒ RatePlanInstance
Fetch the RatePlanInstance
200 201 202 203 204 205 206 207 208 |
# File 'lib/twilio-ruby/rest/preview/wireless/rate_plan.rb', line 200 def fetch payload = @version.fetch('GET', @uri) RatePlanInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
243 244 245 246 |
# File 'lib/twilio-ruby/rest/preview/wireless/rate_plan.rb', line 243 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Wireless.RatePlanContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
236 237 238 239 |
# File 'lib/twilio-ruby/rest/preview/wireless/rate_plan.rb', line 236 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Wireless.RatePlanContext #{context}>" end |
#update(unique_name: :unset, friendly_name: :unset) ⇒ RatePlanInstance
Update the RatePlanInstance
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/twilio-ruby/rest/preview/wireless/rate_plan.rb', line 215 def update( unique_name: :unset, friendly_name: :unset ) data = Twilio::Values.of({ 'UniqueName' => unique_name, 'FriendlyName' => friendly_name, }) payload = @version.update('POST', @uri, data: data) RatePlanInstance.new( @version, payload, sid: @solution[:sid], ) end |