Class: Twilio::REST::Preview::HostedNumbers::AuthorizationDocumentInstance

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

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected]

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

  • sid (String) (defaults to: nil)

    A 34 character string that uniquely identifies this AuthorizationDocument.


306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 306

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 Address sid.

Returns:

  • (String)

    Address sid.


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

def address_sid
  @properties['address_sid']
end

#cc_emailsArray[String]

Returns A list of emails.

Returns:

  • (Array[String])

    A list of emails.


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

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:


331
332
333
334
335
336
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 331

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

#date_createdTime

Returns The date this AuthorizationDocument was created.

Returns:

  • (Time)

    The date this AuthorizationDocument was created.


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

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date this AuthorizationDocument was updated.

Returns:

  • (Time)

    The date this AuthorizationDocument was updated.


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

def date_updated
  @properties['date_updated']
end

#dependent_hosted_number_ordersdependent_hosted_number_orders

Access the dependent_hosted_number_orders

Returns:


435
436
437
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 435

def dependent_hosted_number_orders
  context.dependent_hosted_number_orders
end

#emailString

Returns Email.

Returns:

  • (String)

    Email.


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

def email
  @properties['email']
end

#fetchAuthorizationDocumentInstance

Fetch the AuthorizationDocumentInstance

Returns:


395
396
397
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 395

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation


448
449
450
451
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 448

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

Returns The links.

Returns:

  • (String)

    The links


388
389
390
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 388

def links
  @properties['links']
end

#sidString

Returns AuthorizationDocument sid.

Returns:

  • (String)

    AuthorizationDocument sid.


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

def sid
  @properties['sid']
end

#statusauthorization_document.Status

Returns The Status of this AuthorizationDocument.

Returns:

  • (authorization_document.Status)

    The Status of this AuthorizationDocument.


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

def status
  @properties['status']
end

#to_sObject

Provide a user friendly representation


441
442
443
444
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 441

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

#update(hosted_number_order_sids: :unset, address_sid: :unset, email: :unset, cc_emails: :unset, status: :unset, contact_title: :unset, contact_phone_number: :unset) ⇒ AuthorizationDocumentInstance

Update the AuthorizationDocumentInstance

Parameters:

  • hosted_number_order_sids (Array[String]) (defaults to: :unset)

    A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform.

  • address_sid (String) (defaults to: :unset)

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

  • email (String) (defaults to: :unset)

    Email that this AuthorizationDocument will be sent to for signing.

  • cc_emails (Array[String]) (defaults to: :unset)

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

  • status (authorization_document.Status) (defaults to: :unset)

    Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled Status Values for more information on each of these statuses.

  • contact_title (String) (defaults to: :unset)

    The title of the person authorized to sign the Authorization Document for this phone number.

  • contact_phone_number (String) (defaults to: :unset)

    The contact phone number of the person authorized to sign the Authorization Document.

Returns:


420
421
422
423
424
425
426
427
428
429
430
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 420

def update(hosted_number_order_sids: :unset, address_sid: :unset, email: :unset, cc_emails: :unset, status: :unset, contact_title: :unset, contact_phone_number: :unset)
  context.update(
      hosted_number_order_sids: hosted_number_order_sids,
      address_sid: address_sid,
      email: email,
      cc_emails: cc_emails,
      status: status,
      contact_title: contact_title,
      contact_phone_number: contact_phone_number,
  )
end

#urlString

Returns The url.

Returns:

  • (String)

    The url


382
383
384
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 382

def url
  @properties['url']
end