Class: Twilio::REST::Memory::V1::DataMappingContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Memory::V1::DataMappingContext
- Defined in:
- lib/twilio-ruby/rest/memory/v1/data_mapping.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the DataMappingInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the DataMappingInstanceMetadata.
-
#fetch ⇒ DataMappingInstance
Fetch the DataMappingInstance.
-
#fetch_with_metadata ⇒ DataMappingInstance
Fetch the DataMappingInstanceMetadata.
-
#initialize(version, store_id, data_mapping_id) ⇒ DataMappingContext
constructor
Initialize the DataMappingContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#patch(if_match: :unset, data_mapping_core: :unset) ⇒ DataMappingInstance
Patch the DataMappingInstance.
-
#patch_with_metadata(if_match: :unset, data_mapping_core: :unset) ⇒ DataMappingInstance
Patch the DataMappingInstanceMetadata.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, store_id, data_mapping_id) ⇒ DataMappingContext
Initialize the DataMappingContext
377 378 379 380 381 382 383 384 385 386 387 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 377 def initialize(version, store_id, data_mapping_id) apiV1Version = ApiV1Version.new version.domain, version super(apiV1Version) # Path Solution @solution = { store_id: store_id, data_mapping_id: data_mapping_id, } @uri = "/ControlPlane/Stores/#{@solution[:store_id]}/DataMappings/#{@solution[:data_mapping_id]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the DataMappingInstance
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 391 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) DataMappingInstance.new( @version, response.body, store_id: @solution[:store_id], data_mapping_id: @solution[:data_mapping_id], ) end |
#delete_with_metadata ⇒ Boolean
Delete the DataMappingInstanceMetadata
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 410 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) dataMapping_instance = DataMappingInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) DataMappingInstanceMetadata.new(@version, dataMapping_instance, response.headers, response.status_code) end |
#fetch ⇒ DataMappingInstance
Fetch the DataMappingInstance
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 429 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) DataMappingInstance.new( @version, payload, store_id: @solution[:store_id], data_mapping_id: @solution[:data_mapping_id], ) end |
#fetch_with_metadata ⇒ DataMappingInstance
Fetch the DataMappingInstanceMetadata
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 449 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) data_mapping_instance = DataMappingInstance.new( @version, response.body, store_id: @solution[:store_id], data_mapping_id: @solution[:data_mapping_id], ) DataMappingInstanceMetadata.new( @version, data_mapping_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
538 539 540 541 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 538 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Memory.V1.DataMappingContext #{context}>" end |
#patch(if_match: :unset, data_mapping_core: :unset) ⇒ DataMappingInstance
Patch the DataMappingInstance
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 477 def patch( if_match: :unset, data_mapping_core: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'If-Match' => if_match, }) headers['Content-Type'] = 'application/json' payload = @version.patch('PATCH', @uri, headers: headers, data: data_mapping_core.to_json) DataMappingInstance.new( @version, payload, store_id: @solution[:store_id], data_mapping_id: @solution[:data_mapping_id], ) end |
#patch_with_metadata(if_match: :unset, data_mapping_core: :unset) ⇒ DataMappingInstance
Patch the DataMappingInstanceMetadata
502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 502 def ( if_match: :unset, data_mapping_core: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'If-Match' => if_match, }) headers['Content-Type'] = 'application/json' response = @version.('PATCH', @uri, headers: headers, data: data_mapping_core.to_json) data_mapping_instance = DataMappingInstance.new( @version, response.body, store_id: @solution[:store_id], data_mapping_id: @solution[:data_mapping_id], ) DataMappingInstanceMetadata.new( @version, data_mapping_instance, response.headers, response.status_code ) end |
#to_s ⇒ Object
Provide a user friendly representation
531 532 533 534 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 531 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Memory.V1.DataMappingContext #{context}>" end |