-
Notifications
You must be signed in to change notification settings - Fork 1
/
speechly_analytics_v1_analytics.pb.swift
449 lines (384 loc) · 16.4 KB
/
speechly_analytics_v1_analytics.pb.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
// DO NOT EDIT.
// swift-format-ignore-file
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: speechly/analytics/v1/analytics.proto
//
// For information on using the generated types, please see the documentation:
// https://github.com/apple/swift-protobuf/
import Foundation
import SwiftProtobuf
// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
// incompatible with the version of SwiftProtobuf to which you are linking.
// Please ensure that you are building against the same version of the API
// that was used to generate this file.
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
typealias Version = _2
}
/// Aggregation granularity.
public enum Speechly_Analytics_V1_Aggregation: SwiftProtobuf.Enum {
public typealias RawValue = Int
case invalid // = 0
case monthly // = 1
case daily // = 2
case hourly // = 3
case UNRECOGNIZED(Int)
public init() {
self = .invalid
}
public init?(rawValue: Int) {
switch rawValue {
case 0: self = .invalid
case 1: self = .monthly
case 2: self = .daily
case 3: self = .hourly
default: self = .UNRECOGNIZED(rawValue)
}
}
public var rawValue: Int {
switch self {
case .invalid: return 0
case .monthly: return 1
case .daily: return 2
case .hourly: return 3
case .UNRECOGNIZED(let i): return i
}
}
}
#if swift(>=4.2)
extension Speechly_Analytics_V1_Aggregation: CaseIterable {
// The compiler won't synthesize support with the UNRECOGNIZED case.
public static var allCases: [Speechly_Analytics_V1_Aggregation] = [
.invalid,
.monthly,
.daily,
.hourly,
]
}
#endif // swift(>=4.2)
/// The various types of processing that can be applied to the audio.
public enum Speechly_Analytics_V1_ProcessingType: SwiftProtobuf.Enum {
public typealias RawValue = Int
case invalid // = 0
case transcription // = 1
case nlu // = 2
case languageDetection // = 3
case vad // = 4
case translation // = 5
case audioEventDetection // = 6
case toneOfVoiceLabelling // = 7
case shallowFusion // = 8
case UNRECOGNIZED(Int)
public init() {
self = .invalid
}
public init?(rawValue: Int) {
switch rawValue {
case 0: self = .invalid
case 1: self = .transcription
case 2: self = .nlu
case 3: self = .languageDetection
case 4: self = .vad
case 5: self = .translation
case 6: self = .audioEventDetection
case 7: self = .toneOfVoiceLabelling
case 8: self = .shallowFusion
default: self = .UNRECOGNIZED(rawValue)
}
}
public var rawValue: Int {
switch self {
case .invalid: return 0
case .transcription: return 1
case .nlu: return 2
case .languageDetection: return 3
case .vad: return 4
case .translation: return 5
case .audioEventDetection: return 6
case .toneOfVoiceLabelling: return 7
case .shallowFusion: return 8
case .UNRECOGNIZED(let i): return i
}
}
}
#if swift(>=4.2)
extension Speechly_Analytics_V1_ProcessingType: CaseIterable {
// The compiler won't synthesize support with the UNRECOGNIZED case.
public static var allCases: [Speechly_Analytics_V1_ProcessingType] = [
.invalid,
.transcription,
.nlu,
.languageDetection,
.vad,
.translation,
.audioEventDetection,
.toneOfVoiceLabelling,
.shallowFusion,
]
}
#endif // swift(>=4.2)
/// Single row of statistics response.
public struct Speechly_Analytics_V1_UtteranceStatisticsPeriod {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// app_id or empty, if aggregating over project.
public var appID: String = String()
/// ISO-formatted UTC timestamp of the start time of the period.
public var startTime: String = String()
/// Count (sum) of utterances in the current period.
public var count: Int32 = 0
/// Total duration of the utterances in the current period.
public var utterancesSeconds: Int32 = 0
/// Total duration of annotated utterances in the current period.
public var annotatedSeconds: Int32 = 0
/// project_id or empty, if specifying a project.
public var projectID: String = String()
public var unknownFields = SwiftProtobuf.UnknownStorage()
public init() {}
}
/// A single utterances recognized by Speechly API.
public struct Speechly_Analytics_V1_Utterance {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// The ASR transcript of the utterance.
public var transcript: String = String()
/// The SAL-annotated transcript of the utterance.
public var annotated: String = String()
/// ISO-formatted UTC date of the utterance.
public var date: String = String()
public var unknownFields = SwiftProtobuf.UnknownStorage()
public init() {}
}
/// Information about the on-device decoder.
public struct Speechly_Analytics_V1_DecoderInfo {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// Version of the Speechly on-device decoder.
public var version: String = String()
/// Number of utterances the decoder has transcribed.
public var utteranceCount: Int32 = 0
/// Cumulative sum of the utterance length in seconds for the decoder.
public var totalSecondsTranscribed: Int32 = 0
public var unknownFields = SwiftProtobuf.UnknownStorage()
public init() {}
}
/// Specifies what processing has been applied to an utterance.
public struct Speechly_Analytics_V1_ProcessingInfo {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
/// The processing types that were applied
public var processingTypes: [Speechly_Analytics_V1_ProcessingType] = []
/// id of the model that was used for processing
public var modelID: String = String()
public var unknownFields = SwiftProtobuf.UnknownStorage()
public init() {}
}
#if swift(>=5.5) && canImport(_Concurrency)
extension Speechly_Analytics_V1_Aggregation: @unchecked Sendable {}
extension Speechly_Analytics_V1_ProcessingType: @unchecked Sendable {}
extension Speechly_Analytics_V1_UtteranceStatisticsPeriod: @unchecked Sendable {}
extension Speechly_Analytics_V1_Utterance: @unchecked Sendable {}
extension Speechly_Analytics_V1_DecoderInfo: @unchecked Sendable {}
extension Speechly_Analytics_V1_ProcessingInfo: @unchecked Sendable {}
#endif // swift(>=5.5) && canImport(_Concurrency)
// MARK: - Code below here is support for the SwiftProtobuf runtime.
fileprivate let _protobuf_package = "speechly.analytics.v1"
extension Speechly_Analytics_V1_Aggregation: SwiftProtobuf._ProtoNameProviding {
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
0: .same(proto: "AGGREGATION_INVALID"),
1: .same(proto: "AGGREGATION_MONTHLY"),
2: .same(proto: "AGGREGATION_DAILY"),
3: .same(proto: "AGGREGATION_HOURLY"),
]
}
extension Speechly_Analytics_V1_ProcessingType: SwiftProtobuf._ProtoNameProviding {
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
0: .same(proto: "PROCESSING_TYPE_INVALID"),
1: .same(proto: "PROCESSING_TYPE_TRANSCRIPTION"),
2: .same(proto: "PROCESSING_TYPE_NLU"),
3: .same(proto: "PROCESSING_TYPE_LANGUAGE_DETECTION"),
4: .same(proto: "PROCESSING_TYPE_VAD"),
5: .same(proto: "PROCESSING_TYPE_TRANSLATION"),
6: .same(proto: "PROCESSING_TYPE_AUDIO_EVENT_DETECTION"),
7: .same(proto: "PROCESSING_TYPE_TONE_OF_VOICE_LABELLING"),
8: .same(proto: "PROCESSING_TYPE_SHALLOW_FUSION"),
]
}
extension Speechly_Analytics_V1_UtteranceStatisticsPeriod: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = _protobuf_package + ".UtteranceStatisticsPeriod"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
2: .standard(proto: "app_id"),
3: .standard(proto: "start_time"),
4: .same(proto: "count"),
5: .standard(proto: "utterances_seconds"),
6: .standard(proto: "annotated_seconds"),
7: .standard(proto: "project_id"),
]
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 2: try { try decoder.decodeSingularStringField(value: &self.appID) }()
case 3: try { try decoder.decodeSingularStringField(value: &self.startTime) }()
case 4: try { try decoder.decodeSingularInt32Field(value: &self.count) }()
case 5: try { try decoder.decodeSingularInt32Field(value: &self.utterancesSeconds) }()
case 6: try { try decoder.decodeSingularInt32Field(value: &self.annotatedSeconds) }()
case 7: try { try decoder.decodeSingularStringField(value: &self.projectID) }()
default: break
}
}
}
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.appID.isEmpty {
try visitor.visitSingularStringField(value: self.appID, fieldNumber: 2)
}
if !self.startTime.isEmpty {
try visitor.visitSingularStringField(value: self.startTime, fieldNumber: 3)
}
if self.count != 0 {
try visitor.visitSingularInt32Field(value: self.count, fieldNumber: 4)
}
if self.utterancesSeconds != 0 {
try visitor.visitSingularInt32Field(value: self.utterancesSeconds, fieldNumber: 5)
}
if self.annotatedSeconds != 0 {
try visitor.visitSingularInt32Field(value: self.annotatedSeconds, fieldNumber: 6)
}
if !self.projectID.isEmpty {
try visitor.visitSingularStringField(value: self.projectID, fieldNumber: 7)
}
try unknownFields.traverse(visitor: &visitor)
}
public static func ==(lhs: Speechly_Analytics_V1_UtteranceStatisticsPeriod, rhs: Speechly_Analytics_V1_UtteranceStatisticsPeriod) -> Bool {
if lhs.appID != rhs.appID {return false}
if lhs.startTime != rhs.startTime {return false}
if lhs.count != rhs.count {return false}
if lhs.utterancesSeconds != rhs.utterancesSeconds {return false}
if lhs.annotatedSeconds != rhs.annotatedSeconds {return false}
if lhs.projectID != rhs.projectID {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
extension Speechly_Analytics_V1_Utterance: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = _protobuf_package + ".Utterance"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "transcript"),
2: .same(proto: "annotated"),
3: .same(proto: "date"),
]
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeSingularStringField(value: &self.transcript) }()
case 2: try { try decoder.decodeSingularStringField(value: &self.annotated) }()
case 3: try { try decoder.decodeSingularStringField(value: &self.date) }()
default: break
}
}
}
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.transcript.isEmpty {
try visitor.visitSingularStringField(value: self.transcript, fieldNumber: 1)
}
if !self.annotated.isEmpty {
try visitor.visitSingularStringField(value: self.annotated, fieldNumber: 2)
}
if !self.date.isEmpty {
try visitor.visitSingularStringField(value: self.date, fieldNumber: 3)
}
try unknownFields.traverse(visitor: &visitor)
}
public static func ==(lhs: Speechly_Analytics_V1_Utterance, rhs: Speechly_Analytics_V1_Utterance) -> Bool {
if lhs.transcript != rhs.transcript {return false}
if lhs.annotated != rhs.annotated {return false}
if lhs.date != rhs.date {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
extension Speechly_Analytics_V1_DecoderInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = _protobuf_package + ".DecoderInfo"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "version"),
2: .standard(proto: "utterance_count"),
3: .standard(proto: "total_seconds_transcribed"),
]
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeSingularStringField(value: &self.version) }()
case 2: try { try decoder.decodeSingularInt32Field(value: &self.utteranceCount) }()
case 3: try { try decoder.decodeSingularInt32Field(value: &self.totalSecondsTranscribed) }()
default: break
}
}
}
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.version.isEmpty {
try visitor.visitSingularStringField(value: self.version, fieldNumber: 1)
}
if self.utteranceCount != 0 {
try visitor.visitSingularInt32Field(value: self.utteranceCount, fieldNumber: 2)
}
if self.totalSecondsTranscribed != 0 {
try visitor.visitSingularInt32Field(value: self.totalSecondsTranscribed, fieldNumber: 3)
}
try unknownFields.traverse(visitor: &visitor)
}
public static func ==(lhs: Speechly_Analytics_V1_DecoderInfo, rhs: Speechly_Analytics_V1_DecoderInfo) -> Bool {
if lhs.version != rhs.version {return false}
if lhs.utteranceCount != rhs.utteranceCount {return false}
if lhs.totalSecondsTranscribed != rhs.totalSecondsTranscribed {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}
extension Speechly_Analytics_V1_ProcessingInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = _protobuf_package + ".ProcessingInfo"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .standard(proto: "processing_types"),
2: .standard(proto: "model_id"),
]
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeRepeatedEnumField(value: &self.processingTypes) }()
case 2: try { try decoder.decodeSingularStringField(value: &self.modelID) }()
default: break
}
}
}
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.processingTypes.isEmpty {
try visitor.visitPackedEnumField(value: self.processingTypes, fieldNumber: 1)
}
if !self.modelID.isEmpty {
try visitor.visitSingularStringField(value: self.modelID, fieldNumber: 2)
}
try unknownFields.traverse(visitor: &visitor)
}
public static func ==(lhs: Speechly_Analytics_V1_ProcessingInfo, rhs: Speechly_Analytics_V1_ProcessingInfo) -> Bool {
if lhs.processingTypes != rhs.processingTypes {return false}
if lhs.modelID != rhs.modelID {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}