Class: Twilio::REST::Assistants::V1::PolicyInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/assistants/v1/policy.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ PolicyInstance

Initialize the PolicyInstance

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

  • sid (String)

    The SID of the Call resource to fetch.



267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 267

def initialize(version, payload )
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'id' => payload['id'],
        'name' => payload['name'],
        'description' => payload['description'],
        'account_sid' => payload['account_sid'],
        'user_sid' => payload['user_sid'],
        'type' => payload['type'],
        'policy_details' => payload['policy_details'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
    }
end

Instance Method Details

#account_sidString

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

Returns:



306
307
308
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 306

def 
    @properties['account_sid']
end

#date_createdTime

Returns The date and time in GMT when the Policy was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



330
331
332
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 330

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT when the Policy was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



336
337
338
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 336

def date_updated
    @properties['date_updated']
end

#descriptionString

Returns The description of the policy.

Returns:

  • (String)

    The description of the policy.



300
301
302
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 300

def description
    @properties['description']
end

#idString

Returns The Policy ID.

Returns:

  • (String)

    The Policy ID.



288
289
290
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 288

def id
    @properties['id']
end

#inspectObject

Provide a detailed, user friendly representation



348
349
350
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 348

def inspect
    "<Twilio.Assistants.V1.PolicyInstance>"
end

#nameString

Returns The name of the policy.

Returns:

  • (String)

    The name of the policy.



294
295
296
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 294

def name
    @properties['name']
end

#policy_detailsHash

Returns The details of the policy based on the type.

Returns:

  • (Hash)

    The details of the policy based on the type.



324
325
326
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 324

def policy_details
    @properties['policy_details']
end

#to_sObject

Provide a user friendly representation



342
343
344
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 342

def to_s
    "<Twilio.Assistants.V1.PolicyInstance>"
end

#typeString

Returns The type of the policy.

Returns:

  • (String)

    The type of the policy.



318
319
320
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 318

def type
    @properties['type']
end

#user_sidString

Returns The SID of the User that created the Policy resource.

Returns:

  • (String)

    The SID of the User that created the Policy resource.



312
313
314
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 312

def user_sid
    @properties['user_sid']
end