bandwidth-sdk 11.3.0 → 12.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +18 -16
- data/README.md +15 -9
- data/Rakefile +4 -12
- data/bandwidth.yml +243 -28
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +1412 -1009
- data/coverage/index.html +16274 -11823
- data/custom_templates/README.mustache +4 -4
- data/docs/AnswerCallback.md +1 -1
- data/docs/BridgeCompleteCallback.md +1 -1
- data/docs/BridgeTargetCompleteCallback.md +1 -1
- data/docs/CallRecordingMetadata.md +3 -3
- data/docs/CallTranscription.md +24 -0
- data/docs/CallTranscriptionMetadata.md +20 -0
- data/docs/CallTranscriptionResponse.md +24 -0
- data/docs/CallsApi.md +1 -1
- data/docs/ConferenceMemberExitCallback.md +1 -1
- data/docs/ConferenceMemberJoinCallback.md +1 -1
- data/docs/CreateCall.md +5 -3
- data/docs/DisconnectCallback.md +1 -1
- data/docs/DtmfCallback.md +2 -2
- data/docs/GatherCallback.md +2 -2
- data/docs/InitiateCallback.md +1 -1
- data/docs/MachineDetectionCompleteCallback.md +1 -1
- data/docs/RecordingAvailableCallback.md +4 -4
- data/docs/RecordingCompleteCallback.md +2 -2
- data/docs/RecordingTranscriptionMetadata.md +24 -0
- data/docs/RecordingTranscriptions.md +18 -0
- data/docs/RecordingsApi.md +49 -49
- data/docs/RedirectCallback.md +2 -2
- data/docs/TranscriptionAvailableCallback.md +2 -2
- data/docs/TranscriptionsApi.md +229 -0
- data/docs/TransferAnswerCallback.md +2 -2
- data/docs/TransferCompleteCallback.md +2 -2
- data/docs/TransferDisconnectCallback.md +2 -2
- data/lib/bandwidth-sdk/api/recordings_api.rb +56 -56
- data/lib/bandwidth-sdk/api/transcriptions_api.rb +241 -0
- data/lib/bandwidth-sdk/configuration.rb +22 -4
- data/lib/bandwidth-sdk/models/answer_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/call_recording_metadata.rb +3 -3
- data/lib/bandwidth-sdk/models/call_transcription.rb +317 -0
- data/lib/bandwidth-sdk/models/call_transcription_metadata.rb +223 -0
- data/lib/bandwidth-sdk/models/call_transcription_response.rb +244 -0
- data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/create_call.rb +14 -3
- data/lib/bandwidth-sdk/models/disconnect_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/dtmf_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/gather_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/initiate_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +1 -1
- data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +1 -1
- data/lib/bandwidth-sdk/models/recording_available_callback.rb +4 -4
- data/lib/bandwidth-sdk/models/recording_complete_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/recording_transcription_metadata.rb +244 -0
- data/lib/bandwidth-sdk/models/recording_transcriptions.rb +214 -0
- data/lib/bandwidth-sdk/models/redirect_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/transcription_available_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +2 -2
- data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +2 -2
- data/lib/bandwidth-sdk/version.rb +1 -1
- data/lib/bandwidth-sdk.rb +6 -2
- data/spec/{integration/calls_api_integration_spec.rb → smoke/calls_api_spec.rb} +9 -7
- data/spec/{integration/conferences_api_integration_spec.rb → smoke/conferences_api_spec.rb} +9 -9
- data/spec/{integration/media_api_integration_spec.rb → smoke/media_api_spec.rb} +7 -7
- data/spec/{integration/messages_api_integration_spec.rb → smoke/messages_api_spec.rb} +3 -3
- data/spec/{integration/mfa_api_integration_spec.rb → smoke/mfa_api_spec.rb} +3 -3
- data/spec/{integration/phone_number_lookup_api_integration_spec.rb → smoke/phone_number_lookup_api_spec.rb} +2 -2
- data/spec/{integration/recordings_api_integration_spec.rb → smoke/recordings_api_spec.rb} +14 -14
- data/spec/{integration/statistics_api_integration_spec.rb → smoke/statistics_api_spec.rb} +1 -1
- data/spec/smoke/transcriptions_api_spec.rb +84 -0
- data/spec/spec_helper.rb +2 -2
- data/spec/{api → unit/api}/calls_api_spec.rb +6 -4
- data/spec/{api → unit/api}/conferences_api_spec.rb +12 -12
- data/spec/{api → unit/api}/media_api_spec.rb +6 -6
- data/spec/{api → unit/api}/messages_api_spec.rb +2 -2
- data/spec/{api → unit/api}/mfa_api_spec.rb +6 -6
- data/spec/{api → unit/api}/phone_number_lookup_api_spec.rb +2 -2
- data/spec/{api → unit/api}/recordings_api_spec.rb +30 -30
- data/spec/{api → unit/api}/statistics_api_spec.rb +1 -1
- data/spec/unit/api/transcriptions_api_spec.rb +130 -0
- data/spec/{api_client_spec.rb → unit/client/api_client_spec.rb} +2 -2
- metadata +130 -114
- /data/spec/{api_error_spec.rb → unit/client/api_error_spec.rb} +0 -0
- /data/spec/{configuration_spec.rb → unit/client/configuration_spec.rb} +0 -0
- /data/spec/{models → unit/models}/bxml/bxml_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/nestable_verb_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/response_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verb_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/bridge_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/conference_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/custom_param_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/forward_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/gather_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/hangup_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/pause_recording_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/pause_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/phone_number_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/play_audio_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/record_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/redirect_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/resume_recording_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/ring_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/send_dtmf_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/sip_uri_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/speak_sentence_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/start_gather_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/start_recording_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/start_stream_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/start_transcription_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/stop_gather_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/stop_recording_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/stop_stream_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/stop_transcription_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/stream_param_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/tag_spec.rb +0 -0
- /data/spec/{models → unit/models}/bxml/verbs/transfer_spec.rb +0 -0
- /data/spec/{models → unit/models}/call_state_enum_spec.rb +0 -0
- /data/spec/{models → unit/models}/call_state_spec.rb +0 -0
- /data/spec/{models → unit/models}/deferred_result_spec.rb +0 -0
- /data/spec/{models → unit/models}/message_spec.rb +0 -0
- /data/spec/{models → unit/models}/verify_code_request_spec.rb +0 -0
@@ -0,0 +1,223 @@
|
|
1
|
+
=begin
|
2
|
+
#Bandwidth
|
3
|
+
|
4
|
+
#Bandwidth's Communication APIs
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: letstalk@bandwidth.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Bandwidth
|
17
|
+
class CallTranscriptionMetadata
|
18
|
+
# The programmable voice API transcription ID.
|
19
|
+
attr_accessor :transcription_id
|
20
|
+
|
21
|
+
# A URL that may be used to retrieve the transcription itself. This points to the [Get Call Transcription](/apis/voice/#operation/getCallTranscription) endpoint.
|
22
|
+
attr_accessor :transcription_url
|
23
|
+
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
25
|
+
def self.attribute_map
|
26
|
+
{
|
27
|
+
:'transcription_id' => :'transcriptionId',
|
28
|
+
:'transcription_url' => :'transcriptionUrl'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns all the JSON keys this model knows about
|
33
|
+
def self.acceptable_attributes
|
34
|
+
attribute_map.values
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.openapi_types
|
39
|
+
{
|
40
|
+
:'transcription_id' => :'String',
|
41
|
+
:'transcription_url' => :'String'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# List of attributes with nullable: true
|
46
|
+
def self.openapi_nullable
|
47
|
+
Set.new([
|
48
|
+
])
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
if (!attributes.is_a?(Hash))
|
55
|
+
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CallTranscriptionMetadata` initialize method'
|
56
|
+
end
|
57
|
+
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CallTranscriptionMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
|
+
end
|
63
|
+
h[k.to_sym] = v
|
64
|
+
}
|
65
|
+
|
66
|
+
if attributes.key?(:'transcription_id')
|
67
|
+
self.transcription_id = attributes[:'transcription_id']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:'transcription_url')
|
71
|
+
self.transcription_url = attributes[:'transcription_url']
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
76
|
+
# @return Array for valid properties with the reasons
|
77
|
+
def list_invalid_properties
|
78
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
79
|
+
invalid_properties = Array.new
|
80
|
+
invalid_properties
|
81
|
+
end
|
82
|
+
|
83
|
+
# Check to see if the all the properties in the model are valid
|
84
|
+
# @return true if the model is valid
|
85
|
+
def valid?
|
86
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
87
|
+
true
|
88
|
+
end
|
89
|
+
|
90
|
+
# Checks equality by comparing each attribute.
|
91
|
+
# @param [Object] Object to be compared
|
92
|
+
def ==(o)
|
93
|
+
return true if self.equal?(o)
|
94
|
+
self.class == o.class &&
|
95
|
+
transcription_id == o.transcription_id &&
|
96
|
+
transcription_url == o.transcription_url
|
97
|
+
end
|
98
|
+
|
99
|
+
# @see the `==` method
|
100
|
+
# @param [Object] Object to be compared
|
101
|
+
def eql?(o)
|
102
|
+
self == o
|
103
|
+
end
|
104
|
+
|
105
|
+
# Calculates hash code according to all attributes.
|
106
|
+
# @return [Integer] Hash code
|
107
|
+
def hash
|
108
|
+
[transcription_id, transcription_url].hash
|
109
|
+
end
|
110
|
+
|
111
|
+
# Builds the object from hash
|
112
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
113
|
+
# @return [Object] Returns the model itself
|
114
|
+
def self.build_from_hash(attributes)
|
115
|
+
return nil unless attributes.is_a?(Hash)
|
116
|
+
attributes = attributes.transform_keys(&:to_sym)
|
117
|
+
transformed_hash = {}
|
118
|
+
openapi_types.each_pair do |key, type|
|
119
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
120
|
+
transformed_hash["#{key}"] = nil
|
121
|
+
elsif type =~ /\AArray<(.*)>/i
|
122
|
+
# check to ensure the input is an array given that the attribute
|
123
|
+
# is documented as an array but the input is not
|
124
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
125
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
126
|
+
end
|
127
|
+
elsif !attributes[attribute_map[key]].nil?
|
128
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
129
|
+
end
|
130
|
+
end
|
131
|
+
new(transformed_hash)
|
132
|
+
end
|
133
|
+
|
134
|
+
# Deserializes the data based on type
|
135
|
+
# @param string type Data type
|
136
|
+
# @param string value Value to be deserialized
|
137
|
+
# @return [Object] Deserialized data
|
138
|
+
def self._deserialize(type, value)
|
139
|
+
case type.to_sym
|
140
|
+
when :Time
|
141
|
+
Time.parse(value)
|
142
|
+
when :Date
|
143
|
+
Date.parse(value)
|
144
|
+
when :String
|
145
|
+
value.to_s
|
146
|
+
when :Integer
|
147
|
+
value.to_i
|
148
|
+
when :Float
|
149
|
+
value.to_f
|
150
|
+
when :Boolean
|
151
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
152
|
+
true
|
153
|
+
else
|
154
|
+
false
|
155
|
+
end
|
156
|
+
when :Object
|
157
|
+
# generic object (usually a Hash), return directly
|
158
|
+
value
|
159
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
160
|
+
inner_type = Regexp.last_match[:inner_type]
|
161
|
+
value.map { |v| _deserialize(inner_type, v) }
|
162
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
163
|
+
k_type = Regexp.last_match[:k_type]
|
164
|
+
v_type = Regexp.last_match[:v_type]
|
165
|
+
{}.tap do |hash|
|
166
|
+
value.each do |k, v|
|
167
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
else # model
|
171
|
+
# models (e.g. Pet) or oneOf
|
172
|
+
klass = Bandwidth.const_get(type)
|
173
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
# Returns the string representation of the object
|
178
|
+
# @return [String] String presentation of the object
|
179
|
+
def to_s
|
180
|
+
to_hash.to_s
|
181
|
+
end
|
182
|
+
|
183
|
+
# to_body is an alias to to_hash (backward compatibility)
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
185
|
+
def to_body
|
186
|
+
to_hash
|
187
|
+
end
|
188
|
+
|
189
|
+
# Returns the object in the form of hash
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
191
|
+
def to_hash
|
192
|
+
hash = {}
|
193
|
+
self.class.attribute_map.each_pair do |attr, param|
|
194
|
+
value = self.send(attr)
|
195
|
+
if value.nil?
|
196
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
197
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
198
|
+
end
|
199
|
+
|
200
|
+
hash[param] = _to_hash(value)
|
201
|
+
end
|
202
|
+
hash
|
203
|
+
end
|
204
|
+
|
205
|
+
# Outputs non-array value in the form of hash
|
206
|
+
# For object, use to_hash. Otherwise, just return the value
|
207
|
+
# @param [Object] value Any valid value
|
208
|
+
# @return [Hash] Returns the value in the form of hash
|
209
|
+
def _to_hash(value)
|
210
|
+
if value.is_a?(Array)
|
211
|
+
value.compact.map { |v| _to_hash(v) }
|
212
|
+
elsif value.is_a?(Hash)
|
213
|
+
{}.tap do |hash|
|
214
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
215
|
+
end
|
216
|
+
elsif value.respond_to? :to_hash
|
217
|
+
value.to_hash
|
218
|
+
else
|
219
|
+
value
|
220
|
+
end
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
@@ -0,0 +1,244 @@
|
|
1
|
+
=begin
|
2
|
+
#Bandwidth
|
3
|
+
|
4
|
+
#Bandwidth's Communication APIs
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: letstalk@bandwidth.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module Bandwidth
|
17
|
+
class CallTranscriptionResponse
|
18
|
+
# The user account associated with the call.
|
19
|
+
attr_accessor :account_id
|
20
|
+
|
21
|
+
# The call id associated with the event.
|
22
|
+
attr_accessor :call_id
|
23
|
+
|
24
|
+
# The programmable voice API transcription ID.
|
25
|
+
attr_accessor :transcription_id
|
26
|
+
|
27
|
+
attr_accessor :tracks
|
28
|
+
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
30
|
+
def self.attribute_map
|
31
|
+
{
|
32
|
+
:'account_id' => :'accountId',
|
33
|
+
:'call_id' => :'callId',
|
34
|
+
:'transcription_id' => :'transcriptionId',
|
35
|
+
:'tracks' => :'tracks'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Returns all the JSON keys this model knows about
|
40
|
+
def self.acceptable_attributes
|
41
|
+
attribute_map.values
|
42
|
+
end
|
43
|
+
|
44
|
+
# Attribute type mapping.
|
45
|
+
def self.openapi_types
|
46
|
+
{
|
47
|
+
:'account_id' => :'String',
|
48
|
+
:'call_id' => :'String',
|
49
|
+
:'transcription_id' => :'String',
|
50
|
+
:'tracks' => :'Array<CallTranscription>'
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
# List of attributes with nullable: true
|
55
|
+
def self.openapi_nullable
|
56
|
+
Set.new([
|
57
|
+
])
|
58
|
+
end
|
59
|
+
|
60
|
+
# Initializes the object
|
61
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
62
|
+
def initialize(attributes = {})
|
63
|
+
if (!attributes.is_a?(Hash))
|
64
|
+
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::CallTranscriptionResponse` initialize method'
|
65
|
+
end
|
66
|
+
|
67
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
68
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
69
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
70
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::CallTranscriptionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
71
|
+
end
|
72
|
+
h[k.to_sym] = v
|
73
|
+
}
|
74
|
+
|
75
|
+
if attributes.key?(:'account_id')
|
76
|
+
self.account_id = attributes[:'account_id']
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.key?(:'call_id')
|
80
|
+
self.call_id = attributes[:'call_id']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.key?(:'transcription_id')
|
84
|
+
self.transcription_id = attributes[:'transcription_id']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.key?(:'tracks')
|
88
|
+
if (value = attributes[:'tracks']).is_a?(Array)
|
89
|
+
self.tracks = value
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
95
|
+
# @return Array for valid properties with the reasons
|
96
|
+
def list_invalid_properties
|
97
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
98
|
+
invalid_properties = Array.new
|
99
|
+
invalid_properties
|
100
|
+
end
|
101
|
+
|
102
|
+
# Check to see if the all the properties in the model are valid
|
103
|
+
# @return true if the model is valid
|
104
|
+
def valid?
|
105
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
106
|
+
true
|
107
|
+
end
|
108
|
+
|
109
|
+
# Checks equality by comparing each attribute.
|
110
|
+
# @param [Object] Object to be compared
|
111
|
+
def ==(o)
|
112
|
+
return true if self.equal?(o)
|
113
|
+
self.class == o.class &&
|
114
|
+
account_id == o.account_id &&
|
115
|
+
call_id == o.call_id &&
|
116
|
+
transcription_id == o.transcription_id &&
|
117
|
+
tracks == o.tracks
|
118
|
+
end
|
119
|
+
|
120
|
+
# @see the `==` method
|
121
|
+
# @param [Object] Object to be compared
|
122
|
+
def eql?(o)
|
123
|
+
self == o
|
124
|
+
end
|
125
|
+
|
126
|
+
# Calculates hash code according to all attributes.
|
127
|
+
# @return [Integer] Hash code
|
128
|
+
def hash
|
129
|
+
[account_id, call_id, transcription_id, tracks].hash
|
130
|
+
end
|
131
|
+
|
132
|
+
# Builds the object from hash
|
133
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
134
|
+
# @return [Object] Returns the model itself
|
135
|
+
def self.build_from_hash(attributes)
|
136
|
+
return nil unless attributes.is_a?(Hash)
|
137
|
+
attributes = attributes.transform_keys(&:to_sym)
|
138
|
+
transformed_hash = {}
|
139
|
+
openapi_types.each_pair do |key, type|
|
140
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
141
|
+
transformed_hash["#{key}"] = nil
|
142
|
+
elsif type =~ /\AArray<(.*)>/i
|
143
|
+
# check to ensure the input is an array given that the attribute
|
144
|
+
# is documented as an array but the input is not
|
145
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
146
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
147
|
+
end
|
148
|
+
elsif !attributes[attribute_map[key]].nil?
|
149
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
150
|
+
end
|
151
|
+
end
|
152
|
+
new(transformed_hash)
|
153
|
+
end
|
154
|
+
|
155
|
+
# Deserializes the data based on type
|
156
|
+
# @param string type Data type
|
157
|
+
# @param string value Value to be deserialized
|
158
|
+
# @return [Object] Deserialized data
|
159
|
+
def self._deserialize(type, value)
|
160
|
+
case type.to_sym
|
161
|
+
when :Time
|
162
|
+
Time.parse(value)
|
163
|
+
when :Date
|
164
|
+
Date.parse(value)
|
165
|
+
when :String
|
166
|
+
value.to_s
|
167
|
+
when :Integer
|
168
|
+
value.to_i
|
169
|
+
when :Float
|
170
|
+
value.to_f
|
171
|
+
when :Boolean
|
172
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
173
|
+
true
|
174
|
+
else
|
175
|
+
false
|
176
|
+
end
|
177
|
+
when :Object
|
178
|
+
# generic object (usually a Hash), return directly
|
179
|
+
value
|
180
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
181
|
+
inner_type = Regexp.last_match[:inner_type]
|
182
|
+
value.map { |v| _deserialize(inner_type, v) }
|
183
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
184
|
+
k_type = Regexp.last_match[:k_type]
|
185
|
+
v_type = Regexp.last_match[:v_type]
|
186
|
+
{}.tap do |hash|
|
187
|
+
value.each do |k, v|
|
188
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
else # model
|
192
|
+
# models (e.g. Pet) or oneOf
|
193
|
+
klass = Bandwidth.const_get(type)
|
194
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
# Returns the string representation of the object
|
199
|
+
# @return [String] String presentation of the object
|
200
|
+
def to_s
|
201
|
+
to_hash.to_s
|
202
|
+
end
|
203
|
+
|
204
|
+
# to_body is an alias to to_hash (backward compatibility)
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
206
|
+
def to_body
|
207
|
+
to_hash
|
208
|
+
end
|
209
|
+
|
210
|
+
# Returns the object in the form of hash
|
211
|
+
# @return [Hash] Returns the object in the form of hash
|
212
|
+
def to_hash
|
213
|
+
hash = {}
|
214
|
+
self.class.attribute_map.each_pair do |attr, param|
|
215
|
+
value = self.send(attr)
|
216
|
+
if value.nil?
|
217
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
218
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
219
|
+
end
|
220
|
+
|
221
|
+
hash[param] = _to_hash(value)
|
222
|
+
end
|
223
|
+
hash
|
224
|
+
end
|
225
|
+
|
226
|
+
# Outputs non-array value in the form of hash
|
227
|
+
# For object, use to_hash. Otherwise, just return the value
|
228
|
+
# @param [Object] value Any valid value
|
229
|
+
# @return [Hash] Returns the value in the form of hash
|
230
|
+
def _to_hash(value)
|
231
|
+
if value.is_a?(Array)
|
232
|
+
value.compact.map { |v| _to_hash(v) }
|
233
|
+
elsif value.is_a?(Hash)
|
234
|
+
{}.tap do |hash|
|
235
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
236
|
+
end
|
237
|
+
elsif value.respond_to? :to_hash
|
238
|
+
value.to_hash
|
239
|
+
else
|
240
|
+
value
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
@@ -28,7 +28,7 @@ module Bandwidth
|
|
28
28
|
# The user-specified name of the conference that was recorded
|
29
29
|
attr_accessor :name
|
30
30
|
|
31
|
-
# The provided identifier of the caller
|
31
|
+
# The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).
|
32
32
|
attr_accessor :from
|
33
33
|
|
34
34
|
# The phone number that received the call, in E.164 format (e.g. +15555555555).
|
@@ -28,7 +28,7 @@ module Bandwidth
|
|
28
28
|
# The user-specified name of the conference that was recorded
|
29
29
|
attr_accessor :name
|
30
30
|
|
31
|
-
# The provided identifier of the caller
|
31
|
+
# The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).
|
32
32
|
attr_accessor :from
|
33
33
|
|
34
34
|
# The phone number that received the call, in E.164 format (e.g. +15555555555).
|
@@ -18,10 +18,13 @@ module Bandwidth
|
|
18
18
|
# The destination to call (must be an E.164 formatted number (e.g. `+15555551212`) or a SIP URI (e.g. `sip:user@server.example`)).
|
19
19
|
attr_accessor :to
|
20
20
|
|
21
|
-
# A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212
|
21
|
+
# A Bandwidth phone number on your account the call should come from (must be in E.164 format, like `+15555551212`) even if `privacy` is set to true.
|
22
22
|
attr_accessor :from
|
23
23
|
|
24
|
-
#
|
24
|
+
# Hide the calling number. The `displayName` field can be used to customize the displayed name.
|
25
|
+
attr_accessor :privacy
|
26
|
+
|
27
|
+
# The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`.
|
25
28
|
attr_accessor :display_name
|
26
29
|
|
27
30
|
# A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in <a href='https://tools.ietf.org/html/rfc7433'>RFC 7433</a>. Only 'jwt' and 'base64' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators.
|
@@ -98,6 +101,7 @@ module Bandwidth
|
|
98
101
|
{
|
99
102
|
:'to' => :'to',
|
100
103
|
:'from' => :'from',
|
104
|
+
:'privacy' => :'privacy',
|
101
105
|
:'display_name' => :'displayName',
|
102
106
|
:'uui' => :'uui',
|
103
107
|
:'application_id' => :'applicationId',
|
@@ -129,6 +133,7 @@ module Bandwidth
|
|
129
133
|
{
|
130
134
|
:'to' => :'String',
|
131
135
|
:'from' => :'String',
|
136
|
+
:'privacy' => :'Boolean',
|
132
137
|
:'display_name' => :'String',
|
133
138
|
:'uui' => :'String',
|
134
139
|
:'application_id' => :'String',
|
@@ -153,6 +158,7 @@ module Bandwidth
|
|
153
158
|
# List of attributes with nullable: true
|
154
159
|
def self.openapi_nullable
|
155
160
|
Set.new([
|
161
|
+
:'privacy',
|
156
162
|
:'display_name',
|
157
163
|
:'uui',
|
158
164
|
:'answer_method',
|
@@ -198,6 +204,10 @@ module Bandwidth
|
|
198
204
|
self.from = nil
|
199
205
|
end
|
200
206
|
|
207
|
+
if attributes.key?(:'privacy')
|
208
|
+
self.privacy = attributes[:'privacy']
|
209
|
+
end
|
210
|
+
|
201
211
|
if attributes.key?(:'display_name')
|
202
212
|
self.display_name = attributes[:'display_name']
|
203
213
|
end
|
@@ -540,6 +550,7 @@ module Bandwidth
|
|
540
550
|
self.class == o.class &&
|
541
551
|
to == o.to &&
|
542
552
|
from == o.from &&
|
553
|
+
privacy == o.privacy &&
|
543
554
|
display_name == o.display_name &&
|
544
555
|
uui == o.uui &&
|
545
556
|
application_id == o.application_id &&
|
@@ -569,7 +580,7 @@ module Bandwidth
|
|
569
580
|
# Calculates hash code according to all attributes.
|
570
581
|
# @return [Integer] Hash code
|
571
582
|
def hash
|
572
|
-
[to, from, display_name, uui, application_id, answer_url, answer_method, username, password, answer_fallback_url, answer_fallback_method, fallback_username, fallback_password, disconnect_url, disconnect_method, call_timeout, callback_timeout, machine_detection, priority, tag].hash
|
583
|
+
[to, from, privacy, display_name, uui, application_id, answer_url, answer_method, username, password, answer_fallback_url, answer_fallback_method, fallback_username, fallback_password, disconnect_url, disconnect_method, call_timeout, callback_timeout, machine_detection, priority, tag].hash
|
573
584
|
end
|
574
585
|
|
575
586
|
# Builds the object from hash
|
@@ -28,7 +28,7 @@ module Bandwidth
|
|
28
28
|
# The id of the application associated with the call.
|
29
29
|
attr_accessor :application_id
|
30
30
|
|
31
|
-
# The provided identifier of the caller
|
31
|
+
# The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).
|
32
32
|
attr_accessor :from
|
33
33
|
|
34
34
|
# The phone number that received the call, in E.164 format (e.g. +15555555555).
|
@@ -28,7 +28,7 @@ module Bandwidth
|
|
28
28
|
# The id of the application associated with the call.
|
29
29
|
attr_accessor :application_id
|
30
30
|
|
31
|
-
# The provided identifier of the caller
|
31
|
+
# The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).
|
32
32
|
attr_accessor :from
|
33
33
|
|
34
34
|
# The phone number that received the call, in E.164 format (e.g. +15555555555).
|
@@ -57,7 +57,7 @@ module Bandwidth
|
|
57
57
|
# (optional) If the event is related to the B leg of a <Transfer>, the call id of the original call leg that executed the <Transfer>. Otherwise, this field will not be present.
|
58
58
|
attr_accessor :parent_call_id
|
59
59
|
|
60
|
-
# The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555)
|
60
|
+
# The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555).
|
61
61
|
attr_accessor :transfer_caller_id
|
62
62
|
|
63
63
|
# The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).
|
@@ -28,7 +28,7 @@ module Bandwidth
|
|
28
28
|
# The id of the application associated with the call.
|
29
29
|
attr_accessor :application_id
|
30
30
|
|
31
|
-
# The provided identifier of the caller
|
31
|
+
# The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).
|
32
32
|
attr_accessor :from
|
33
33
|
|
34
34
|
# The phone number that received the call, in E.164 format (e.g. +15555555555).
|
@@ -60,7 +60,7 @@ module Bandwidth
|
|
60
60
|
# (optional) The digit the user pressed to end the gather. Empty string value if no terminating digit was pressed.
|
61
61
|
attr_accessor :terminating_digit
|
62
62
|
|
63
|
-
# The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555)
|
63
|
+
# The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555).
|
64
64
|
attr_accessor :transfer_caller_id
|
65
65
|
|
66
66
|
# The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).
|
@@ -28,7 +28,7 @@ module Bandwidth
|
|
28
28
|
# The id of the application associated with the call.
|
29
29
|
attr_accessor :application_id
|
30
30
|
|
31
|
-
# The provided identifier of the caller
|
31
|
+
# The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).
|
32
32
|
attr_accessor :from
|
33
33
|
|
34
34
|
# The phone number that received the call, in E.164 format (e.g. +15555555555).
|
@@ -28,7 +28,7 @@ module Bandwidth
|
|
28
28
|
# The id of the application associated with the call.
|
29
29
|
attr_accessor :application_id
|
30
30
|
|
31
|
-
# The provided identifier of the caller
|
31
|
+
# The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).
|
32
32
|
attr_accessor :from
|
33
33
|
|
34
34
|
# The phone number that received the call, in E.164 format (e.g. +15555555555).
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module Bandwidth
|
17
|
-
# The machine detection request used to perform <a href='/docs/voice/guides/machineDetection'>machine detection</a> on the call.
|
17
|
+
# The machine detection request used to perform <a href='/docs/voice/guides/machineDetection'>machine detection</a> on the call. Currently, there is an issue where decimal values are not getting processed correctly. Please use whole number values. We are working to resolve this issue. Please contact Bandwidth Support if you need more information.
|
18
18
|
class MachineDetectionConfiguration
|
19
19
|
attr_accessor :mode
|
20
20
|
|
@@ -28,7 +28,7 @@ module Bandwidth
|
|
28
28
|
# The id of the application associated with the call.
|
29
29
|
attr_accessor :application_id
|
30
30
|
|
31
|
-
# The provided identifier of the caller
|
31
|
+
# The provided identifier of the caller. Must be a phone number in E.164 format (e.g. +15555555555).
|
32
32
|
attr_accessor :from
|
33
33
|
|
34
34
|
# The phone number that received the call, in E.164 format (e.g. +15555555555).
|
@@ -65,7 +65,7 @@ module Bandwidth
|
|
65
65
|
|
66
66
|
attr_accessor :file_format
|
67
67
|
|
68
|
-
#
|
68
|
+
# Always `1` for conference recordings; multi-channel recordings are not supported on conferences.
|
69
69
|
attr_accessor :channels
|
70
70
|
|
71
71
|
# (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
|
@@ -74,7 +74,7 @@ module Bandwidth
|
|
74
74
|
# The current status of the process. For recording, current possible values are 'processing', 'partial', 'complete', 'deleted', and 'error'. For transcriptions, current possible values are 'none', 'processing', 'available', 'error', 'timeout', 'file-size-too-big', and 'file-size-too-small'. Additional states may be added in the future, so your application must be tolerant of unknown values.
|
75
75
|
attr_accessor :status
|
76
76
|
|
77
|
-
# The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555)
|
77
|
+
# The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555).
|
78
78
|
attr_accessor :transfer_caller_id
|
79
79
|
|
80
80
|
# The phone number used as the to field of the B-leg call, in E.164 format (e.g. +15555555555).
|
@@ -155,7 +155,7 @@ module Bandwidth
|
|
155
155
|
:'end_time' => :'Time',
|
156
156
|
:'duration' => :'String',
|
157
157
|
:'file_format' => :'FileFormatEnum',
|
158
|
-
:'channels' => :'
|
158
|
+
:'channels' => :'Integer',
|
159
159
|
:'tag' => :'String',
|
160
160
|
:'status' => :'String',
|
161
161
|
:'transfer_caller_id' => :'String',
|