bandwidth-sdk 2.1.1 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +85 -70
- data/lib/bandwidth.rb +31 -2
- data/lib/bandwidth/api_helper.rb +14 -9
- data/lib/bandwidth/client.rb +22 -2
- data/lib/bandwidth/configuration.rb +67 -12
- data/lib/bandwidth/http/api_response.rb +2 -0
- data/lib/bandwidth/http/auth/two_factor_auth_basic_auth.rb +22 -0
- data/lib/bandwidth/http/auth/web_rtc_basic_auth.rb +22 -0
- data/lib/bandwidth/http/faraday_client.rb +5 -2
- data/lib/bandwidth/messaging_lib/messaging.rb +5 -3
- data/lib/bandwidth/messaging_lib/messaging/client.rb +13 -2
- data/lib/bandwidth/messaging_lib/messaging/controllers/api_controller.rb +191 -113
- data/lib/bandwidth/messaging_lib/messaging/controllers/base_controller.rb +1 -1
- data/lib/bandwidth/messaging_lib/messaging/exceptions/{generic_client_exception.rb → messaging_exception.rb} +2 -14
- data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message.rb +23 -13
- data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_message_item.rb +125 -0
- data/lib/bandwidth/messaging_lib/messaging/models/bandwidth_messages_list.rb +60 -0
- data/lib/bandwidth/messaging_lib/messaging/models/media.rb +4 -4
- data/lib/bandwidth/messaging_lib/messaging/models/message_request.rb +21 -8
- data/lib/bandwidth/messaging_lib/messaging/models/page_info.rb +62 -0
- data/lib/bandwidth/messaging_lib/messaging/models/priority_enum.rb +19 -0
- data/lib/bandwidth/two_factor_auth_lib/two_factor_auth.rb +22 -0
- data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/client.rb +51 -0
- data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/base_controller.rb +49 -0
- data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/controllers/mfa_controller.rb +209 -0
- data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/error_with_request_exception.rb +34 -0
- data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/forbidden_request_exception.rb +29 -0
- data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/exceptions/unauthorized_request_exception.rb +29 -0
- data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_code_request_schema.rb +88 -0
- data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_messaging_response.rb +35 -0
- data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_code_response.rb +35 -0
- data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_verify_request_schema.rb +75 -0
- data/lib/bandwidth/two_factor_auth_lib/two_factor_auth/models/two_factor_voice_response.rb +35 -0
- data/lib/bandwidth/utilities/file_wrapper.rb +17 -0
- data/lib/bandwidth/voice_lib/bxml/verbs/bridge.rb +28 -0
- data/lib/bandwidth/voice_lib/bxml/verbs/conference.rb +32 -0
- data/lib/bandwidth/voice_lib/bxml/verbs/gather.rb +13 -1
- data/lib/bandwidth/voice_lib/bxml/verbs/phone_number.rb +7 -1
- data/lib/bandwidth/voice_lib/bxml/verbs/record.rb +9 -1
- data/lib/bandwidth/voice_lib/bxml/verbs/redirect.rb +5 -1
- data/lib/bandwidth/voice_lib/bxml/verbs/ring.rb +15 -0
- data/lib/bandwidth/voice_lib/bxml/verbs/send_dtmf.rb +4 -1
- data/lib/bandwidth/voice_lib/bxml/verbs/sip_uri.rb +25 -0
- data/lib/bandwidth/voice_lib/bxml/verbs/start_gather.rb +20 -0
- data/lib/bandwidth/voice_lib/bxml/verbs/start_recording.rb +4 -1
- data/lib/bandwidth/voice_lib/bxml/verbs/stop_gather.rb +14 -0
- data/lib/bandwidth/voice_lib/bxml/verbs/tag.rb +13 -0
- data/lib/bandwidth/voice_lib/bxml/verbs/transfer.rb +14 -3
- data/lib/bandwidth/voice_lib/voice.rb +19 -4
- data/lib/bandwidth/voice_lib/voice/client.rb +13 -2
- data/lib/bandwidth/voice_lib/voice/controllers/api_controller.rb +1219 -133
- data/lib/bandwidth/voice_lib/voice/controllers/base_controller.rb +1 -1
- data/lib/bandwidth/voice_lib/voice/exceptions/{error_response_exception.rb → api_error_response_exception.rb} +3 -3
- data/lib/bandwidth/voice_lib/voice/models/answer_fallback_method_enum.rb +17 -0
- data/lib/bandwidth/voice_lib/voice/models/api_call_response.rb +56 -2
- data/lib/bandwidth/voice_lib/voice/models/api_call_state_response.rb +164 -0
- data/lib/bandwidth/voice_lib/voice/models/api_create_call_request.rb +135 -12
- data/lib/bandwidth/voice_lib/voice/models/api_modify_call_request.rb +37 -1
- data/lib/bandwidth/voice_lib/voice/models/api_modify_conference_request.rb +107 -0
- data/lib/bandwidth/voice_lib/voice/models/api_transcribe_recording_request.rb +80 -0
- data/lib/bandwidth/voice_lib/voice/models/callback_method_enum.rb +35 -0
- data/lib/bandwidth/voice_lib/voice/models/conference_detail.rb +108 -0
- data/lib/bandwidth/voice_lib/voice/models/conference_event_method_enum.rb +35 -0
- data/lib/bandwidth/voice_lib/voice/models/conference_member_detail.rb +80 -0
- data/lib/bandwidth/voice_lib/voice/models/conference_recording_metadata_response.rb +126 -0
- data/lib/bandwidth/voice_lib/voice/models/disconnect_cause_enum.rb +47 -0
- data/lib/bandwidth/voice_lib/voice/models/modify_call_recording_state.rb +1 -1
- data/lib/bandwidth/voice_lib/voice/models/recording_metadata_response.rb +66 -28
- data/lib/bandwidth/voice_lib/voice/models/redirect_fallback_method_enum.rb +17 -0
- data/lib/bandwidth/voice_lib/voice/models/state1_enum.rb +4 -7
- data/lib/bandwidth/voice_lib/voice/models/state2_enum.rb +20 -0
- data/lib/bandwidth/voice_lib/voice/models/state_enum.rb +7 -4
- data/lib/bandwidth/voice_lib/voice/models/status1_enum.rb +29 -0
- data/lib/bandwidth/voice_lib/voice/models/status3_enum.rb +32 -0
- data/lib/bandwidth/voice_lib/voice/models/status_enum.rb +17 -0
- data/lib/bandwidth/{messaging_lib/messaging/models/field_error.rb → voice_lib/voice/models/transcript.rb} +15 -15
- data/lib/bandwidth/voice_lib/voice/models/transcription.rb +62 -0
- data/lib/bandwidth/voice_lib/voice/models/transcription_response.rb +42 -0
- data/lib/bandwidth/web_rtc_lib/utils/web_rtc_transfer.rb +13 -0
- data/lib/bandwidth/web_rtc_lib/web_rtc.rb +22 -0
- data/lib/bandwidth/web_rtc_lib/web_rtc/client.rb +51 -0
- data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/api_controller.rb +692 -0
- data/lib/bandwidth/web_rtc_lib/web_rtc/controllers/base_controller.rb +49 -0
- data/lib/bandwidth/{messaging_lib/messaging/exceptions/path_client_exception.rb → web_rtc_lib/web_rtc/exceptions/error_exception.rb} +4 -19
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/accounts_participants_response.rb +47 -0
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/device_api_version_enum.rb +17 -0
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant.rb +92 -0
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/participant_subscription.rb +35 -0
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/publish_permission_enum.rb +17 -0
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb +44 -0
- data/lib/bandwidth/web_rtc_lib/web_rtc/models/subscriptions.rb +54 -0
- data/test/integration/test_integration.rb +570 -0
- metadata +132 -19
- data/lib/bandwidth/voice_lib/voice/models/api_get_account_recordings_metadata_request.rb +0 -65
- data/lib/bandwidth/voice_lib/voice/models/transcription_status_enum.rb +0 -20
- data/lib/bandwidth/voice_lib/voice/models/type_enum.rb +0 -32
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
# ( https://apimatic.io ).
|
|
5
5
|
|
|
6
6
|
module Bandwidth
|
|
7
|
-
#
|
|
8
|
-
class
|
|
7
|
+
# MessagingException class.
|
|
8
|
+
class MessagingException < APIException
|
|
9
9
|
# TODO: Write general description for this method
|
|
10
10
|
# @return [String]
|
|
11
11
|
attr_accessor :type
|
|
@@ -14,10 +14,6 @@ module Bandwidth
|
|
|
14
14
|
# @return [String]
|
|
15
15
|
attr_accessor :description
|
|
16
16
|
|
|
17
|
-
# TODO: Write general description for this method
|
|
18
|
-
# @return [List of FieldError]
|
|
19
|
-
attr_accessor :field_errors
|
|
20
|
-
|
|
21
17
|
# The constructor.
|
|
22
18
|
# @param [String] The reason for raising an exception.
|
|
23
19
|
# @param [HttpResponse] The HttpReponse of the API call.
|
|
@@ -33,14 +29,6 @@ module Bandwidth
|
|
|
33
29
|
def unbox(hash)
|
|
34
30
|
@type = hash['type']
|
|
35
31
|
@description = hash['description']
|
|
36
|
-
# Parameter is an array, so we need to iterate through it
|
|
37
|
-
@field_errors = nil
|
|
38
|
-
unless hash['fieldErrors'].nil?
|
|
39
|
-
@field_errors = []
|
|
40
|
-
hash['fieldErrors'].each do |structure|
|
|
41
|
-
@field_errors << (FieldError.from_hash(structure) if structure)
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
32
|
end
|
|
45
33
|
end
|
|
46
34
|
end
|
|
@@ -6,50 +6,55 @@
|
|
|
6
6
|
module Bandwidth
|
|
7
7
|
# BandwidthMessage Model.
|
|
8
8
|
class BandwidthMessage < BaseModel
|
|
9
|
-
#
|
|
9
|
+
# The id of the message
|
|
10
10
|
# @return [String]
|
|
11
11
|
attr_accessor :id
|
|
12
12
|
|
|
13
|
-
#
|
|
13
|
+
# The Bandwidth phone number associated with the message
|
|
14
14
|
# @return [String]
|
|
15
15
|
attr_accessor :owner
|
|
16
16
|
|
|
17
|
-
#
|
|
17
|
+
# The application ID associated with the message
|
|
18
18
|
# @return [String]
|
|
19
19
|
attr_accessor :application_id
|
|
20
20
|
|
|
21
|
-
#
|
|
21
|
+
# The datetime stamp of the message in ISO 8601
|
|
22
22
|
# @return [String]
|
|
23
23
|
attr_accessor :time
|
|
24
24
|
|
|
25
|
-
#
|
|
25
|
+
# The number of segments the original message from the user is broken into
|
|
26
|
+
# before sending over to carrier networks
|
|
26
27
|
# @return [Integer]
|
|
27
28
|
attr_accessor :segment_count
|
|
28
29
|
|
|
29
|
-
#
|
|
30
|
+
# The direction of the message relative to Bandwidth. Can be in or out
|
|
30
31
|
# @return [String]
|
|
31
32
|
attr_accessor :direction
|
|
32
33
|
|
|
33
|
-
#
|
|
34
|
+
# The phone number recipients of the message
|
|
34
35
|
# @return [List of String]
|
|
35
36
|
attr_accessor :to
|
|
36
37
|
|
|
37
|
-
#
|
|
38
|
+
# The phone number the message was sent from
|
|
38
39
|
# @return [String]
|
|
39
40
|
attr_accessor :from
|
|
40
41
|
|
|
41
|
-
#
|
|
42
|
+
# The list of media URLs sent in the message
|
|
42
43
|
# @return [List of String]
|
|
43
44
|
attr_accessor :media
|
|
44
45
|
|
|
45
|
-
#
|
|
46
|
+
# The contents of the message
|
|
46
47
|
# @return [String]
|
|
47
48
|
attr_accessor :text
|
|
48
49
|
|
|
49
|
-
#
|
|
50
|
+
# The custom string set by the user
|
|
50
51
|
# @return [String]
|
|
51
52
|
attr_accessor :tag
|
|
52
53
|
|
|
54
|
+
# The priority specified by the user
|
|
55
|
+
# @return [String]
|
|
56
|
+
attr_accessor :priority
|
|
57
|
+
|
|
53
58
|
# A mapping from model property names to API property names.
|
|
54
59
|
def self.names
|
|
55
60
|
@_hash = {} if @_hash.nil?
|
|
@@ -64,6 +69,7 @@ module Bandwidth
|
|
|
64
69
|
@_hash['media'] = 'media'
|
|
65
70
|
@_hash['text'] = 'text'
|
|
66
71
|
@_hash['tag'] = 'tag'
|
|
72
|
+
@_hash['priority'] = 'priority'
|
|
67
73
|
@_hash
|
|
68
74
|
end
|
|
69
75
|
|
|
@@ -77,7 +83,8 @@ module Bandwidth
|
|
|
77
83
|
from = nil,
|
|
78
84
|
media = nil,
|
|
79
85
|
text = nil,
|
|
80
|
-
tag = nil
|
|
86
|
+
tag = nil,
|
|
87
|
+
priority = nil)
|
|
81
88
|
@id = id
|
|
82
89
|
@owner = owner
|
|
83
90
|
@application_id = application_id
|
|
@@ -89,6 +96,7 @@ module Bandwidth
|
|
|
89
96
|
@media = media
|
|
90
97
|
@text = text
|
|
91
98
|
@tag = tag
|
|
99
|
+
@priority = priority
|
|
92
100
|
end
|
|
93
101
|
|
|
94
102
|
# Creates an instance of the object from a hash.
|
|
@@ -107,6 +115,7 @@ module Bandwidth
|
|
|
107
115
|
media = hash['media']
|
|
108
116
|
text = hash['text']
|
|
109
117
|
tag = hash['tag']
|
|
118
|
+
priority = hash['priority']
|
|
110
119
|
|
|
111
120
|
# Create object from extracted values.
|
|
112
121
|
BandwidthMessage.new(id,
|
|
@@ -119,7 +128,8 @@ module Bandwidth
|
|
|
119
128
|
from,
|
|
120
129
|
media,
|
|
121
130
|
text,
|
|
122
|
-
tag
|
|
131
|
+
tag,
|
|
132
|
+
priority)
|
|
123
133
|
end
|
|
124
134
|
end
|
|
125
135
|
end
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# bandwidth
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
|
4
|
+
# ( https://apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Bandwidth
|
|
7
|
+
# BandwidthMessageItem Model.
|
|
8
|
+
class BandwidthMessageItem < BaseModel
|
|
9
|
+
# The message id
|
|
10
|
+
# @return [String]
|
|
11
|
+
attr_accessor :message_id
|
|
12
|
+
|
|
13
|
+
# The account id of the message
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_accessor :account_id
|
|
16
|
+
|
|
17
|
+
# The source phone number of the message
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :source_tn
|
|
20
|
+
|
|
21
|
+
# The recipient phone number of the message
|
|
22
|
+
# @return [String]
|
|
23
|
+
attr_accessor :destination_tn
|
|
24
|
+
|
|
25
|
+
# The status of the message
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_accessor :message_status
|
|
28
|
+
|
|
29
|
+
# The direction of the message relative to Bandwidth. INBOUND or OUTBOUND
|
|
30
|
+
# @return [String]
|
|
31
|
+
attr_accessor :message_direction
|
|
32
|
+
|
|
33
|
+
# The type of message. sms or mms
|
|
34
|
+
# @return [String]
|
|
35
|
+
attr_accessor :message_type
|
|
36
|
+
|
|
37
|
+
# The number of segments the message was sent as
|
|
38
|
+
# @return [Integer]
|
|
39
|
+
attr_accessor :segment_count
|
|
40
|
+
|
|
41
|
+
# The numeric error code of the message
|
|
42
|
+
# @return [Integer]
|
|
43
|
+
attr_accessor :error_code
|
|
44
|
+
|
|
45
|
+
# The ISO 8601 datetime of the message
|
|
46
|
+
# @return [String]
|
|
47
|
+
attr_accessor :receive_time
|
|
48
|
+
|
|
49
|
+
# The name of the carrier. Not currently supported for MMS, coming soon
|
|
50
|
+
# @return [String]
|
|
51
|
+
attr_accessor :carrier_name
|
|
52
|
+
|
|
53
|
+
# A mapping from model property names to API property names.
|
|
54
|
+
def self.names
|
|
55
|
+
@_hash = {} if @_hash.nil?
|
|
56
|
+
@_hash['message_id'] = 'messageId'
|
|
57
|
+
@_hash['account_id'] = 'accountId'
|
|
58
|
+
@_hash['source_tn'] = 'sourceTn'
|
|
59
|
+
@_hash['destination_tn'] = 'destinationTn'
|
|
60
|
+
@_hash['message_status'] = 'messageStatus'
|
|
61
|
+
@_hash['message_direction'] = 'messageDirection'
|
|
62
|
+
@_hash['message_type'] = 'messageType'
|
|
63
|
+
@_hash['segment_count'] = 'segmentCount'
|
|
64
|
+
@_hash['error_code'] = 'errorCode'
|
|
65
|
+
@_hash['receive_time'] = 'receiveTime'
|
|
66
|
+
@_hash['carrier_name'] = 'carrierName'
|
|
67
|
+
@_hash
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def initialize(message_id = nil,
|
|
71
|
+
account_id = nil,
|
|
72
|
+
source_tn = nil,
|
|
73
|
+
destination_tn = nil,
|
|
74
|
+
message_status = nil,
|
|
75
|
+
message_direction = nil,
|
|
76
|
+
message_type = nil,
|
|
77
|
+
segment_count = nil,
|
|
78
|
+
error_code = nil,
|
|
79
|
+
receive_time = nil,
|
|
80
|
+
carrier_name = nil)
|
|
81
|
+
@message_id = message_id
|
|
82
|
+
@account_id = account_id
|
|
83
|
+
@source_tn = source_tn
|
|
84
|
+
@destination_tn = destination_tn
|
|
85
|
+
@message_status = message_status
|
|
86
|
+
@message_direction = message_direction
|
|
87
|
+
@message_type = message_type
|
|
88
|
+
@segment_count = segment_count
|
|
89
|
+
@error_code = error_code
|
|
90
|
+
@receive_time = receive_time
|
|
91
|
+
@carrier_name = carrier_name
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Creates an instance of the object from a hash.
|
|
95
|
+
def self.from_hash(hash)
|
|
96
|
+
return nil unless hash
|
|
97
|
+
|
|
98
|
+
# Extract variables from the hash.
|
|
99
|
+
message_id = hash['messageId']
|
|
100
|
+
account_id = hash['accountId']
|
|
101
|
+
source_tn = hash['sourceTn']
|
|
102
|
+
destination_tn = hash['destinationTn']
|
|
103
|
+
message_status = hash['messageStatus']
|
|
104
|
+
message_direction = hash['messageDirection']
|
|
105
|
+
message_type = hash['messageType']
|
|
106
|
+
segment_count = hash['segmentCount']
|
|
107
|
+
error_code = hash['errorCode']
|
|
108
|
+
receive_time = hash['receiveTime']
|
|
109
|
+
carrier_name = hash['carrierName']
|
|
110
|
+
|
|
111
|
+
# Create object from extracted values.
|
|
112
|
+
BandwidthMessageItem.new(message_id,
|
|
113
|
+
account_id,
|
|
114
|
+
source_tn,
|
|
115
|
+
destination_tn,
|
|
116
|
+
message_status,
|
|
117
|
+
message_direction,
|
|
118
|
+
message_type,
|
|
119
|
+
segment_count,
|
|
120
|
+
error_code,
|
|
121
|
+
receive_time,
|
|
122
|
+
carrier_name)
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# bandwidth
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
|
4
|
+
# ( https://apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module Bandwidth
|
|
7
|
+
# BandwidthMessagesList Model.
|
|
8
|
+
class BandwidthMessagesList < BaseModel
|
|
9
|
+
# Total number of messages matched by the search
|
|
10
|
+
# @return [Integer]
|
|
11
|
+
attr_accessor :total_count
|
|
12
|
+
|
|
13
|
+
# Total number of messages matched by the search
|
|
14
|
+
# @return [PageInfo]
|
|
15
|
+
attr_accessor :page_info
|
|
16
|
+
|
|
17
|
+
# Total number of messages matched by the search
|
|
18
|
+
# @return [List of BandwidthMessageItem]
|
|
19
|
+
attr_accessor :messages
|
|
20
|
+
|
|
21
|
+
# A mapping from model property names to API property names.
|
|
22
|
+
def self.names
|
|
23
|
+
@_hash = {} if @_hash.nil?
|
|
24
|
+
@_hash['total_count'] = 'totalCount'
|
|
25
|
+
@_hash['page_info'] = 'pageInfo'
|
|
26
|
+
@_hash['messages'] = 'messages'
|
|
27
|
+
@_hash
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def initialize(total_count = nil,
|
|
31
|
+
page_info = nil,
|
|
32
|
+
messages = nil)
|
|
33
|
+
@total_count = total_count
|
|
34
|
+
@page_info = page_info
|
|
35
|
+
@messages = messages
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Creates an instance of the object from a hash.
|
|
39
|
+
def self.from_hash(hash)
|
|
40
|
+
return nil unless hash
|
|
41
|
+
|
|
42
|
+
# Extract variables from the hash.
|
|
43
|
+
total_count = hash['totalCount']
|
|
44
|
+
page_info = PageInfo.from_hash(hash['pageInfo']) if hash['pageInfo']
|
|
45
|
+
# Parameter is an array, so we need to iterate through it
|
|
46
|
+
messages = nil
|
|
47
|
+
unless hash['messages'].nil?
|
|
48
|
+
messages = []
|
|
49
|
+
hash['messages'].each do |structure|
|
|
50
|
+
messages << (BandwidthMessageItem.from_hash(structure) if structure)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Create object from extracted values.
|
|
55
|
+
BandwidthMessagesList.new(total_count,
|
|
56
|
+
page_info,
|
|
57
|
+
messages)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -30,19 +30,19 @@ module Bandwidth
|
|
|
30
30
|
# @return [List of Tag]
|
|
31
31
|
attr_accessor :tags
|
|
32
32
|
|
|
33
|
-
#
|
|
33
|
+
# User's account ID
|
|
34
34
|
# @return [String]
|
|
35
35
|
attr_accessor :user_id
|
|
36
36
|
|
|
37
|
-
#
|
|
37
|
+
# User's account ID
|
|
38
38
|
# @return [String]
|
|
39
39
|
attr_accessor :media_name
|
|
40
40
|
|
|
41
|
-
#
|
|
41
|
+
# User's account ID
|
|
42
42
|
# @return [String]
|
|
43
43
|
attr_accessor :media_id
|
|
44
44
|
|
|
45
|
-
#
|
|
45
|
+
# User's account ID
|
|
46
46
|
# @return [String]
|
|
47
47
|
attr_accessor :cache_control
|
|
48
48
|
|
|
@@ -6,30 +6,38 @@
|
|
|
6
6
|
module Bandwidth
|
|
7
7
|
# MessageRequest Model.
|
|
8
8
|
class MessageRequest < BaseModel
|
|
9
|
-
#
|
|
9
|
+
# The ID of the Application your from number is associated with in the
|
|
10
|
+
# Bandwidth Phone Number Dashboard.
|
|
10
11
|
# @return [String]
|
|
11
12
|
attr_accessor :application_id
|
|
12
13
|
|
|
13
|
-
#
|
|
14
|
+
# The phone number(s) the message should be sent to in E164 format
|
|
14
15
|
# @return [List of String]
|
|
15
16
|
attr_accessor :to
|
|
16
17
|
|
|
17
|
-
#
|
|
18
|
+
# One of your telephone numbers the message should come from in E164 format
|
|
18
19
|
# @return [String]
|
|
19
20
|
attr_accessor :from
|
|
20
21
|
|
|
21
|
-
#
|
|
22
|
+
# The contents of the text message. Must be 2048 characters or less.
|
|
22
23
|
# @return [String]
|
|
23
24
|
attr_accessor :text
|
|
24
25
|
|
|
25
|
-
#
|
|
26
|
+
# A list of URLs to include as media attachments as part of the message.
|
|
26
27
|
# @return [List of String]
|
|
27
28
|
attr_accessor :media
|
|
28
29
|
|
|
29
|
-
#
|
|
30
|
+
# A custom string that will be included in callback events of the message.
|
|
31
|
+
# Max 1024 characters
|
|
30
32
|
# @return [String]
|
|
31
33
|
attr_accessor :tag
|
|
32
34
|
|
|
35
|
+
# The message's priority, currently for toll-free or short code SMS only.
|
|
36
|
+
# Messages with a priority value of `"high"` are given preference over your
|
|
37
|
+
# other traffic.
|
|
38
|
+
# @return [PriorityEnum]
|
|
39
|
+
attr_accessor :priority
|
|
40
|
+
|
|
33
41
|
# A mapping from model property names to API property names.
|
|
34
42
|
def self.names
|
|
35
43
|
@_hash = {} if @_hash.nil?
|
|
@@ -39,6 +47,7 @@ module Bandwidth
|
|
|
39
47
|
@_hash['text'] = 'text'
|
|
40
48
|
@_hash['media'] = 'media'
|
|
41
49
|
@_hash['tag'] = 'tag'
|
|
50
|
+
@_hash['priority'] = 'priority'
|
|
42
51
|
@_hash
|
|
43
52
|
end
|
|
44
53
|
|
|
@@ -47,13 +56,15 @@ module Bandwidth
|
|
|
47
56
|
from = nil,
|
|
48
57
|
text = nil,
|
|
49
58
|
media = nil,
|
|
50
|
-
tag = nil
|
|
59
|
+
tag = nil,
|
|
60
|
+
priority = nil)
|
|
51
61
|
@application_id = application_id
|
|
52
62
|
@to = to
|
|
53
63
|
@from = from
|
|
54
64
|
@text = text
|
|
55
65
|
@media = media
|
|
56
66
|
@tag = tag
|
|
67
|
+
@priority = priority
|
|
57
68
|
end
|
|
58
69
|
|
|
59
70
|
# Creates an instance of the object from a hash.
|
|
@@ -67,6 +78,7 @@ module Bandwidth
|
|
|
67
78
|
text = hash['text']
|
|
68
79
|
media = hash['media']
|
|
69
80
|
tag = hash['tag']
|
|
81
|
+
priority = hash['priority']
|
|
70
82
|
|
|
71
83
|
# Create object from extracted values.
|
|
72
84
|
MessageRequest.new(application_id,
|
|
@@ -74,7 +86,8 @@ module Bandwidth
|
|
|
74
86
|
from,
|
|
75
87
|
text,
|
|
76
88
|
media,
|
|
77
|
-
tag
|
|
89
|
+
tag,
|
|
90
|
+
priority)
|
|
78
91
|
end
|
|
79
92
|
end
|
|
80
93
|
end
|