Class: Twilio::REST::Memory::V1::ProfileContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Memory::V1::ProfileContext
- Defined in:
- lib/twilio-ruby/rest/memory/v1/profile.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the ProfileInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the ProfileInstanceMetadata.
-
#initialize(version, store_id, profile_id) ⇒ ProfileContext
constructor
Initialize the ProfileContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#patch(profile_patch: nil) ⇒ ProfileInstance
Patch the ProfileInstance.
-
#patch_with_metadata(profile_patch: nil) ⇒ ProfileInstance
Patch the ProfileInstanceMetadata.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, store_id, profile_id) ⇒ ProfileContext
Initialize the ProfileContext
283 284 285 286 287 288 289 290 291 292 293 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 283 def initialize(version, store_id, profile_id) apiV1Version = ApiV1Version.new version.domain, version super(apiV1Version) # Path Solution @solution = { store_id: store_id, profile_id: profile_id, } @uri = "/Stores/#{@solution[:store_id]}/Profiles/#{@solution[:profile_id]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the ProfileInstance
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 297 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) ProfileInstance.new( @version, response.body, store_id: @solution[:store_id], profile_id: @solution[:profile_id], ) end |
#delete_with_metadata ⇒ Boolean
Delete the ProfileInstanceMetadata
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 316 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) profile_instance = ProfileInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) ProfileInstanceMetadata.new(@version, profile_instance, response.headers, response.status_code) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
392 393 394 395 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 392 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Memory.V1.ProfileContext #{context}>" end |
#patch(profile_patch: nil) ⇒ ProfileInstance
Patch the ProfileInstance
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 336 def patch(profile_patch: nil ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' payload = @version.patch('PATCH', @uri, headers: headers, data: profile_patch.to_json) ProfileInstance.new( @version, payload, store_id: @solution[:store_id], profile_id: @solution[:profile_id], ) end |
#patch_with_metadata(profile_patch: nil) ⇒ ProfileInstance
Patch the ProfileInstanceMetadata
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 358 def (profile_patch: nil ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' response = @version.('PATCH', @uri, headers: headers, data: profile_patch.to_json) profile_instance = ProfileInstance.new( @version, response.body, store_id: @solution[:store_id], profile_id: @solution[:profile_id], ) ProfileInstanceMetadata.new( @version, profile_instance, response.headers, response.status_code ) end |
#to_s ⇒ Object
Provide a user friendly representation
385 386 387 388 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 385 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Memory.V1.ProfileContext #{context}>" end |