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.



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 179

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:



217
218
219
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 217

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:



241
242
243
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 241

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:



247
248
249
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 247

def date_updated
    @properties['date_updated']
end

#descriptionString

Returns The description of the policy.

Returns:

  • (String)

    The description of the policy.



211
212
213
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 211

def description
    @properties['description']
end

#idString

Returns The Policy ID.

Returns:

  • (String)

    The Policy ID.



199
200
201
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 199

def id
    @properties['id']
end

#inspectObject

Provide a detailed, user friendly representation



259
260
261
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 259

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

#nameString

Returns The name of the policy.

Returns:

  • (String)

    The name of the policy.



205
206
207
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 205

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.



235
236
237
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 235

def policy_details
    @properties['policy_details']
end

#to_sObject

Provide a user friendly representation



253
254
255
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 253

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

#typeString

Returns The type of the policy.

Returns:

  • (String)

    The type of the policy.



229
230
231
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 229

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.



223
224
225
# File 'lib/twilio-ruby/rest/assistants/v1/policy.rb', line 223

def user_sid
    @properties['user_sid']
end