Class: Twilio::REST::Trusthub::V1::TrustProductsContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Trusthub::V1::TrustProductsContext
- Defined in:
- lib/twilio-ruby/rest/trusthub/v1/trust_products.rb,
lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb,
lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_entity_assignments.rb,
lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb
Defined Under Namespace
Classes: TrustProductsChannelEndpointAssignmentContext, TrustProductsChannelEndpointAssignmentInstance, TrustProductsChannelEndpointAssignmentInstanceMetadata, TrustProductsChannelEndpointAssignmentList, TrustProductsChannelEndpointAssignmentListResponse, TrustProductsChannelEndpointAssignmentPage, TrustProductsChannelEndpointAssignmentPageMetadata, TrustProductsEntityAssignmentsContext, TrustProductsEntityAssignmentsInstance, TrustProductsEntityAssignmentsInstanceMetadata, TrustProductsEntityAssignmentsList, TrustProductsEntityAssignmentsListResponse, TrustProductsEntityAssignmentsPage, TrustProductsEntityAssignmentsPageMetadata, TrustProductsEvaluationsContext, TrustProductsEvaluationsInstance, TrustProductsEvaluationsInstanceMetadata, TrustProductsEvaluationsList, TrustProductsEvaluationsListResponse, TrustProductsEvaluationsPage, TrustProductsEvaluationsPageMetadata
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the TrustProductsInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the TrustProductsInstanceMetadata.
-
#fetch ⇒ TrustProductsInstance
Fetch the TrustProductsInstance.
-
#fetch_with_metadata ⇒ TrustProductsInstance
Fetch the TrustProductsInstanceMetadata.
-
#initialize(version, sid) ⇒ TrustProductsContext
constructor
Initialize the TrustProductsContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#trust_products_channel_endpoint_assignment(sid = :unset) ⇒ TrustProductsChannelEndpointAssignmentList, TrustProductsChannelEndpointAssignmentContext
Access the trust_products_channel_endpoint_assignment.
-
#trust_products_entity_assignments(sid = :unset) ⇒ TrustProductsEntityAssignmentsList, TrustProductsEntityAssignmentsContext
Access the trust_products_entity_assignments.
-
#trust_products_evaluations(sid = :unset) ⇒ TrustProductsEvaluationsList, TrustProductsEvaluationsContext
Access the trust_products_evaluations.
-
#update(status: :unset, status_callback: :unset, friendly_name: :unset, email: :unset) ⇒ TrustProductsInstance
Update the TrustProductsInstance.
-
#update_with_metadata(status: :unset, status_callback: :unset, friendly_name: :unset, email: :unset) ⇒ TrustProductsInstance
Update the TrustProductsInstanceMetadata.
Constructor Details
#initialize(version, sid) ⇒ TrustProductsContext
Initialize the TrustProductsContext
257 258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 257 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/TrustProducts/#{@solution[:sid]}" # Dependents @trust_products_channel_endpoint_assignment = nil @trust_products_entity_assignments = nil @trust_products_evaluations = nil end |
Instance Method Details
#delete ⇒ Boolean
Delete the TrustProductsInstance
273 274 275 276 277 278 279 280 281 |
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 273 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 TrustProductsInstanceMetadata
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 |
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 286 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) trustProducts_instance = TrustProductsInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) TrustProductsInstanceMetadata.new(@version, trustProducts_instance, response.headers, response.status_code) end |
#fetch ⇒ TrustProductsInstance
Fetch the TrustProductsInstance
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 305 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) TrustProductsInstance.new( @version, payload, sid: @solution[:sid], ) end |
#fetch_with_metadata ⇒ TrustProductsInstance
Fetch the TrustProductsInstanceMetadata
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 324 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) trust_products_instance = TrustProductsInstance.new( @version, response.body, sid: @solution[:sid], ) TrustProductsInstanceMetadata.new( @version, trust_products_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
489 490 491 492 |
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 489 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Trusthub.V1.TrustProductsContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
482 483 484 485 |
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 482 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Trusthub.V1.TrustProductsContext #{context}>" end |
#trust_products_channel_endpoint_assignment(sid = :unset) ⇒ TrustProductsChannelEndpointAssignmentList, TrustProductsChannelEndpointAssignmentContext
Access the trust_products_channel_endpoint_assignment
426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 |
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 426 def trust_products_channel_endpoint_assignment(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return TrustProductsChannelEndpointAssignmentContext.new(@version, @solution[:sid],sid ) end unless @trust_products_channel_endpoint_assignment @trust_products_channel_endpoint_assignment = TrustProductsChannelEndpointAssignmentList.new( @version, trust_product_sid: @solution[:sid], ) end @trust_products_channel_endpoint_assignment end |
#trust_products_entity_assignments(sid = :unset) ⇒ TrustProductsEntityAssignmentsList, TrustProductsEntityAssignmentsContext
Access the trust_products_entity_assignments
445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 |
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 445 def trust_products_entity_assignments(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return TrustProductsEntityAssignmentsContext.new(@version, @solution[:sid],sid ) end unless @trust_products_entity_assignments @trust_products_entity_assignments = TrustProductsEntityAssignmentsList.new( @version, trust_product_sid: @solution[:sid], ) end @trust_products_entity_assignments end |
#trust_products_evaluations(sid = :unset) ⇒ TrustProductsEvaluationsList, TrustProductsEvaluationsContext
Access the trust_products_evaluations
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 |
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 464 def trust_products_evaluations(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return TrustProductsEvaluationsContext.new(@version, @solution[:sid],sid ) end unless @trust_products_evaluations @trust_products_evaluations = TrustProductsEvaluationsList.new( @version, trust_product_sid: @solution[:sid], ) end @trust_products_evaluations end |
#update(status: :unset, status_callback: :unset, friendly_name: :unset, email: :unset) ⇒ TrustProductsInstance
Update the TrustProductsInstance
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 |
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 353 def update( status: :unset, status_callback: :unset, friendly_name: :unset, email: :unset ) data = Twilio::Values.of({ 'Status' => status, 'StatusCallback' => status_callback, 'FriendlyName' => friendly_name, 'Email' => email, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) TrustProductsInstance.new( @version, payload, sid: @solution[:sid], ) end |
#update_with_metadata(status: :unset, status_callback: :unset, friendly_name: :unset, email: :unset) ⇒ TrustProductsInstance
Update the TrustProductsInstanceMetadata
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 |
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products.rb', line 388 def ( status: :unset, status_callback: :unset, friendly_name: :unset, email: :unset ) data = Twilio::Values.of({ 'Status' => status, 'StatusCallback' => status_callback, 'FriendlyName' => friendly_name, 'Email' => email, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('POST', @uri, data: data, headers: headers) trust_products_instance = TrustProductsInstance.new( @version, response.body, sid: @solution[:sid], ) TrustProductsInstanceMetadata.new( @version, trust_products_instance, response.headers, response.status_code ) end |