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.



275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 275

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:



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

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:



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

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:



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

def date_updated
    @properties['date_updated']
end

#descriptionString

Returns The description of the policy.

Returns:

  • (String)

    The description of the policy.



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

def description
    @properties['description']
end

#idString

Returns The Policy ID.

Returns:

  • (String)

    The Policy ID.



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

def id
    @properties['id']
end

#inspectObject

Provide a detailed, user friendly representation



356
357
358
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 356

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

#nameString

Returns The name of the policy.

Returns:

  • (String)

    The name of the policy.



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

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.



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

def policy_details
    @properties['policy_details']
end

#to_sObject

Provide a user friendly representation



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

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

#typeString

Returns The type of the policy.

Returns:

  • (String)

    The type of the policy.



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

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.



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

def user_sid
    @properties['user_sid']
end