Class: Twilio::REST::Intelligence::V2::PrebuiltOperatorContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ PrebuiltOperatorContext

Initialize the PrebuiltOperatorContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    A 34 character string that uniquely identifies this Pre-built Operator.



148
149
150
151
152
153
154
155
156
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 148

def initialize(version, sid)
    super(version)

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

    
end

Instance Method Details

#fetchPrebuiltOperatorInstance

Fetch the PrebuiltOperatorInstance

Returns:



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 160

def fetch

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

#inspectObject

Provide a detailed, user friendly representation



186
187
188
189
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 186

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

#to_sObject

Provide a user friendly representation



179
180
181
182
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 179

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