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
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
188 189 190 191 192 193 194 195 196 |
# File 'lib/twilio-ruby/rest/preview/wireless/rate_plan.rb', line 188 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/RatePlans/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the RatePlanInstance
200 201 202 203 204 205 206 207 |
# File 'lib/twilio-ruby/rest/preview/wireless/rate_plan.rb', line 200 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ RatePlanInstance
Fetch the RatePlanInstance
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/twilio-ruby/rest/preview/wireless/rate_plan.rb', line 212 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) RatePlanInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
267 268 269 270 |
# File 'lib/twilio-ruby/rest/preview/wireless/rate_plan.rb', line 267 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Wireless.RatePlanContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
260 261 262 263 |
# File 'lib/twilio-ruby/rest/preview/wireless/rate_plan.rb', line 260 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
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/twilio-ruby/rest/preview/wireless/rate_plan.rb', line 233 def update( unique_name: :unset, friendly_name: :unset ) data = Twilio::Values.of({ 'UniqueName' => unique_name, 'FriendlyName' => friendly_name, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) RatePlanInstance.new( @version, payload, sid: @solution[:sid], ) end |