Class: Twilio::REST::Trusthub::V1::PoliciesInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Trusthub::V1::PoliciesInstance
- Defined in:
- lib/twilio-ruby/rest/trusthub/v1/policies.rb
Instance Method Summary collapse
-
#context ⇒ PoliciesContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#fetch ⇒ PoliciesInstance
Fetch the PoliciesInstance.
-
#friendly_name ⇒ String
A human-readable description that is assigned to describe the Policy resource.
-
#initialize(version, payload, sid: nil) ⇒ PoliciesInstance
constructor
Initialize the PoliciesInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#requirements ⇒ Hash
The SID of an object that holds the policy information.
-
#sid ⇒ String
The unique string that identifies the Policy resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of the Policy resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ PoliciesInstance
Initialize the PoliciesInstance
383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 |
# File 'lib/twilio-ruby/rest/trusthub/v1/policies.rb', line 383 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'friendly_name' => payload['friendly_name'], 'requirements' => payload['requirements'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#context ⇒ PoliciesContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
404 405 406 407 408 409 |
# File 'lib/twilio-ruby/rest/trusthub/v1/policies.rb', line 404 def context unless @instance_context @instance_context = PoliciesContext.new(@version , @params['sid']) end @instance_context end |
#fetch ⇒ PoliciesInstance
Fetch the PoliciesInstance
438 439 440 441 |
# File 'lib/twilio-ruby/rest/trusthub/v1/policies.rb', line 438 def fetch context.fetch end |
#friendly_name ⇒ String
Returns A human-readable description that is assigned to describe the Policy resource. Examples can include Primary Customer profile policy.
419 420 421 |
# File 'lib/twilio-ruby/rest/trusthub/v1/policies.rb', line 419 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
452 453 454 455 |
# File 'lib/twilio-ruby/rest/trusthub/v1/policies.rb', line 452 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Trusthub.V1.PoliciesInstance #{values}>" end |
#requirements ⇒ Hash
Returns The SID of an object that holds the policy information.
425 426 427 |
# File 'lib/twilio-ruby/rest/trusthub/v1/policies.rb', line 425 def requirements @properties['requirements'] end |
#sid ⇒ String
Returns The unique string that identifies the Policy resource.
413 414 415 |
# File 'lib/twilio-ruby/rest/trusthub/v1/policies.rb', line 413 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
445 446 447 448 |
# File 'lib/twilio-ruby/rest/trusthub/v1/policies.rb', line 445 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Trusthub.V1.PoliciesInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of the Policy resource.
431 432 433 |
# File 'lib/twilio-ruby/rest/trusthub/v1/policies.rb', line 431 def url @properties['url'] end |