Class: Twilio::REST::Numbers::V2::AuthorizationDocumentContext

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

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

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.



180
181
182
183
184
185
186
187
188
189
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 180

def initialize(version, sid)
    super(version)

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

    # Dependents
    @dependent_hosted_number_orders = nil
end

Instance Method Details

#deleteBoolean

Delete the AuthorizationDocumentInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



193
194
195
196
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 193

def delete

    @version.delete('DELETE', @uri)
end

#dependent_hosted_number_ordersDependentHostedNumberOrderList, DependentHostedNumberOrderContext

Access the dependent_hosted_number_orders

Returns:



215
216
217
218
219
220
221
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 215

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 the AuthorizationDocumentInstance

Returns:



201
202
203
204
205
206
207
208
209
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 201

def fetch

    payload = @version.fetch('GET', @uri)
    AuthorizationDocumentInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



232
233
234
235
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 232

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

#to_sObject

Provide a user friendly representation



225
226
227
228
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 225

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