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
371 372 373 374 375 376 377 378 379 380 381 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 371 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
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 385 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
404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 404 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
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 423 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
443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 443 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
532 533 534 535 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 532 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
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 471 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
496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 496 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
525 526 527 528 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 525 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Memory.V1.DataMappingContext #{context}>" end |