Class: Twilio::REST::Lookups::V2::LookupOverrideInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/lookups/v2/lookup_override.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, field: nil, phone_number: nil) ⇒ LookupOverrideInstance

Initialize the LookupOverrideInstance

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

  • sid (String)

    The SID of the Call resource to fetch.



206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 206

def initialize(version, payload , field: nil, phone_number: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'phone_number' => payload['phone_number'],
        'original_line_type' => payload['original_line_type'],
        'overridden_line_type' => payload['overridden_line_type'],
        'override_reason' => payload['override_reason'],
        'override_timestamp' => Twilio.deserialize_iso8601_datetime(payload['override_timestamp']),
        'overridden_by_account_sid' => payload['overridden_by_account_sid'],
        'code' => payload['code'],
        'message' => payload['message'],
        'more_info' => payload['more_info'],
        'status' => payload['status'],
        'field' => payload['field'],
        'limit' => payload['limit'],
        'bucket' => payload['bucket'],
        'owner' => payload['owner'],
        'ttl' => payload['ttl'],
    }

    # Context
    @instance_context = nil
    @params = { 'field' => field  || @properties['field']  ,'phone_number' => phone_number  || @properties['phone_number']  , }
end

Instance Method Details

#bucketString

Returns Name of the bucket.

Returns:

  • (String)

    Name of the bucket



318
319
320
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 318

def bucket
    @properties['bucket']
end

#codeString

Returns Twilio-specific error code.

Returns:

  • (String)

    Twilio-specific error code



282
283
284
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 282

def code
    @properties['code']
end

#contextLookupOverrideContext

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

Returns:



237
238
239
240
241
242
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 237

def context
    unless @instance_context
        @instance_context = LookupOverrideContext.new(@version , @params['field'], @params['phone_number'])
    end
    @instance_context
end

#create(overrides_request: :unset) ⇒ LookupOverrideInstance

Create the LookupOverrideInstance

Parameters:

  • overrides_request (OverridesRequest) (defaults to: :unset)

Returns:



338
339
340
341
342
343
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 338

def create(overrides_request: :unset
)

    context.create(
    )
end

#deleteBoolean

Delete the LookupOverrideInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



348
349
350
351
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 348

def delete

    context.delete
end

#fetchLookupOverrideInstance

Fetch the LookupOverrideInstance

Returns:



356
357
358
359
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 356

def fetch

    context.fetch
end

#fieldString

Returns Limit of requests for the bucket.

Returns:

  • (String)

    Limit of requests for the bucket



306
307
308
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 306

def field
    @properties['field']
end

#inspectObject

Provide a detailed, user friendly representation



381
382
383
384
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 381

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

#limitString

Returns Limit of requests for the bucket.

Returns:

  • (String)

    Limit of requests for the bucket



312
313
314
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 312

def limit
    @properties['limit']
end

#messageString

Returns Error message.

Returns:

  • (String)

    Error message



288
289
290
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 288

def message
    @properties['message']
end

#more_infoString

Returns Link to Error Code References.

Returns:

  • (String)

    Link to Error Code References



294
295
296
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 294

def more_info
    @properties['more_info']
end

#original_line_typeString

Returns The original line type.

Returns:

  • (String)

    The original line type



252
253
254
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 252

def original_line_type
    @properties['original_line_type']
end

#overridden_by_account_sidString

Returns The Account SID for the user who made the override.

Returns:

  • (String)

    The Account SID for the user who made the override



276
277
278
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 276

def 
    @properties['overridden_by_account_sid']
end

#overridden_line_typeString

Returns The new line type after the override.

Returns:

  • (String)

    The new line type after the override



258
259
260
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 258

def overridden_line_type
    @properties['overridden_line_type']
end

#override_reasonString

Returns The reason for the override.

Returns:

  • (String)

    The reason for the override



264
265
266
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 264

def override_reason
    @properties['override_reason']
end

#override_timestampTime

Returns:

  • (Time)


270
271
272
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 270

def override_timestamp
    @properties['override_timestamp']
end

#ownerString

Returns Owner of the rule.

Returns:

  • (String)

    Owner of the rule



324
325
326
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 324

def owner
    @properties['owner']
end

#phone_numberString

Returns The phone number for which the override was created.

Returns:

  • (String)

    The phone number for which the override was created



246
247
248
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 246

def phone_number
    @properties['phone_number']
end

#statusString

Returns HTTP response status code.

Returns:

  • (String)

    HTTP response status code



300
301
302
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 300

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



374
375
376
377
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 374

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

#ttlString

Returns Time to live of the rule.

Returns:

  • (String)

    Time to live of the rule



330
331
332
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 330

def ttl
    @properties['ttl']
end

#update(overrides_request: :unset) ⇒ LookupOverrideInstance

Update the LookupOverrideInstance

Parameters:

  • overrides_request (OverridesRequest) (defaults to: :unset)

Returns:



365
366
367
368
369
370
# File 'lib/twilio-ruby/rest/lookups/v2/lookup_override.rb', line 365

def update(overrides_request: :unset
)

    context.update(
    )
end