15
15
**/
16
16
17
17
import Foundation
18
- import RestKit
19
18
20
19
/**
21
20
The response sent by the workspace, including the output text, detected intents and entities, and context.
@@ -58,9 +57,6 @@ public struct MessageResponse: Codable, Equatable {
58
57
*/
59
58
public var actions : [ DialogNodeAction ] ?
60
59
61
- /// Additional properties associated with this model.
62
- public var additionalProperties : [ String : JSON ]
63
-
64
60
// Map each property name to the key that shall be used for encoding/decoding.
65
61
private enum CodingKeys : String , CodingKey {
66
62
case input = " input "
@@ -70,33 +66,6 @@ public struct MessageResponse: Codable, Equatable {
70
66
case context = " context "
71
67
case output = " output "
72
68
case actions = " actions "
73
- static let allValues = [ input, intents, entities, alternateIntents, context, output, actions]
74
- }
75
-
76
- public init ( from decoder: Decoder ) throws {
77
- let container = try decoder. container ( keyedBy: CodingKeys . self)
78
- input = try container. decodeIfPresent ( MessageInput . self, forKey: . input)
79
- intents = try container. decode ( [ RuntimeIntent ] . self, forKey: . intents)
80
- entities = try container. decode ( [ RuntimeEntity ] . self, forKey: . entities)
81
- alternateIntents = try container. decodeIfPresent ( Bool . self, forKey: . alternateIntents)
82
- context = try container. decode ( Context . self, forKey: . context)
83
- output = try container. decode ( OutputData . self, forKey: . output)
84
- actions = try container. decodeIfPresent ( [ DialogNodeAction ] . self, forKey: . actions)
85
- let dynamicContainer = try decoder. container ( keyedBy: DynamicKeys . self)
86
- additionalProperties = try dynamicContainer. decode ( [ String : JSON ] . self, excluding: CodingKeys . allValues)
87
- }
88
-
89
- public func encode( to encoder: Encoder ) throws {
90
- var container = encoder. container ( keyedBy: CodingKeys . self)
91
- try container. encodeIfPresent ( input, forKey: . input)
92
- try container. encode ( intents, forKey: . intents)
93
- try container. encode ( entities, forKey: . entities)
94
- try container. encodeIfPresent ( alternateIntents, forKey: . alternateIntents)
95
- try container. encode ( context, forKey: . context)
96
- try container. encode ( output, forKey: . output)
97
- try container. encodeIfPresent ( actions, forKey: . actions)
98
- var dynamicContainer = encoder. container ( keyedBy: DynamicKeys . self)
99
- try dynamicContainer. encodeIfPresent ( additionalProperties)
100
69
}
101
70
102
71
}
0 commit comments