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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, bundle_sid: nil, sid: nil) ⇒ EvaluationInstance

Initialize the EvaluationInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Evaluation resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



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

def initialize(version, payload , bundle_sid: nil, sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'regulation_sid' => payload['regulation_sid'],
        'bundle_sid' => payload['bundle_sid'],
        'status' => payload['status'],
        'results' => payload['results'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'bundle_sid' => bundle_sid  || @properties['bundle_sid']  ,'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Bundle resource.

Returns:



281
282
283
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb', line 281

def 
    @properties['account_sid']
end

#bundle_sidString

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

Returns:

  • (String)

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



293
294
295
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb', line 293

def bundle_sid
    @properties['bundle_sid']
end

#contextEvaluationContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



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

def context
    unless @instance_context
        @instance_context = EvaluationContext.new(@version , @params['bundle_sid'], @params['sid'])
    end
    @instance_context
end

#date_createdTime

Returns:

  • (Time)


311
312
313
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb', line 311

def date_created
    @properties['date_created']
end

#fetchEvaluationInstance

Fetch the EvaluationInstance

Returns:



324
325
326
327
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb', line 324

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



338
339
340
341
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb', line 338

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Numbers.V2.EvaluationInstance #{values}>"
end

#regulation_sidString

Returns The unique string of a regulation that is associated to the Bundle resource.

Returns:

  • (String)

    The unique string of a regulation that is associated to the Bundle resource.



287
288
289
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb', line 287

def regulation_sid
    @properties['regulation_sid']
end

#resultsArray<Hash>

Returns The results of the Evaluation which includes the valid and invalid attributes.

Returns:

  • (Array<Hash>)

    The results of the Evaluation which includes the valid and invalid attributes.



305
306
307
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb', line 305

def results
    @properties['results']
end

#sidString

Returns The unique string that identifies the Evaluation resource.

Returns:

  • (String)

    The unique string that identifies the Evaluation resource.



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

def sid
    @properties['sid']
end

#statusStatus

Returns:

  • (Status)


299
300
301
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb', line 299

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



331
332
333
334
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb', line 331

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Numbers.V2.EvaluationInstance #{values}>"
end

#urlString

Returns:

  • (String)


317
318
319
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb', line 317

def url
    @properties['url']
end