Class: Plivo::Resources::TollfreeVerification

Inherits:
Base::Resource show all
Defined in:
lib/plivo/resources/tollfree_verification.rb

Constant Summary

Constants included from Utils

Utils::TYPE_WHITELIST

Instance Attribute Summary

Attributes inherited from Base::Resource

#id

Instance Method Summary collapse

Methods included from Utils

GetSortedQueryParamString?, compute_signatureV3?, expected_type?, expected_value?, generate_url?, getMapFromQueryString?, is_one_among_string_url?, multi_valid_param?, raise_invalid_request, valid_account?, valid_date_format?, valid_mainaccount?, valid_multiple_destination_integers?, valid_multiple_destination_nos?, valid_param?, valid_range?, valid_signature?, valid_signatureV3?, valid_subaccount?, valid_url?

Constructor Details

#initialize(client, options = nil) ⇒ TollfreeVerification

Returns a new instance of TollfreeVerification.



6
7
8
9
10
# File 'lib/plivo/resources/tollfree_verification.rb', line 6

def initialize(client, options = nil)
  @_name = 'TollfreeVerification'
  @_identifier_string = 'tollfree_verification'
  super
end

Instance Method Details

#deleteObject



29
30
31
# File 'lib/plivo/resources/tollfree_verification.rb', line 29

def delete
  perform_delete
end

#to_sObject



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/plivo/resources/tollfree_verification.rb', line 33

def to_s
  {
    api_id: @api_id,
    uuid: @uuid,
    number: @number,
    created_at: @created_at,
    updated_at: @updated_at,
    callback_method: @callback_url,
    callback_url: @callback_url,
    extra_data: @extra_data,
    additional_information: @additional_information,
    message_sample: @message_sample,
    optin_image_url: @optin_image_url,
    optin_type: @optin_type,
    profile_uuid: @profile_uuid,
    rejection_reason: @rejection_reason,
    status: @status,
    usecase: @usecase,
    usecase_summary: @usecase_summary,
    volume: @volume
  }.delete_if { |key, value| value.nil? }.to_s
end

#update(options = nil) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/plivo/resources/tollfree_verification.rb', line 12

def update(options = nil)
  return perform_update({}) if options.nil?

  valid_param?(:options, options, Hash, true)

  params = {}
  params_expected = %i[ usecase usecase_summary profile_uuid optin_type optin_image_url volume message_sample callback_method callback_url extra_data additional_information ]
  params_expected.each do |param|
    if options.key?(param) &&
       valid_param?(param, options[param], [String, Symbol], false)
      params[param] = options[param]
    end
  end

  perform_update(params)
end