bandwidth-sdk 18.1.1 → 18.1.2
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/Gemfile.lock +4 -4
- data/README.md +1 -0
- data/bandwidth.yml +119 -21
- data/coverage/.last_run.json +1 -1
- data/coverage/.resultset.json +562 -142
- data/coverage/index.html +6749 -2231
- data/docs/Callback.md +1 -1
- data/docs/RbmActionBase.md +1 -1
- data/docs/RbmSuggestionResponse.md +3 -1
- data/docs/RecordingTranscriptionClip.md +26 -0
- data/docs/RecordingTranscriptions.md +3 -1
- data/docs/TfvStatus.md +4 -0
- data/docs/Transcription.md +2 -0
- data/lib/bandwidth-sdk/models/callback.rb +1 -1
- data/lib/bandwidth-sdk/models/inbound_callback_type_enum.rb +2 -2
- data/lib/bandwidth-sdk/models/rbm_suggestion_response.rb +15 -4
- data/lib/bandwidth-sdk/models/recording_transcription_clip.rb +214 -0
- data/lib/bandwidth-sdk/models/recording_transcriptions.rb +16 -4
- data/lib/bandwidth-sdk/models/tfv_status.rb +25 -1
- data/lib/bandwidth-sdk/models/transcription.rb +11 -1
- data/lib/bandwidth-sdk/version.rb +1 -1
- data/lib/bandwidth-sdk.rb +1 -0
- data/spec/unit/api/recordings_api_spec.rb +1 -0
- data/spec/unit/models/callback_spec.rb +1 -1
- data/spec/unit/models/inbound_callback_type_enum_spec.rb +3 -3
- data/spec/unit/models/rbm_suggestion_response_spec.rb +9 -5
- data/spec/unit/models/recording_transcription_clip_spec.rb +96 -0
- data/spec/unit/models/recording_transcriptions_spec.rb +27 -4
- data/spec/unit/models/tfv_status_spec.rb +14 -2
- data/spec/unit/models/transcription_spec.rb +5 -1
- metadata +227 -223
data/docs/Callback.md
CHANGED
|
@@ -50,7 +50,7 @@ Bandwidth::Callback.openapi_discriminator_mapping
|
|
|
50
50
|
# :'message-received' => :'InboundCallback',
|
|
51
51
|
# :'message-sending' => :'StatusCallback',
|
|
52
52
|
# :'message-sent' => :'StatusCallback',
|
|
53
|
-
# :'
|
|
53
|
+
# :'requested-location-response' => :'InboundCallback',
|
|
54
54
|
# :'suggestion-response' => :'InboundCallback'
|
|
55
55
|
# }
|
|
56
56
|
```
|
data/docs/RbmActionBase.md
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **text** | **String** | The text associated with the suggestion response. | [optional] |
|
|
8
8
|
| **postback_data** | **String** | Base64 payload the customer receives when the reply is clicked. | [optional] |
|
|
9
|
+
| **paired_message_id** | **String** | Corresponding parent message ID (MT). | [optional] |
|
|
9
10
|
|
|
10
11
|
## Example
|
|
11
12
|
|
|
@@ -14,7 +15,8 @@ require 'bandwidth-sdk'
|
|
|
14
15
|
|
|
15
16
|
instance = Bandwidth::RbmSuggestionResponse.new(
|
|
16
17
|
text: Yes, I would like to proceed,
|
|
17
|
-
postback_data: [B@
|
|
18
|
+
postback_data: [B@3c29f6be,
|
|
19
|
+
paired_message_id: 1752697342534u24xerqdukke523x
|
|
18
20
|
)
|
|
19
21
|
```
|
|
20
22
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Bandwidth::RecordingTranscriptionClip
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **speaker** | **Integer** | Zero-based index identifying the speaker. | [optional] |
|
|
8
|
+
| **text** | **String** | The transcribed text of this clip. | [optional] |
|
|
9
|
+
| **confidence** | **Float** | How confident the transcription engine was in transcribing this clip (from `0.0` to `1.0`). | [optional] |
|
|
10
|
+
| **start_time_seconds** | **Float** | The start time of this clip within the recording, in seconds. | [optional] |
|
|
11
|
+
| **end_time_seconds** | **Float** | The end time of this clip within the recording, in seconds. | [optional] |
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require 'bandwidth-sdk'
|
|
17
|
+
|
|
18
|
+
instance = Bandwidth::RecordingTranscriptionClip.new(
|
|
19
|
+
speaker: 0,
|
|
20
|
+
text: Hi there, thanks for calling!,
|
|
21
|
+
confidence: 0.85,
|
|
22
|
+
start_time_seconds: 2.3,
|
|
23
|
+
end_time_seconds: 3.1
|
|
24
|
+
)
|
|
25
|
+
```
|
|
26
|
+
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **transcripts** | [**Array<Transcription>**](Transcription.md) | | [optional] |
|
|
8
|
+
| **clips** | [**Array<RecordingTranscriptionClip>**](RecordingTranscriptionClip.md) | A list of individual speech clips with speaker, timing, and confidence information. | [optional] |
|
|
8
9
|
|
|
9
10
|
## Example
|
|
10
11
|
|
|
@@ -12,7 +13,8 @@
|
|
|
12
13
|
require 'bandwidth-sdk'
|
|
13
14
|
|
|
14
15
|
instance = Bandwidth::RecordingTranscriptions.new(
|
|
15
|
-
transcripts: null
|
|
16
|
+
transcripts: null,
|
|
17
|
+
clips: null
|
|
16
18
|
)
|
|
17
19
|
```
|
|
18
20
|
|
data/docs/TfvStatus.md
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
| **status** | [**TfvStatusEnum**](TfvStatusEnum.md) | | [optional] |
|
|
9
9
|
| **internal_ticket_number** | **String** | Unique identifier (UUID) generated by Bandwidth to assist in tracking the verification status of a toll-free number - included in all webhook payloads. | [optional] |
|
|
10
10
|
| **decline_reason_description** | **String** | Explanation for why a verification request was declined. | [optional] |
|
|
11
|
+
| **denial_status_code** | **Integer** | Reason code for denial. | [optional] |
|
|
12
|
+
| **additional_denial_reasons** | [**Array<AdditionalDenialReason>**](AdditionalDenialReason.md) | An optional list of denial reasons in addition to declineReasonDescription when multiple reasons apply. | [optional] |
|
|
11
13
|
| **resubmit_allowed** | **Boolean** | Whether a Toll-Free Verification request qualifies for resubmission via PUT. | [optional] |
|
|
12
14
|
| **created_date_time** | **Time** | Date and time the verification request was created. | [optional] |
|
|
13
15
|
| **modified_date_time** | **Time** | Date and time the verification request was last modified. | [optional] |
|
|
@@ -26,6 +28,8 @@ instance = Bandwidth::TfvStatus.new(
|
|
|
26
28
|
status: null,
|
|
27
29
|
internal_ticket_number: acde070d-8c4c-4f0d-9d8a-162843c10333,
|
|
28
30
|
decline_reason_description: Invalid Information - Can't Validate URL - Website is not accessible / not available,
|
|
31
|
+
denial_status_code: 511,
|
|
32
|
+
additional_denial_reasons: [{"statusCode":512,"reason":"Reason A","resubmitAllowed":true},{"statusCode":513,"reason":"Reason B","resubmitAllowed":true}],
|
|
29
33
|
resubmit_allowed: true,
|
|
30
34
|
created_date_time: 2021-06-08T06:45:13Z,
|
|
31
35
|
modified_date_time: 2021-06-08T06:45:13Z,
|
data/docs/Transcription.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **speaker** | **Integer** | Zero-based index identifying the speaker. | [optional] |
|
|
7
8
|
| **text** | **String** | The transcribed text | [optional] |
|
|
8
9
|
| **confidence** | **Float** | The confidence on the recognized content, ranging from `0.0` to `1.0` with `1.0` being the highest confidence. | [optional] |
|
|
9
10
|
|
|
@@ -13,6 +14,7 @@
|
|
|
13
14
|
require 'bandwidth-sdk'
|
|
14
15
|
|
|
15
16
|
instance = Bandwidth::Transcription.new(
|
|
17
|
+
speaker: 0,
|
|
16
18
|
text: Nice talking to you, friend!,
|
|
17
19
|
confidence: 0.9
|
|
18
20
|
)
|
|
@@ -39,7 +39,7 @@ module Bandwidth
|
|
|
39
39
|
:'message-received' => :'InboundCallback',
|
|
40
40
|
:'message-sending' => :'StatusCallback',
|
|
41
41
|
:'message-sent' => :'StatusCallback',
|
|
42
|
-
:'
|
|
42
|
+
:'requested-location-response' => :'InboundCallback',
|
|
43
43
|
:'suggestion-response' => :'InboundCallback'
|
|
44
44
|
}
|
|
45
45
|
end
|
|
@@ -16,11 +16,11 @@ require 'time'
|
|
|
16
16
|
module Bandwidth
|
|
17
17
|
class InboundCallbackTypeEnum
|
|
18
18
|
MESSAGE_RECEIVED = 'message-received'.freeze
|
|
19
|
-
|
|
19
|
+
REQUESTED_LOCATION_RESPONSE = 'requested-location-response'.freeze
|
|
20
20
|
SUGGESTION_RESPONSE = 'suggestion-response'.freeze
|
|
21
21
|
|
|
22
22
|
def self.all_vars
|
|
23
|
-
@all_vars ||= [MESSAGE_RECEIVED,
|
|
23
|
+
@all_vars ||= [MESSAGE_RECEIVED, REQUESTED_LOCATION_RESPONSE, SUGGESTION_RESPONSE].freeze
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
# Builds the enum from string
|
|
@@ -21,11 +21,15 @@ module Bandwidth
|
|
|
21
21
|
# Base64 payload the customer receives when the reply is clicked.
|
|
22
22
|
attr_accessor :postback_data
|
|
23
23
|
|
|
24
|
+
# Corresponding parent message ID (MT).
|
|
25
|
+
attr_accessor :paired_message_id
|
|
26
|
+
|
|
24
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
28
|
def self.attribute_map
|
|
26
29
|
{
|
|
27
30
|
:'text' => :'text',
|
|
28
|
-
:'postback_data' => :'postbackData'
|
|
31
|
+
:'postback_data' => :'postbackData',
|
|
32
|
+
:'paired_message_id' => :'pairedMessageId'
|
|
29
33
|
}
|
|
30
34
|
end
|
|
31
35
|
|
|
@@ -43,13 +47,15 @@ module Bandwidth
|
|
|
43
47
|
def self.openapi_types
|
|
44
48
|
{
|
|
45
49
|
:'text' => :'String',
|
|
46
|
-
:'postback_data' => :'String'
|
|
50
|
+
:'postback_data' => :'String',
|
|
51
|
+
:'paired_message_id' => :'String'
|
|
47
52
|
}
|
|
48
53
|
end
|
|
49
54
|
|
|
50
55
|
# List of attributes with nullable: true
|
|
51
56
|
def self.openapi_nullable
|
|
52
57
|
Set.new([
|
|
58
|
+
:'paired_message_id'
|
|
53
59
|
])
|
|
54
60
|
end
|
|
55
61
|
|
|
@@ -76,6 +82,10 @@ module Bandwidth
|
|
|
76
82
|
if attributes.key?(:'postback_data')
|
|
77
83
|
self.postback_data = attributes[:'postback_data']
|
|
78
84
|
end
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'paired_message_id')
|
|
87
|
+
self.paired_message_id = attributes[:'paired_message_id']
|
|
88
|
+
end
|
|
79
89
|
end
|
|
80
90
|
|
|
81
91
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -118,7 +128,8 @@ module Bandwidth
|
|
|
118
128
|
return true if self.equal?(o)
|
|
119
129
|
self.class == o.class &&
|
|
120
130
|
text == o.text &&
|
|
121
|
-
postback_data == o.postback_data
|
|
131
|
+
postback_data == o.postback_data &&
|
|
132
|
+
paired_message_id == o.paired_message_id
|
|
122
133
|
end
|
|
123
134
|
|
|
124
135
|
# @see the `==` method
|
|
@@ -130,7 +141,7 @@ module Bandwidth
|
|
|
130
141
|
# Calculates hash code according to all attributes.
|
|
131
142
|
# @return [Integer] Hash code
|
|
132
143
|
def hash
|
|
133
|
-
[text, postback_data].hash
|
|
144
|
+
[text, postback_data, paired_message_id].hash
|
|
134
145
|
end
|
|
135
146
|
|
|
136
147
|
# Builds the object from hash
|
|
@@ -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
|
+
Generator version: 7.17.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Bandwidth
|
|
17
|
+
class RecordingTranscriptionClip < ApiModelBase
|
|
18
|
+
# Zero-based index identifying the speaker.
|
|
19
|
+
attr_accessor :speaker
|
|
20
|
+
|
|
21
|
+
# The transcribed text of this clip.
|
|
22
|
+
attr_accessor :text
|
|
23
|
+
|
|
24
|
+
# How confident the transcription engine was in transcribing this clip (from `0.0` to `1.0`).
|
|
25
|
+
attr_accessor :confidence
|
|
26
|
+
|
|
27
|
+
# The start time of this clip within the recording, in seconds.
|
|
28
|
+
attr_accessor :start_time_seconds
|
|
29
|
+
|
|
30
|
+
# The end time of this clip within the recording, in seconds.
|
|
31
|
+
attr_accessor :end_time_seconds
|
|
32
|
+
|
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
34
|
+
def self.attribute_map
|
|
35
|
+
{
|
|
36
|
+
:'speaker' => :'speaker',
|
|
37
|
+
:'text' => :'text',
|
|
38
|
+
:'confidence' => :'confidence',
|
|
39
|
+
:'start_time_seconds' => :'startTimeSeconds',
|
|
40
|
+
:'end_time_seconds' => :'endTimeSeconds'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Returns attribute mapping this model knows about
|
|
45
|
+
def self.acceptable_attribute_map
|
|
46
|
+
attribute_map
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Returns all the JSON keys this model knows about
|
|
50
|
+
def self.acceptable_attributes
|
|
51
|
+
acceptable_attribute_map.values
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Attribute type mapping.
|
|
55
|
+
def self.openapi_types
|
|
56
|
+
{
|
|
57
|
+
:'speaker' => :'Integer',
|
|
58
|
+
:'text' => :'String',
|
|
59
|
+
:'confidence' => :'Float',
|
|
60
|
+
:'start_time_seconds' => :'Float',
|
|
61
|
+
:'end_time_seconds' => :'Float'
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# List of attributes with nullable: true
|
|
66
|
+
def self.openapi_nullable
|
|
67
|
+
Set.new([
|
|
68
|
+
])
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Initializes the object
|
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
73
|
+
def initialize(attributes = {})
|
|
74
|
+
if (!attributes.is_a?(Hash))
|
|
75
|
+
fail ArgumentError, 'The input argument (attributes) must be a hash in `Bandwidth::RecordingTranscriptionClip` initialize method'
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
79
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
80
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
81
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
82
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Bandwidth::RecordingTranscriptionClip`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
83
|
+
end
|
|
84
|
+
h[k.to_sym] = v
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'speaker')
|
|
88
|
+
self.speaker = attributes[:'speaker']
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:'text')
|
|
92
|
+
self.text = attributes[:'text']
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'confidence')
|
|
96
|
+
self.confidence = attributes[:'confidence']
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'start_time_seconds')
|
|
100
|
+
self.start_time_seconds = attributes[:'start_time_seconds']
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'end_time_seconds')
|
|
104
|
+
self.end_time_seconds = attributes[:'end_time_seconds']
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
109
|
+
# @return Array for valid properties with the reasons
|
|
110
|
+
def list_invalid_properties
|
|
111
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
112
|
+
invalid_properties = Array.new
|
|
113
|
+
if !@confidence.nil? && @confidence > 1
|
|
114
|
+
invalid_properties.push('invalid value for "confidence", must be smaller than or equal to 1.')
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if !@confidence.nil? && @confidence < 0
|
|
118
|
+
invalid_properties.push('invalid value for "confidence", must be greater than or equal to 0.')
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
invalid_properties
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Check to see if the all the properties in the model are valid
|
|
125
|
+
# @return true if the model is valid
|
|
126
|
+
def valid?
|
|
127
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
128
|
+
return false if !@confidence.nil? && @confidence > 1
|
|
129
|
+
return false if !@confidence.nil? && @confidence < 0
|
|
130
|
+
true
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Custom attribute writer method with validation
|
|
134
|
+
# @param [Object] confidence Value to be assigned
|
|
135
|
+
def confidence=(confidence)
|
|
136
|
+
if confidence.nil?
|
|
137
|
+
fail ArgumentError, 'confidence cannot be nil'
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if confidence > 1
|
|
141
|
+
fail ArgumentError, 'invalid value for "confidence", must be smaller than or equal to 1.'
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if confidence < 0
|
|
145
|
+
fail ArgumentError, 'invalid value for "confidence", must be greater than or equal to 0.'
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
@confidence = confidence
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Checks equality by comparing each attribute.
|
|
152
|
+
# @param [Object] Object to be compared
|
|
153
|
+
def ==(o)
|
|
154
|
+
return true if self.equal?(o)
|
|
155
|
+
self.class == o.class &&
|
|
156
|
+
speaker == o.speaker &&
|
|
157
|
+
text == o.text &&
|
|
158
|
+
confidence == o.confidence &&
|
|
159
|
+
start_time_seconds == o.start_time_seconds &&
|
|
160
|
+
end_time_seconds == o.end_time_seconds
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# @see the `==` method
|
|
164
|
+
# @param [Object] Object to be compared
|
|
165
|
+
def eql?(o)
|
|
166
|
+
self == o
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Calculates hash code according to all attributes.
|
|
170
|
+
# @return [Integer] Hash code
|
|
171
|
+
def hash
|
|
172
|
+
[speaker, text, confidence, start_time_seconds, end_time_seconds].hash
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Builds the object from hash
|
|
176
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
177
|
+
# @return [Object] Returns the model itself
|
|
178
|
+
def self.build_from_hash(attributes)
|
|
179
|
+
return nil unless attributes.is_a?(Hash)
|
|
180
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
181
|
+
transformed_hash = {}
|
|
182
|
+
openapi_types.each_pair do |key, type|
|
|
183
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
184
|
+
transformed_hash["#{key}"] = nil
|
|
185
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
186
|
+
# check to ensure the input is an array given that the attribute
|
|
187
|
+
# is documented as an array but the input is not
|
|
188
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
189
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
190
|
+
end
|
|
191
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
192
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
new(transformed_hash)
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Returns the object in the form of hash
|
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
|
200
|
+
def to_hash
|
|
201
|
+
hash = {}
|
|
202
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
203
|
+
value = self.send(attr)
|
|
204
|
+
if value.nil?
|
|
205
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
206
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
hash[param] = _to_hash(value)
|
|
210
|
+
end
|
|
211
|
+
hash
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
end
|
|
@@ -17,10 +17,14 @@ module Bandwidth
|
|
|
17
17
|
class RecordingTranscriptions < ApiModelBase
|
|
18
18
|
attr_accessor :transcripts
|
|
19
19
|
|
|
20
|
+
# A list of individual speech clips with speaker, timing, and confidence information.
|
|
21
|
+
attr_accessor :clips
|
|
22
|
+
|
|
20
23
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
24
|
def self.attribute_map
|
|
22
25
|
{
|
|
23
|
-
:'transcripts' => :'transcripts'
|
|
26
|
+
:'transcripts' => :'transcripts',
|
|
27
|
+
:'clips' => :'clips'
|
|
24
28
|
}
|
|
25
29
|
end
|
|
26
30
|
|
|
@@ -37,7 +41,8 @@ module Bandwidth
|
|
|
37
41
|
# Attribute type mapping.
|
|
38
42
|
def self.openapi_types
|
|
39
43
|
{
|
|
40
|
-
:'transcripts' => :'Array<Transcription>'
|
|
44
|
+
:'transcripts' => :'Array<Transcription>',
|
|
45
|
+
:'clips' => :'Array<RecordingTranscriptionClip>'
|
|
41
46
|
}
|
|
42
47
|
end
|
|
43
48
|
|
|
@@ -68,6 +73,12 @@ module Bandwidth
|
|
|
68
73
|
self.transcripts = value
|
|
69
74
|
end
|
|
70
75
|
end
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'clips')
|
|
78
|
+
if (value = attributes[:'clips']).is_a?(Array)
|
|
79
|
+
self.clips = value
|
|
80
|
+
end
|
|
81
|
+
end
|
|
71
82
|
end
|
|
72
83
|
|
|
73
84
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -90,7 +101,8 @@ module Bandwidth
|
|
|
90
101
|
def ==(o)
|
|
91
102
|
return true if self.equal?(o)
|
|
92
103
|
self.class == o.class &&
|
|
93
|
-
transcripts == o.transcripts
|
|
104
|
+
transcripts == o.transcripts &&
|
|
105
|
+
clips == o.clips
|
|
94
106
|
end
|
|
95
107
|
|
|
96
108
|
# @see the `==` method
|
|
@@ -102,7 +114,7 @@ module Bandwidth
|
|
|
102
114
|
# Calculates hash code according to all attributes.
|
|
103
115
|
# @return [Integer] Hash code
|
|
104
116
|
def hash
|
|
105
|
-
[transcripts].hash
|
|
117
|
+
[transcripts, clips].hash
|
|
106
118
|
end
|
|
107
119
|
|
|
108
120
|
# Builds the object from hash
|
|
@@ -26,6 +26,12 @@ module Bandwidth
|
|
|
26
26
|
# Explanation for why a verification request was declined.
|
|
27
27
|
attr_accessor :decline_reason_description
|
|
28
28
|
|
|
29
|
+
# Reason code for denial.
|
|
30
|
+
attr_accessor :denial_status_code
|
|
31
|
+
|
|
32
|
+
# An optional list of denial reasons in addition to declineReasonDescription when multiple reasons apply.
|
|
33
|
+
attr_accessor :additional_denial_reasons
|
|
34
|
+
|
|
29
35
|
# Whether a Toll-Free Verification request qualifies for resubmission via PUT.
|
|
30
36
|
attr_accessor :resubmit_allowed
|
|
31
37
|
|
|
@@ -75,6 +81,8 @@ module Bandwidth
|
|
|
75
81
|
:'status' => :'status',
|
|
76
82
|
:'internal_ticket_number' => :'internalTicketNumber',
|
|
77
83
|
:'decline_reason_description' => :'declineReasonDescription',
|
|
84
|
+
:'denial_status_code' => :'denialStatusCode',
|
|
85
|
+
:'additional_denial_reasons' => :'additionalDenialReasons',
|
|
78
86
|
:'resubmit_allowed' => :'resubmitAllowed',
|
|
79
87
|
:'created_date_time' => :'createdDateTime',
|
|
80
88
|
:'modified_date_time' => :'modifiedDateTime',
|
|
@@ -102,6 +110,8 @@ module Bandwidth
|
|
|
102
110
|
:'status' => :'TfvStatusEnum',
|
|
103
111
|
:'internal_ticket_number' => :'String',
|
|
104
112
|
:'decline_reason_description' => :'String',
|
|
113
|
+
:'denial_status_code' => :'Integer',
|
|
114
|
+
:'additional_denial_reasons' => :'Array<AdditionalDenialReason>',
|
|
105
115
|
:'resubmit_allowed' => :'Boolean',
|
|
106
116
|
:'created_date_time' => :'Time',
|
|
107
117
|
:'modified_date_time' => :'Time',
|
|
@@ -115,6 +125,8 @@ module Bandwidth
|
|
|
115
125
|
# List of attributes with nullable: true
|
|
116
126
|
def self.openapi_nullable
|
|
117
127
|
Set.new([
|
|
128
|
+
:'denial_status_code',
|
|
129
|
+
:'additional_denial_reasons',
|
|
118
130
|
:'cv_token'
|
|
119
131
|
])
|
|
120
132
|
end
|
|
@@ -151,6 +163,16 @@ module Bandwidth
|
|
|
151
163
|
self.decline_reason_description = attributes[:'decline_reason_description']
|
|
152
164
|
end
|
|
153
165
|
|
|
166
|
+
if attributes.key?(:'denial_status_code')
|
|
167
|
+
self.denial_status_code = attributes[:'denial_status_code']
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
if attributes.key?(:'additional_denial_reasons')
|
|
171
|
+
if (value = attributes[:'additional_denial_reasons']).is_a?(Array)
|
|
172
|
+
self.additional_denial_reasons = value
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
|
|
154
176
|
if attributes.key?(:'resubmit_allowed')
|
|
155
177
|
self.resubmit_allowed = attributes[:'resubmit_allowed']
|
|
156
178
|
end
|
|
@@ -267,6 +289,8 @@ module Bandwidth
|
|
|
267
289
|
status == o.status &&
|
|
268
290
|
internal_ticket_number == o.internal_ticket_number &&
|
|
269
291
|
decline_reason_description == o.decline_reason_description &&
|
|
292
|
+
denial_status_code == o.denial_status_code &&
|
|
293
|
+
additional_denial_reasons == o.additional_denial_reasons &&
|
|
270
294
|
resubmit_allowed == o.resubmit_allowed &&
|
|
271
295
|
created_date_time == o.created_date_time &&
|
|
272
296
|
modified_date_time == o.modified_date_time &&
|
|
@@ -285,7 +309,7 @@ module Bandwidth
|
|
|
285
309
|
# Calculates hash code according to all attributes.
|
|
286
310
|
# @return [Integer] Hash code
|
|
287
311
|
def hash
|
|
288
|
-
[phone_number, status, internal_ticket_number, decline_reason_description, resubmit_allowed, created_date_time, modified_date_time, submission, blocked, blocked_reason, cv_token].hash
|
|
312
|
+
[phone_number, status, internal_ticket_number, decline_reason_description, denial_status_code, additional_denial_reasons, resubmit_allowed, created_date_time, modified_date_time, submission, blocked, blocked_reason, cv_token].hash
|
|
289
313
|
end
|
|
290
314
|
|
|
291
315
|
# Builds the object from hash
|
|
@@ -15,6 +15,9 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Bandwidth
|
|
17
17
|
class Transcription < ApiModelBase
|
|
18
|
+
# Zero-based index identifying the speaker.
|
|
19
|
+
attr_accessor :speaker
|
|
20
|
+
|
|
18
21
|
# The transcribed text
|
|
19
22
|
attr_accessor :text
|
|
20
23
|
|
|
@@ -24,6 +27,7 @@ module Bandwidth
|
|
|
24
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
28
|
def self.attribute_map
|
|
26
29
|
{
|
|
30
|
+
:'speaker' => :'speaker',
|
|
27
31
|
:'text' => :'text',
|
|
28
32
|
:'confidence' => :'confidence'
|
|
29
33
|
}
|
|
@@ -42,6 +46,7 @@ module Bandwidth
|
|
|
42
46
|
# Attribute type mapping.
|
|
43
47
|
def self.openapi_types
|
|
44
48
|
{
|
|
49
|
+
:'speaker' => :'Integer',
|
|
45
50
|
:'text' => :'String',
|
|
46
51
|
:'confidence' => :'Float'
|
|
47
52
|
}
|
|
@@ -69,6 +74,10 @@ module Bandwidth
|
|
|
69
74
|
h[k.to_sym] = v
|
|
70
75
|
}
|
|
71
76
|
|
|
77
|
+
if attributes.key?(:'speaker')
|
|
78
|
+
self.speaker = attributes[:'speaker']
|
|
79
|
+
end
|
|
80
|
+
|
|
72
81
|
if attributes.key?(:'text')
|
|
73
82
|
self.text = attributes[:'text']
|
|
74
83
|
end
|
|
@@ -98,6 +107,7 @@ module Bandwidth
|
|
|
98
107
|
def ==(o)
|
|
99
108
|
return true if self.equal?(o)
|
|
100
109
|
self.class == o.class &&
|
|
110
|
+
speaker == o.speaker &&
|
|
101
111
|
text == o.text &&
|
|
102
112
|
confidence == o.confidence
|
|
103
113
|
end
|
|
@@ -111,7 +121,7 @@ module Bandwidth
|
|
|
111
121
|
# Calculates hash code according to all attributes.
|
|
112
122
|
# @return [Integer] Hash code
|
|
113
123
|
def hash
|
|
114
|
-
[text, confidence].hash
|
|
124
|
+
[speaker, text, confidence].hash
|
|
115
125
|
end
|
|
116
126
|
|
|
117
127
|
# Builds the object from hash
|
data/lib/bandwidth-sdk.rb
CHANGED
|
@@ -170,6 +170,7 @@ require 'bandwidth-sdk/models/rbm_web_view_enum'
|
|
|
170
170
|
require 'bandwidth-sdk/models/recording_available_callback'
|
|
171
171
|
require 'bandwidth-sdk/models/recording_complete_callback'
|
|
172
172
|
require 'bandwidth-sdk/models/recording_state_enum'
|
|
173
|
+
require 'bandwidth-sdk/models/recording_transcription_clip'
|
|
173
174
|
require 'bandwidth-sdk/models/recording_transcription_metadata'
|
|
174
175
|
require 'bandwidth-sdk/models/recording_transcriptions'
|
|
175
176
|
require 'bandwidth-sdk/models/redirect_callback'
|
|
@@ -191,6 +191,7 @@ describe 'RecordingsApi' do
|
|
|
191
191
|
expect(data).to be_instance_of(Bandwidth::RecordingTranscriptions)
|
|
192
192
|
expect(data.transcripts).to be_instance_of(Array)
|
|
193
193
|
expect(data.transcripts[0]).to be_instance_of(Bandwidth::Transcription)
|
|
194
|
+
expect(data.transcripts[0].speaker).to be_instance_of(Integer)
|
|
194
195
|
expect(data.transcripts[0].text).to be_instance_of(String)
|
|
195
196
|
expect(data.transcripts[0].confidence).to be_instance_of(Float)
|
|
196
197
|
end
|
|
@@ -24,7 +24,7 @@ describe Bandwidth::Callback do
|
|
|
24
24
|
:'message-received' => :'InboundCallback',
|
|
25
25
|
:'message-sending' => :'StatusCallback',
|
|
26
26
|
:'message-sent' => :'StatusCallback',
|
|
27
|
-
:'
|
|
27
|
+
:'requested-location-response' => :'InboundCallback',
|
|
28
28
|
:'suggestion-response' => :'InboundCallback'
|
|
29
29
|
})
|
|
30
30
|
end
|
|
@@ -6,7 +6,7 @@ describe Bandwidth::InboundCallbackTypeEnum do
|
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
it 'defines REQUEST_LOCATION_RESPONSE' do
|
|
9
|
-
expect(Bandwidth::InboundCallbackTypeEnum::
|
|
9
|
+
expect(Bandwidth::InboundCallbackTypeEnum::REQUESTED_LOCATION_RESPONSE).to eq('requested-location-response')
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
it 'defines SUGGESTION_RESPONSE' do
|
|
@@ -18,7 +18,7 @@ describe Bandwidth::InboundCallbackTypeEnum do
|
|
|
18
18
|
it 'returns every valid enum value' do
|
|
19
19
|
expect(Bandwidth::InboundCallbackTypeEnum.all_vars).to eq([
|
|
20
20
|
'message-received',
|
|
21
|
-
'
|
|
21
|
+
'requested-location-response',
|
|
22
22
|
'suggestion-response'
|
|
23
23
|
])
|
|
24
24
|
end
|
|
@@ -27,7 +27,7 @@ describe Bandwidth::InboundCallbackTypeEnum do
|
|
|
27
27
|
describe '.build_from_hash' do
|
|
28
28
|
it 'returns the value when it matches a valid enum value' do
|
|
29
29
|
expect(Bandwidth::InboundCallbackTypeEnum.build_from_hash('message-received')).to eq('message-received')
|
|
30
|
-
expect(Bandwidth::InboundCallbackTypeEnum.build_from_hash('
|
|
30
|
+
expect(Bandwidth::InboundCallbackTypeEnum.build_from_hash('requested-location-response')).to eq('requested-location-response')
|
|
31
31
|
expect(Bandwidth::InboundCallbackTypeEnum.build_from_hash('suggestion-response')).to eq('suggestion-response')
|
|
32
32
|
end
|
|
33
33
|
|