Class: Twilio::REST::Messaging::V1::TollfreeVerificationContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb

Overview

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

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ TollfreeVerificationContext

Initialize the TollfreeVerificationContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The unique string to identify Tollfree Verification.



233
234
235
236
237
238
239
240
241
# File 'lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb', line 233

def initialize(version, sid)
    super(version)

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

    
end

Instance Method Details

#deleteBoolean

Delete the TollfreeVerificationInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



245
246
247
248
249
# File 'lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb', line 245

def delete

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

#fetchTollfreeVerificationInstance

Fetch the TollfreeVerificationInstance

Returns:



254
255
256
257
258
259
260
261
262
263
# File 'lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb', line 254

def fetch

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

#inspectObject

Provide a detailed, user friendly representation



356
357
358
359
# File 'lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb', line 356

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

#to_sObject

Provide a user friendly representation



349
350
351
352
# File 'lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb', line 349

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

#update(business_name: :unset, business_website: :unset, notification_email: :unset, use_case_categories: :unset, use_case_summary: :unset, production_message_sample: :unset, opt_in_image_urls: :unset, opt_in_type: :unset, message_volume: :unset, business_street_address: :unset, business_street_address2: :unset, business_city: :unset, business_state_province_region: :unset, business_postal_code: :unset, business_country: :unset, additional_information: :unset, business_contact_first_name: :unset, business_contact_last_name: :unset, business_contact_email: :unset, business_contact_phone: :unset, edit_reason: :unset) ⇒ TollfreeVerificationInstance

Update the TollfreeVerificationInstance

Parameters:

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

    The name of the business or organization using the Tollfree number.

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

    The website of the business or organization using the Tollfree number.

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

    The email address to receive the notification about the verification result. .

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

    The category of the use case for the Tollfree Number. List as many are applicable..

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

    Use this to further explain how messaging is used by the business or organization.

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

    An example of message content, i.e. a sample message.

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

    Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL.

  • opt_in_type (OptInType) (defaults to: :unset)
  • message_volume (String) (defaults to: :unset)

    Estimate monthly volume of messages from the Tollfree Number.

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

    The address of the business or organization using the Tollfree number.

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

    The address of the business or organization using the Tollfree number.

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

    The city of the business or organization using the Tollfree number.

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

    The state/province/region of the business or organization using the Tollfree number.

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

    The postal code of the business or organization using the Tollfree number.

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

    The country of the business or organization using the Tollfree number.

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

    Additional information to be provided for verification.

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

    The first name of the contact for the business or organization using the Tollfree number.

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

    The last name of the contact for the business or organization using the Tollfree number.

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

    The email address of the contact for the business or organization using the Tollfree number.

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

    The E.164 formatted phone number of the contact for the business or organization using the Tollfree number.

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

    Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to ‘Website fixed’.

Returns:



289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
# File 'lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb', line 289

def update(
    business_name: :unset, 
    business_website: :unset, 
    notification_email: :unset, 
    use_case_categories: :unset, 
    use_case_summary: :unset, 
    production_message_sample: :unset, 
    opt_in_image_urls: :unset, 
    opt_in_type: :unset, 
    message_volume: :unset, 
    business_street_address: :unset, 
    business_street_address2: :unset, 
    business_city: :unset, 
    business_state_province_region: :unset, 
    business_postal_code: :unset, 
    business_country: :unset, 
    additional_information: :unset, 
    business_contact_first_name: :unset, 
    business_contact_last_name: :unset, 
    business_contact_email: :unset, 
    business_contact_phone: :unset, 
    edit_reason: :unset
)

    data = Twilio::Values.of({
        'BusinessName' => business_name,
        'BusinessWebsite' => business_website,
        'NotificationEmail' => notification_email,
        'UseCaseCategories' => Twilio.serialize_list(use_case_categories) { |e| e },
        'UseCaseSummary' => use_case_summary,
        'ProductionMessageSample' => production_message_sample,
        'OptInImageUrls' => Twilio.serialize_list(opt_in_image_urls) { |e| e },
        'OptInType' => opt_in_type,
        'MessageVolume' => message_volume,
        'BusinessStreetAddress' => business_street_address,
        'BusinessStreetAddress2' => business_street_address2,
        'BusinessCity' => business_city,
        'BusinessStateProvinceRegion' => business_state_province_region,
        'BusinessPostalCode' => business_postal_code,
        'BusinessCountry' => business_country,
        'AdditionalInformation' => additional_information,
        'BusinessContactFirstName' => business_contact_first_name,
        'BusinessContactLastName' => business_contact_last_name,
        'BusinessContactEmail' => business_contact_email,
        'BusinessContactPhone' => business_contact_phone,
        'EditReason' => edit_reason,
    })

    
    payload = @version.update('POST', @uri, data: data)
    TollfreeVerificationInstance.new(
        @version,
        payload,
        sid: @solution[:sid],
    )
end