Class: Twilio::REST::Intelligence::V2::OperatorAttachmentsContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, service_sid) ⇒ OperatorAttachmentsContext

Initialize the OperatorAttachmentsContext

Parameters:

  • version (Version)

    Version that contains the resource

  • service_sid (String)

    The unique SID identifier of the Service.



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

def initialize(version, service_sid)
    super(version)
    

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

    
end

Instance Method Details

#fetchOperatorAttachmentsInstance

Fetch the OperatorAttachmentsInstance

Returns:



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

def fetch

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

#fetch_with_metadataOperatorAttachmentsInstance

Fetch the OperatorAttachmentsInstanceMetadata

Returns:



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb', line 82

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, headers: headers)
    operator_attachments_instance = OperatorAttachmentsInstance.new(
        @version,
        response.body,
        service_sid: @solution[:service_sid],
    )
    .new(
        @version,
        operator_attachments_instance,
        response.headers,
        response.status_code
    )
end

#inspectObject

Provide a detailed, user friendly representation



114
115
116
117
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb', line 114

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

#to_sObject

Provide a user friendly representation



107
108
109
110
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb', line 107

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