Class: Twilio::REST::Preview::HostedNumbers::AuthorizationDocumentContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb,
lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.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].

Defined Under Namespace

Classes: DependentHostedNumberOrderInstance, DependentHostedNumberOrderList, DependentHostedNumberOrderPage

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ AuthorizationDocumentContext

Initialize the AuthorizationDocumentContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    A 34 character string that uniquely identifies this AuthorizationDocument.



213
214
215
216
217
218
219
220
221
222
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 213

def initialize(version, sid)
  super(version)

  # Path Solution
  @solution = {sid: sid, }
  @uri = "/AuthorizationDocuments/#{@solution[:sid]}"

  # Dependents
  @dependent_hosted_number_orders = nil
end

Instance Method Details

#dependent_hosted_number_ordersDependentHostedNumberOrderList, DependentHostedNumberOrderContext

Access the dependent_hosted_number_orders

Returns:



283
284
285
286
287
288
289
290
291
292
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 283

def dependent_hosted_number_orders
  unless @dependent_hosted_number_orders
    @dependent_hosted_number_orders = DependentHostedNumberOrderList.new(
        @version,
        signing_document_sid: @solution[:sid],
    )
  end

  @dependent_hosted_number_orders
end

#fetchAuthorizationDocumentInstance

Fetch a AuthorizationDocumentInstance

Returns:



227
228
229
230
231
232
233
234
235
236
237
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 227

def fetch
  params = Twilio::Values.of({})

  payload = @version.fetch(
      'GET',
      @uri,
      params,
  )

  AuthorizationDocumentInstance.new(@version, payload, sid: @solution[:sid], )
end

#inspectObject

Provide a detailed, user friendly representation



303
304
305
306
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 303

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Preview.HostedNumbers.AuthorizationDocumentContext #{context}>"
end

#to_sObject

Provide a user friendly representation



296
297
298
299
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 296

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Preview.HostedNumbers.AuthorizationDocumentContext #{context}>"
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 (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 (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](www.twilio.com/docs/api/phone-numbers/hosted-number-authorization-documents#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:



259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb', line 259

def update(hosted_number_order_sids: :unset, address_sid: :unset, email: :unset, cc_emails: :unset, status: :unset, contact_title: :unset, contact_phone_number: :unset)
  data = Twilio::Values.of({
      'HostedNumberOrderSids' => Twilio.serialize_list(hosted_number_order_sids) { |e| e },
      'AddressSid' => address_sid,
      'Email' => email,
      'CcEmails' => Twilio.serialize_list(cc_emails) { |e| e },
      'Status' => status,
      'ContactTitle' => contact_title,
      'ContactPhoneNumber' => contact_phone_number,
  })

  payload = @version.update(
      'POST',
      @uri,
      data: data,
  )

  AuthorizationDocumentInstance.new(@version, payload, sid: @solution[:sid], )
end