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.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +18 -16
  3. data/README.md +15 -9
  4. data/Rakefile +4 -12
  5. data/bandwidth.yml +243 -28
  6. data/coverage/.last_run.json +1 -1
  7. data/coverage/.resultset.json +1412 -1009
  8. data/coverage/index.html +16274 -11823
  9. data/custom_templates/README.mustache +4 -4
  10. data/docs/AnswerCallback.md +1 -1
  11. data/docs/BridgeCompleteCallback.md +1 -1
  12. data/docs/BridgeTargetCompleteCallback.md +1 -1
  13. data/docs/CallRecordingMetadata.md +3 -3
  14. data/docs/CallTranscription.md +24 -0
  15. data/docs/CallTranscriptionMetadata.md +20 -0
  16. data/docs/CallTranscriptionResponse.md +24 -0
  17. data/docs/CallsApi.md +1 -1
  18. data/docs/ConferenceMemberExitCallback.md +1 -1
  19. data/docs/ConferenceMemberJoinCallback.md +1 -1
  20. data/docs/CreateCall.md +5 -3
  21. data/docs/DisconnectCallback.md +1 -1
  22. data/docs/DtmfCallback.md +2 -2
  23. data/docs/GatherCallback.md +2 -2
  24. data/docs/InitiateCallback.md +1 -1
  25. data/docs/MachineDetectionCompleteCallback.md +1 -1
  26. data/docs/RecordingAvailableCallback.md +4 -4
  27. data/docs/RecordingCompleteCallback.md +2 -2
  28. data/docs/RecordingTranscriptionMetadata.md +24 -0
  29. data/docs/RecordingTranscriptions.md +18 -0
  30. data/docs/RecordingsApi.md +49 -49
  31. data/docs/RedirectCallback.md +2 -2
  32. data/docs/TranscriptionAvailableCallback.md +2 -2
  33. data/docs/TranscriptionsApi.md +229 -0
  34. data/docs/TransferAnswerCallback.md +2 -2
  35. data/docs/TransferCompleteCallback.md +2 -2
  36. data/docs/TransferDisconnectCallback.md +2 -2
  37. data/lib/bandwidth-sdk/api/recordings_api.rb +56 -56
  38. data/lib/bandwidth-sdk/api/transcriptions_api.rb +241 -0
  39. data/lib/bandwidth-sdk/configuration.rb +22 -4
  40. data/lib/bandwidth-sdk/models/answer_callback.rb +1 -1
  41. data/lib/bandwidth-sdk/models/bridge_complete_callback.rb +1 -1
  42. data/lib/bandwidth-sdk/models/bridge_target_complete_callback.rb +1 -1
  43. data/lib/bandwidth-sdk/models/call_recording_metadata.rb +3 -3
  44. data/lib/bandwidth-sdk/models/call_transcription.rb +317 -0
  45. data/lib/bandwidth-sdk/models/call_transcription_metadata.rb +223 -0
  46. data/lib/bandwidth-sdk/models/call_transcription_response.rb +244 -0
  47. data/lib/bandwidth-sdk/models/conference_member_exit_callback.rb +1 -1
  48. data/lib/bandwidth-sdk/models/conference_member_join_callback.rb +1 -1
  49. data/lib/bandwidth-sdk/models/create_call.rb +14 -3
  50. data/lib/bandwidth-sdk/models/disconnect_callback.rb +1 -1
  51. data/lib/bandwidth-sdk/models/dtmf_callback.rb +2 -2
  52. data/lib/bandwidth-sdk/models/gather_callback.rb +2 -2
  53. data/lib/bandwidth-sdk/models/initiate_callback.rb +1 -1
  54. data/lib/bandwidth-sdk/models/machine_detection_complete_callback.rb +1 -1
  55. data/lib/bandwidth-sdk/models/machine_detection_configuration.rb +1 -1
  56. data/lib/bandwidth-sdk/models/recording_available_callback.rb +4 -4
  57. data/lib/bandwidth-sdk/models/recording_complete_callback.rb +2 -2
  58. data/lib/bandwidth-sdk/models/recording_transcription_metadata.rb +244 -0
  59. data/lib/bandwidth-sdk/models/recording_transcriptions.rb +214 -0
  60. data/lib/bandwidth-sdk/models/redirect_callback.rb +2 -2
  61. data/lib/bandwidth-sdk/models/transcription_available_callback.rb +2 -2
  62. data/lib/bandwidth-sdk/models/transfer_answer_callback.rb +2 -2
  63. data/lib/bandwidth-sdk/models/transfer_complete_callback.rb +2 -2
  64. data/lib/bandwidth-sdk/models/transfer_disconnect_callback.rb +2 -2
  65. data/lib/bandwidth-sdk/version.rb +1 -1
  66. data/lib/bandwidth-sdk.rb +6 -2
  67. data/spec/{integration/calls_api_integration_spec.rb → smoke/calls_api_spec.rb} +9 -7
  68. data/spec/{integration/conferences_api_integration_spec.rb → smoke/conferences_api_spec.rb} +9 -9
  69. data/spec/{integration/media_api_integration_spec.rb → smoke/media_api_spec.rb} +7 -7
  70. data/spec/{integration/messages_api_integration_spec.rb → smoke/messages_api_spec.rb} +3 -3
  71. data/spec/{integration/mfa_api_integration_spec.rb → smoke/mfa_api_spec.rb} +3 -3
  72. data/spec/{integration/phone_number_lookup_api_integration_spec.rb → smoke/phone_number_lookup_api_spec.rb} +2 -2
  73. data/spec/{integration/recordings_api_integration_spec.rb → smoke/recordings_api_spec.rb} +14 -14
  74. data/spec/{integration/statistics_api_integration_spec.rb → smoke/statistics_api_spec.rb} +1 -1
  75. data/spec/smoke/transcriptions_api_spec.rb +84 -0
  76. data/spec/spec_helper.rb +2 -2
  77. data/spec/{api → unit/api}/calls_api_spec.rb +6 -4
  78. data/spec/{api → unit/api}/conferences_api_spec.rb +12 -12
  79. data/spec/{api → unit/api}/media_api_spec.rb +6 -6
  80. data/spec/{api → unit/api}/messages_api_spec.rb +2 -2
  81. data/spec/{api → unit/api}/mfa_api_spec.rb +6 -6
  82. data/spec/{api → unit/api}/phone_number_lookup_api_spec.rb +2 -2
  83. data/spec/{api → unit/api}/recordings_api_spec.rb +30 -30
  84. data/spec/{api → unit/api}/statistics_api_spec.rb +1 -1
  85. data/spec/unit/api/transcriptions_api_spec.rb +130 -0
  86. data/spec/{api_client_spec.rb → unit/client/api_client_spec.rb} +2 -2
  87. metadata +130 -114
  88. /data/spec/{api_error_spec.rb → unit/client/api_error_spec.rb} +0 -0
  89. /data/spec/{configuration_spec.rb → unit/client/configuration_spec.rb} +0 -0
  90. /data/spec/{models → unit/models}/bxml/bxml_spec.rb +0 -0
  91. /data/spec/{models → unit/models}/bxml/nestable_verb_spec.rb +0 -0
  92. /data/spec/{models → unit/models}/bxml/response_spec.rb +0 -0
  93. /data/spec/{models → unit/models}/bxml/verb_spec.rb +0 -0
  94. /data/spec/{models → unit/models}/bxml/verbs/bridge_spec.rb +0 -0
  95. /data/spec/{models → unit/models}/bxml/verbs/conference_spec.rb +0 -0
  96. /data/spec/{models → unit/models}/bxml/verbs/custom_param_spec.rb +0 -0
  97. /data/spec/{models → unit/models}/bxml/verbs/forward_spec.rb +0 -0
  98. /data/spec/{models → unit/models}/bxml/verbs/gather_spec.rb +0 -0
  99. /data/spec/{models → unit/models}/bxml/verbs/hangup_spec.rb +0 -0
  100. /data/spec/{models → unit/models}/bxml/verbs/pause_recording_spec.rb +0 -0
  101. /data/spec/{models → unit/models}/bxml/verbs/pause_spec.rb +0 -0
  102. /data/spec/{models → unit/models}/bxml/verbs/phone_number_spec.rb +0 -0
  103. /data/spec/{models → unit/models}/bxml/verbs/play_audio_spec.rb +0 -0
  104. /data/spec/{models → unit/models}/bxml/verbs/record_spec.rb +0 -0
  105. /data/spec/{models → unit/models}/bxml/verbs/redirect_spec.rb +0 -0
  106. /data/spec/{models → unit/models}/bxml/verbs/resume_recording_spec.rb +0 -0
  107. /data/spec/{models → unit/models}/bxml/verbs/ring_spec.rb +0 -0
  108. /data/spec/{models → unit/models}/bxml/verbs/send_dtmf_spec.rb +0 -0
  109. /data/spec/{models → unit/models}/bxml/verbs/sip_uri_spec.rb +0 -0
  110. /data/spec/{models → unit/models}/bxml/verbs/speak_sentence_spec.rb +0 -0
  111. /data/spec/{models → unit/models}/bxml/verbs/start_gather_spec.rb +0 -0
  112. /data/spec/{models → unit/models}/bxml/verbs/start_recording_spec.rb +0 -0
  113. /data/spec/{models → unit/models}/bxml/verbs/start_stream_spec.rb +0 -0
  114. /data/spec/{models → unit/models}/bxml/verbs/start_transcription_spec.rb +0 -0
  115. /data/spec/{models → unit/models}/bxml/verbs/stop_gather_spec.rb +0 -0
  116. /data/spec/{models → unit/models}/bxml/verbs/stop_recording_spec.rb +0 -0
  117. /data/spec/{models → unit/models}/bxml/verbs/stop_stream_spec.rb +0 -0
  118. /data/spec/{models → unit/models}/bxml/verbs/stop_transcription_spec.rb +0 -0
  119. /data/spec/{models → unit/models}/bxml/verbs/stream_param_spec.rb +0 -0
  120. /data/spec/{models → unit/models}/bxml/verbs/tag_spec.rb +0 -0
  121. /data/spec/{models → unit/models}/bxml/verbs/transfer_spec.rb +0 -0
  122. /data/spec/{models → unit/models}/call_state_enum_spec.rb +0 -0
  123. /data/spec/{models → unit/models}/call_state_spec.rb +0 -0
  124. /data/spec/{models → unit/models}/deferred_result_spec.rb +0 -0
  125. /data/spec/{models → unit/models}/message_spec.rb +0 -0
  126. /data/spec/{models → unit/models}/verify_code_request_spec.rb +0 -0
@@ -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: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
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).
@@ -74,7 +74,7 @@ module Bandwidth
74
74
  # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
75
75
  attr_accessor :tag
76
76
 
77
- # The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.
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).
@@ -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
+ # If the recording was transcribed, metadata about the transcription
18
+ class RecordingTranscriptionMetadata
19
+ # The unique transcription ID
20
+ attr_accessor :id
21
+
22
+ # 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.
23
+ attr_accessor :status
24
+
25
+ # The time that the transcription was completed
26
+ attr_accessor :completed_time
27
+
28
+ # The URL of the [transcription](#operation/getCallTranscription)
29
+ attr_accessor :url
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'id' => :'id',
35
+ :'status' => :'status',
36
+ :'completed_time' => :'completedTime',
37
+ :'url' => :'url'
38
+ }
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'id' => :'String',
50
+ :'status' => :'String',
51
+ :'completed_time' => :'String',
52
+ :'url' => :'String'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::RecordingTranscriptionMetadata` initialize method'
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!self.class.attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RecordingTranscriptionMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'id')
78
+ self.id = attributes[:'id']
79
+ end
80
+
81
+ if attributes.key?(:'status')
82
+ self.status = attributes[:'status']
83
+ end
84
+
85
+ if attributes.key?(:'completed_time')
86
+ self.completed_time = attributes[:'completed_time']
87
+ end
88
+
89
+ if attributes.key?(:'url')
90
+ self.url = attributes[:'url']
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
+ id == o.id &&
115
+ status == o.status &&
116
+ completed_time == o.completed_time &&
117
+ url == o.url
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
+ [id, status, completed_time, url].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
@@ -0,0 +1,214 @@
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 RecordingTranscriptions
18
+ attr_accessor :transcripts
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'transcripts' => :'transcripts'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'transcripts' => :'Array<Transcription>'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::RecordingTranscriptions` initialize method'
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RecordingTranscriptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'transcripts')
61
+ if (value = attributes[:'transcripts']).is_a?(Array)
62
+ self.transcripts = value
63
+ end
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
71
+ invalid_properties = Array.new
72
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ warn '[DEPRECATED] the `valid?` method is obsolete'
79
+ true
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param [Object] Object to be compared
84
+ def ==(o)
85
+ return true if self.equal?(o)
86
+ self.class == o.class &&
87
+ transcripts == o.transcripts
88
+ end
89
+
90
+ # @see the `==` method
91
+ # @param [Object] Object to be compared
92
+ def eql?(o)
93
+ self == o
94
+ end
95
+
96
+ # Calculates hash code according to all attributes.
97
+ # @return [Integer] Hash code
98
+ def hash
99
+ [transcripts].hash
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def self.build_from_hash(attributes)
106
+ return nil unless attributes.is_a?(Hash)
107
+ attributes = attributes.transform_keys(&:to_sym)
108
+ transformed_hash = {}
109
+ openapi_types.each_pair do |key, type|
110
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
111
+ transformed_hash["#{key}"] = nil
112
+ elsif type =~ /\AArray<(.*)>/i
113
+ # check to ensure the input is an array given that the attribute
114
+ # is documented as an array but the input is not
115
+ if attributes[attribute_map[key]].is_a?(Array)
116
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
117
+ end
118
+ elsif !attributes[attribute_map[key]].nil?
119
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
120
+ end
121
+ end
122
+ new(transformed_hash)
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def self._deserialize(type, value)
130
+ case type.to_sym
131
+ when :Time
132
+ Time.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :Boolean
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ # models (e.g. Pet) or oneOf
163
+ klass = Bandwidth.const_get(type)
164
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ if value.nil?
187
+ is_nullable = self.class.openapi_nullable.include?(attr)
188
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
189
+ end
190
+
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map { |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end
213
+ end
214
+ end
@@ -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: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
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) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
58
58
  attr_accessor :tag
59
59
 
60
- # The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.
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: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
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).
@@ -70,7 +70,7 @@ module Bandwidth
70
70
 
71
71
  attr_accessor :transcription
72
72
 
73
- # The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.
73
+ # The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555).
74
74
  attr_accessor :transfer_caller_id
75
75
 
76
76
  # 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: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
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).
@@ -54,7 +54,7 @@ module Bandwidth
54
54
  # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
55
55
  attr_accessor :tag
56
56
 
57
- # The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.
57
+ # The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555).
58
58
  attr_accessor :transfer_caller_id
59
59
 
60
60
  # 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: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
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).
@@ -54,7 +54,7 @@ module Bandwidth
54
54
  # (optional) The tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
55
55
  attr_accessor :tag
56
56
 
57
- # The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.
57
+ # The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555).
58
58
  attr_accessor :transfer_caller_id
59
59
 
60
60
  # 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: can be a phone number in E.164 format (e.g. +15555555555) or one of Private, Restricted, Unavailable, or Anonymous.
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 tag specified on call creation. If no tag was specified or it was previously cleared, this field will not be present.
61
61
  attr_accessor :tag
62
62
 
63
- # The phone number used as the from field of the B-leg call, in E.164 format (e.g. +15555555555) or one of Restricted, Anonymous, Private, or Unavailable.
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).
@@ -11,5 +11,5 @@ OpenAPI Generator version: 7.0.0
11
11
  =end
12
12
 
13
13
  module Bandwidth
14
- VERSION = '11.3.0'
14
+ VERSION = '12.1.0'
15
15
  end
data/lib/bandwidth-sdk.rb CHANGED
@@ -25,6 +25,9 @@ require 'bandwidth-sdk/models/call_direction_enum'
25
25
  require 'bandwidth-sdk/models/call_recording_metadata'
26
26
  require 'bandwidth-sdk/models/call_state'
27
27
  require 'bandwidth-sdk/models/call_state_enum'
28
+ require 'bandwidth-sdk/models/call_transcription'
29
+ require 'bandwidth-sdk/models/call_transcription_metadata'
30
+ require 'bandwidth-sdk/models/call_transcription_response'
28
31
  require 'bandwidth-sdk/models/callback_method_enum'
29
32
  require 'bandwidth-sdk/models/code_request'
30
33
  require 'bandwidth-sdk/models/conference'
@@ -84,6 +87,8 @@ require 'bandwidth-sdk/models/priority_enum'
84
87
  require 'bandwidth-sdk/models/recording_available_callback'
85
88
  require 'bandwidth-sdk/models/recording_complete_callback'
86
89
  require 'bandwidth-sdk/models/recording_state_enum'
90
+ require 'bandwidth-sdk/models/recording_transcription_metadata'
91
+ require 'bandwidth-sdk/models/recording_transcriptions'
87
92
  require 'bandwidth-sdk/models/redirect_callback'
88
93
  require 'bandwidth-sdk/models/redirect_method_enum'
89
94
  require 'bandwidth-sdk/models/stir_shaken'
@@ -92,8 +97,6 @@ require 'bandwidth-sdk/models/tn_lookup_request_error'
92
97
  require 'bandwidth-sdk/models/transcribe_recording'
93
98
  require 'bandwidth-sdk/models/transcription'
94
99
  require 'bandwidth-sdk/models/transcription_available_callback'
95
- require 'bandwidth-sdk/models/transcription_list'
96
- require 'bandwidth-sdk/models/transcription_metadata'
97
100
  require 'bandwidth-sdk/models/transfer_answer_callback'
98
101
  require 'bandwidth-sdk/models/transfer_complete_callback'
99
102
  require 'bandwidth-sdk/models/transfer_disconnect_callback'
@@ -150,6 +153,7 @@ require 'bandwidth-sdk/api/messages_api'
150
153
  require 'bandwidth-sdk/api/phone_number_lookup_api'
151
154
  require 'bandwidth-sdk/api/recordings_api'
152
155
  require 'bandwidth-sdk/api/statistics_api'
156
+ require 'bandwidth-sdk/api/transcriptions_api'
153
157
 
154
158
  module Bandwidth
155
159
  class << self
@@ -3,6 +3,7 @@ require_relative '../call_utils'
3
3
  # Integration Tests for Bandwidth::CallsApi
4
4
  describe 'CallsApi Integration Tests' do
5
5
  # call info
6
+ let(:privacy) { false }
6
7
  let(:display_name) { 'Ruby SDK' }
7
8
  let(:answer_method) { Bandwidth::CallbackMethodEnum::POST }
8
9
  let(:answer_url) { BASE_CALLBACK_URL + '/callbacks/answer' }
@@ -48,6 +49,7 @@ describe 'CallsApi Integration Tests' do
48
49
  application_id: BW_VOICE_APPLICATION_ID,
49
50
  to: USER_NUMBER,
50
51
  from: BW_NUMBER,
52
+ privacy: privacy,
51
53
  display_name: display_name,
52
54
  answer_url: answer_url,
53
55
  answer_method: answer_method,
@@ -58,7 +60,7 @@ describe 'CallsApi Integration Tests' do
58
60
  callback_timeout: callback_timeout
59
61
  )
60
62
 
61
- data, status_code, headers = @calls_api_instance.create_call_with_http_info(BW_ACCOUNT_ID, call_body)
63
+ data, status_code = @calls_api_instance.create_call_with_http_info(BW_ACCOUNT_ID, call_body)
62
64
 
63
65
  expect(status_code).to eq(201)
64
66
  expect(data).to be_instance_of(Bandwidth::CreateCallResponse)
@@ -84,7 +86,7 @@ describe 'CallsApi Integration Tests' do
84
86
  # Get Calls
85
87
  describe '#list_calls' do
86
88
  it 'gets a list of calls' do
87
- data, status_code, headers = @calls_api_instance.list_calls_with_http_info(BW_ACCOUNT_ID)
89
+ data, status_code = @calls_api_instance.list_calls_with_http_info(BW_ACCOUNT_ID)
88
90
 
89
91
  expect(status_code).to eq(200)
90
92
  expect(data).to be_instance_of(Array)
@@ -98,7 +100,7 @@ describe 'CallsApi Integration Tests' do
98
100
  describe 'get_call_state' do
99
101
  it 'gets the call state' do
100
102
  sleep(40) # wait 40s for voice API to update call status
101
- data, status_code, headers = @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id)
103
+ data, status_code = @calls_api_instance.get_call_state_with_http_info(BW_ACCOUNT_ID, $call_info_id)
102
104
 
103
105
  expect(status_code).to eq(200)
104
106
  expect(data).to be_instance_of(Bandwidth::CallState)
@@ -123,11 +125,11 @@ describe 'CallsApi Integration Tests' do
123
125
  update_call_id = create_manteca_call(@calls_api_instance)
124
126
  sleep(SLEEP_TIME_S)
125
127
 
126
- update_data, update_status_code, update_headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, update_call_body)
128
+ _update_data, update_status_code = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, update_call_body)
127
129
  expect(update_status_code).to eq(200)
128
130
  sleep(SLEEP_TIME_S)
129
131
 
130
- complete_data, complete_status_code, complete_headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, $complete_call_body)
132
+ _complete_data, complete_status_code = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, $complete_call_body)
131
133
  expect(complete_status_code).to eq(200)
132
134
  end
133
135
  end
@@ -139,11 +141,11 @@ describe 'CallsApi Integration Tests' do
139
141
  sleep(SLEEP_TIME_S)
140
142
 
141
143
  update_bxml = '<?xml version="1.0" encoding="UTF-8"?><Bxml><SpeakSentence locale="en_US" gender="female" voice="susan">This is a test bxml response</SpeakSentence><Pause duration="3"/></Bxml>'
142
- update_data, update_status_code, update_headers = @calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, update_call_id, update_bxml)
144
+ _update_data, update_status_code = @calls_api_instance.update_call_bxml_with_http_info(BW_ACCOUNT_ID, update_call_id, update_bxml)
143
145
  expect(update_status_code).to eq(204)
144
146
  sleep(SLEEP_TIME_S)
145
147
 
146
- complete_data, complete_status_code, complete_headers = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, $complete_call_body)
148
+ _complete_data, complete_status_code = @calls_api_instance.update_call_with_http_info(BW_ACCOUNT_ID, update_call_id, $complete_call_body)
147
149
  expect(complete_status_code).to eq(200)
148
150
  end
149
151
  end