Class: Twilio::REST::Numbers::V2::RegulatoryComplianceList::BundleContext::EvaluationContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, bundle_sid, sid) ⇒ EvaluationContext

Initialize the EvaluationContext

Parameters:

  • version (Version)

    Version that contains the resource

  • bundle_sid (String)

    The unique string that we created to identify the Bundle resource.

  • sid (String)

    The unique string that identifies the Evaluation resource.



207
208
209
210
211
212
213
214
215
216
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb', line 207

def initialize(version, bundle_sid, sid)
    super(version)
    

    # Path Solution
    @solution = { bundle_sid: bundle_sid, sid: sid,  }
    @uri = "/RegulatoryCompliance/Bundles/#{@solution[:bundle_sid]}/Evaluations/#{@solution[:sid]}"

    
end

Instance Method Details

#fetchEvaluationInstance

Fetch the EvaluationInstance

Returns:



220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb', line 220

def fetch

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

#fetch_with_metadataEvaluationInstance

Fetch the EvaluationInstanceMetadata

Returns:



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb', line 240

def 

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

#inspectObject

Provide a detailed, user friendly representation



273
274
275
276
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb', line 273

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

#to_sObject

Provide a user friendly representation



266
267
268
269
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb', line 266

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