Class: Twilio::REST::Intelligence::V2::OperatorAttachmentContext

Inherits:
Twilio::REST::InstanceContext show all
Defined in:
lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, service_sid, operator_sid) ⇒ OperatorAttachmentContext

Initialize the OperatorAttachmentContext

Parameters:

  • version (Version)

    Version that contains the resource

  • service_sid (String)

    The unique SID identifier of the Service.

  • operator_sid (String)

    The unique SID identifier of the Operator. Allows both Custom and Pre-built Operators.



50
51
52
53
54
55
56
57
58
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb', line 50

def initialize(version, service_sid, operator_sid)
    super(version)

    # Path Solution
    @solution = { service_sid: service_sid, operator_sid: operator_sid,  }
    @uri = "/Services/#{@solution[:service_sid]}/Operators/#{@solution[:operator_sid]}"

    
end

Instance Method Details

#createOperatorAttachmentInstance

Create the OperatorAttachmentInstance

Returns:



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb', line 62

def create

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.create('POST', @uri, headers: headers)
    OperatorAttachmentInstance.new(
        @version,
        payload,
        service_sid: @solution[:service_sid],
        operator_sid: @solution[:operator_sid],
    )
end

#deleteBoolean

Delete the OperatorAttachmentInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



82
83
84
85
86
87
88
89
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb', line 82

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    @version.delete('DELETE', @uri, headers: headers)
end

#inspectObject

Provide a detailed, user friendly representation



101
102
103
104
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb', line 101

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Intelligence.V2.OperatorAttachmentContext #{context}>"
end

#to_sObject

Provide a user friendly representation



94
95
96
97
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb', line 94

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Intelligence.V2.OperatorAttachmentContext #{context}>"
end