Class: Plivo::Resources::Message

Inherits:
Base::Resource show all
Defined in:
lib/plivo/resources/messages.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) ⇒ Message

Returns a new instance of Message.



5
6
7
8
9
# File 'lib/plivo/resources/messages.rb', line 5

def initialize(client, options = nil)
  @_name = 'Message'
  @_identifier_string = 'message_uuid'
  super
end

Instance Method Details

#deleteMediaObject



14
15
16
# File 'lib/plivo/resources/messages.rb', line 14

def deleteMedia()
  perform_action_apiresponse('Media', 'DELETE') 
end

#listMediaObject



10
11
12
# File 'lib/plivo/resources/messages.rb', line 10

def listMedia()
  perform_action_apiresponse('Media', 'GET') 
end

#to_sObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/plivo/resources/messages.rb', line 18

def to_s
  {
    api_id: @api_id,
    error_code: @error_code,
    from_number: @from_number,
    message_direction: @message_direction,
    message_state: @message_state,
    message_time: @message_time,
    message_type: @message_type,
    message_uuid: @message_uuid,
    resource_uri: @resource_uri,
    to_number: @to_number,
    total_amount: @total_amount,
    total_rate: @total_rate,
    powerpack_id: @powerpack_id,
    units: @units,
    tendlc_campaign_id: @tendlc_campaign_id,
    destination_country_iso2: @destination_country_iso2,
    tendlc_registration_status: @tendlc_registration_status,
    requester_ip: @requester_ip,
    is_domestic: @is_domestic,
    replaced_sender: @replaced_sender,
    dlt_entity_id: @dlt_entity_id,
    dlt_template_id: @dlt_template_id,
    dlt_template_category: @dlt_template_category,
    destination_network: @destination_network,
    carrier_fees_rate: @carrier_fees_rate,
    carrier_fees: @carrier_fees,
    conversation_id: @conversation_id,
    conversation_origin: @conversation_origin,
    conversation_expiration_timestamp: @conversation_expiration_timestamp
  }.to_s
end