Class: Twilio::REST::Memory::V1::IdentifierContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Memory::V1::IdentifierContext
- Defined in:
- lib/twilio-ruby/rest/memory/v1/identifier.rb
Instance Method Summary collapse
-
#delete(remove_all: :unset) ⇒ Boolean
Delete the IdentifierInstance.
-
#delete_with_metadata(remove_all: :unset) ⇒ Boolean
Delete the IdentifierInstanceMetadata.
-
#fetch ⇒ IdentifierInstance
Fetch the IdentifierInstance.
-
#fetch_with_metadata ⇒ IdentifierInstance
Fetch the IdentifierInstanceMetadata.
-
#initialize(version, store_id, profile_id, id_type) ⇒ IdentifierContext
constructor
Initialize the IdentifierContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#patch(identifier_update: nil) ⇒ IdentifierInstance
Patch the IdentifierInstance.
-
#patch_with_metadata(identifier_update: nil) ⇒ IdentifierInstance
Patch the IdentifierInstanceMetadata.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, store_id, profile_id, id_type) ⇒ IdentifierContext
Initialize the IdentifierContext
288 289 290 291 292 293 294 295 296 297 298 |
# File 'lib/twilio-ruby/rest/memory/v1/identifier.rb', line 288 def initialize(version, store_id, profile_id, id_type) apiV1Version = ApiV1Version.new version.domain, version super(apiV1Version) # Path Solution @solution = { store_id: store_id, profile_id: profile_id, id_type: id_type, } @uri = "/Stores/#{@solution[:store_id]}/Profiles/#{@solution[:profile_id]}/Identifiers/#{@solution[:id_type]}" end |
Instance Method Details
#delete(remove_all: :unset) ⇒ Boolean
Delete the IdentifierInstance
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 |
# File 'lib/twilio-ruby/rest/memory/v1/identifier.rb', line 303 def delete( remove_all: :unset ) params = Twilio::Values.of({ 'removeAll' => remove_all, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, params: params, headers: headers) IdentifierInstance.new( @version, response.body, store_id: @solution[:store_id], profile_id: @solution[:profile_id], id_type: @solution[:id_type], ) end |
#delete_with_metadata(remove_all: :unset) ⇒ Boolean
Delete the IdentifierInstanceMetadata
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/twilio-ruby/rest/memory/v1/identifier.rb', line 329 def ( remove_all: :unset ) params = Twilio::Values.of({ 'removeAll' => remove_all, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, params: params, headers: headers) identifier_instance = IdentifierInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) IdentifierInstanceMetadata.new(@version, identifier_instance, response.headers, response.status_code) end |
#fetch ⇒ IdentifierInstance
Fetch the IdentifierInstance
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
# File 'lib/twilio-ruby/rest/memory/v1/identifier.rb', line 353 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) IdentifierInstance.new( @version, payload, store_id: @solution[:store_id], profile_id: @solution[:profile_id], id_type: @solution[:id_type], ) end |
#fetch_with_metadata ⇒ IdentifierInstance
Fetch the IdentifierInstanceMetadata
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 |
# File 'lib/twilio-ruby/rest/memory/v1/identifier.rb', line 374 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) identifier_instance = IdentifierInstance.new( @version, response.body, store_id: @solution[:store_id], profile_id: @solution[:profile_id], id_type: @solution[:id_type], ) IdentifierInstanceMetadata.new( @version, identifier_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
460 461 462 463 |
# File 'lib/twilio-ruby/rest/memory/v1/identifier.rb', line 460 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Memory.V1.IdentifierContext #{context}>" end |
#patch(identifier_update: nil) ⇒ IdentifierInstance
Patch the IdentifierInstance
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 |
# File 'lib/twilio-ruby/rest/memory/v1/identifier.rb', line 402 def patch(identifier_update: 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: identifier_update.to_json) IdentifierInstance.new( @version, payload, store_id: @solution[:store_id], profile_id: @solution[:profile_id], id_type: @solution[:id_type], ) end |
#patch_with_metadata(identifier_update: nil) ⇒ IdentifierInstance
Patch the IdentifierInstanceMetadata
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 |
# File 'lib/twilio-ruby/rest/memory/v1/identifier.rb', line 425 def (identifier_update: nil ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' response = @version.('PATCH', @uri, headers: headers, data: identifier_update.to_json) identifier_instance = IdentifierInstance.new( @version, response.body, store_id: @solution[:store_id], profile_id: @solution[:profile_id], id_type: @solution[:id_type], ) IdentifierInstanceMetadata.new( @version, identifier_instance, response.headers, response.status_code ) end |
#to_s ⇒ Object
Provide a user friendly representation
453 454 455 456 |
# File 'lib/twilio-ruby/rest/memory/v1/identifier.rb', line 453 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Memory.V1.IdentifierContext #{context}>" end |