Class: Twilio::REST::Wireless::V1::RatePlanContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Wireless::V1::RatePlanContext
- Defined in:
- lib/twilio-ruby/rest/wireless/v1/rate_plan.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the RatePlanInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the RatePlanInstanceMetadata.
-
#fetch ⇒ RatePlanInstance
Fetch the RatePlanInstance.
-
#fetch_with_metadata ⇒ RatePlanInstance
Fetch the RatePlanInstanceMetadata.
-
#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.
-
#update_with_metadata(unique_name: :unset, friendly_name: :unset) ⇒ RatePlanInstance
Update the RatePlanInstanceMetadata.
Constructor Details
#initialize(version, sid) ⇒ RatePlanContext
Initialize the RatePlanContext
289 290 291 292 293 294 295 296 297 298 |
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 289 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/RatePlans/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the RatePlanInstance
302 303 304 305 306 307 308 309 310 |
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 302 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#delete_with_metadata ⇒ Boolean
Delete the RatePlanInstanceMetadata
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 315 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) ratePlan_instance = RatePlanInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) RatePlanInstanceMetadata.new(@version, ratePlan_instance, response.headers, response.status_code) end |
#fetch ⇒ RatePlanInstance
Fetch the RatePlanInstance
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 334 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 |
#fetch_with_metadata ⇒ RatePlanInstance
Fetch the RatePlanInstanceMetadata
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 |
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 353 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) rate_plan_instance = RatePlanInstance.new( @version, response.body, sid: @solution[:sid], ) RatePlanInstanceMetadata.new( @version, rate_plan_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
449 450 451 452 |
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 449 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Wireless.V1.RatePlanContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
442 443 444 445 |
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 442 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Wireless.V1.RatePlanContext #{context}>" end |
#update(unique_name: :unset, friendly_name: :unset) ⇒ RatePlanInstance
Update the RatePlanInstance
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 380 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 |
#update_with_metadata(unique_name: :unset, friendly_name: :unset) ⇒ RatePlanInstance
Update the RatePlanInstanceMetadata
409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 |
# File 'lib/twilio-ruby/rest/wireless/v1/rate_plan.rb', line 409 def ( 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', }) response = @version.('POST', @uri, data: data, headers: headers) rate_plan_instance = RatePlanInstance.new( @version, response.body, sid: @solution[:sid], ) RatePlanInstanceMetadata.new( @version, rate_plan_instance, response.headers, response.status_code ) end |