Class: Twilio::REST::Trusthub::V1::TrustProductsContext::TrustProductsEvaluationsInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, trust_product_sid: nil, sid: nil) ⇒ TrustProductsEvaluationsInstance

Initialize the TrustProductsEvaluationsInstance

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 TrustProductsEvaluations resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb', line 235

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

    # Context
    @instance_context = nil
    @params = { 'trust_product_sid' => trust_product_sid  || @properties['trust_product_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 trust_product resource.

Returns:



274
275
276
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb', line 274

def 
    @properties['account_sid']
end

#contextTrustProductsEvaluationsContext

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

Returns:



259
260
261
262
263
264
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb', line 259

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

#date_createdTime

Returns:

  • (Time)


304
305
306
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb', line 304

def date_created
    @properties['date_created']
end

#fetchTrustProductsEvaluationsInstance

Fetch the TrustProductsEvaluationsInstance

Returns:



317
318
319
320
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb', line 317

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



331
332
333
334
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb', line 331

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

#policy_sidString

Returns The unique string of a policy that is associated to the trust_product resource.

Returns:

  • (String)

    The unique string of a policy that is associated to the trust_product resource.



280
281
282
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb', line 280

def policy_sid
    @properties['policy_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.



298
299
300
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb', line 298

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.



268
269
270
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb', line 268

def sid
    @properties['sid']
end

#statusStatus

Returns:

  • (Status)


292
293
294
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb', line 292

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



324
325
326
327
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb', line 324

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

#trust_product_sidString

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

Returns:

  • (String)

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



286
287
288
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb', line 286

def trust_product_sid
    @properties['trust_product_sid']
end

#urlString

Returns:

  • (String)


310
311
312
# File 'lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb', line 310

def url
    @properties['url']
end