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

Defined Under Namespace

Classes: DependentHostedNumberOrderInstance, DependentHostedNumberOrderList, DependentHostedNumberOrderPage

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ AuthorizationDocumentContext

Initialize the AuthorizationDocumentContext



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

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



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

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    @version.delete('DELETE', @uri, headers: headers)
end

#dependent_hosted_number_ordersDependentHostedNumberOrderList, DependentHostedNumberOrderContext

Access the dependent_hosted_number_orders



220
221
222
223
224
225
226
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 220

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



204
205
206
207
208
209
210
211
212
213
214
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 204

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    payload = @version.fetch('GET', @uri, headers: headers)
    AuthorizationDocumentInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



237
238
239
240
# File 'lib/twilio-ruby/rest/numbers/v2/authorization_document.rb', line 237

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

#to_sObject

Provide a user friendly representation



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

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