Class: Twilio::REST::Numbers::V2::AuthorizationDocumentInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/numbers/v2/authorization_document.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ AuthorizationDocumentInstance

Initialize the AuthorizationDocumentInstance

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

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 294

def initialize(version, payload , sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'address_sid' => payload['address_sid'],
        'status' => payload['status'],
        'email' => payload['email'],
        'cc_emails' => payload['cc_emails'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'url' => payload['url'],
        'links' => payload['links'],
    }

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

Instance Method Details

#address_sidString

Returns A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument.

Returns:

  • (String)

    A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument.



334
335
336
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 334

def address_sid
    @properties['address_sid']
end

#cc_emailsArray<String>

Returns Email recipients who will be informed when an Authorization Document has been sent and signed.

Returns:

  • (Array<String>)

    Email recipients who will be informed when an Authorization Document has been sent and signed.



352
353
354
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 352

def cc_emails
    @properties['cc_emails']
end

#contextAuthorizationDocumentContext

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

Returns:



319
320
321
322
323
324
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 319

def context
    unless @instance_context
        @instance_context = AuthorizationDocumentContext.new(@version , @params['sid'])
    end
    @instance_context
end

#date_createdTime

Returns The date this resource was created, given as [GMT RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



358
359
360
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 358

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date that this resource was updated, given as [GMT RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



364
365
366
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 364

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the AuthorizationDocumentInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



383
384
385
386
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 383

def delete

    context.delete
end

#dependent_hosted_number_ordersdependent_hosted_number_orders

Access the dependent_hosted_number_orders

Returns:



399
400
401
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 399

def dependent_hosted_number_orders
    context.dependent_hosted_number_orders
end

#emailString

Returns Email that this AuthorizationDocument will be sent to for signing.

Returns:

  • (String)

    Email that this AuthorizationDocument will be sent to for signing.



346
347
348
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 346

def email
    @properties['email']
end

#fetchAuthorizationDocumentInstance

Fetch the AuthorizationDocumentInstance

Returns:



391
392
393
394
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 391

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



412
413
414
415
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 412

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

Returns:

  • (Hash)


376
377
378
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 376

def links
    @properties['links']
end

#sidString

Returns A 34 character string that uniquely identifies this AuthorizationDocument.

Returns:

  • (String)

    A 34 character string that uniquely identifies this AuthorizationDocument.



328
329
330
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 328

def sid
    @properties['sid']
end

#statusStatus

Returns:

  • (Status)


340
341
342
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 340

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



405
406
407
408
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 405

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

#urlString

Returns:

  • (String)


370
371
372
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 370

def url
    @properties['url']
end