1 package textanalytics
2
3
4
5
6
7
8
9 import (
10 "encoding/json"
11 "github.com/Azure/go-autorest/autorest"
12 )
13
14
15 const fqdn = "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/textanalytics"
16
17
18 type BatchInput struct {
19 Documents *[]Input `json:"documents,omitempty"`
20 }
21
22
23 type DetectedLanguage struct {
24
25 Name *string `json:"name,omitempty"`
26
27 Iso6391Name *string `json:"iso6391Name,omitempty"`
28
29 Score *float64 `json:"score,omitempty"`
30 }
31
32
33 type EntitiesBatchResult struct {
34 autorest.Response `json:"-"`
35
36 Documents *[]EntitiesBatchResultItem `json:"documents,omitempty"`
37
38 Errors *[]ErrorRecord `json:"errors,omitempty"`
39 }
40
41
42 func (ebr EntitiesBatchResult) MarshalJSON() ([]byte, error) {
43 objectMap := make(map[string]interface{})
44 return json.Marshal(objectMap)
45 }
46
47
48 type EntitiesBatchResultItem struct {
49
50 ID *string `json:"id,omitempty"`
51
52 Entities *[]EntityRecord `json:"entities,omitempty"`
53 }
54
55
56 func (ebri EntitiesBatchResultItem) MarshalJSON() ([]byte, error) {
57 objectMap := make(map[string]interface{})
58 return json.Marshal(objectMap)
59 }
60
61
62 type EntityRecord struct {
63
64 Name *string `json:"name,omitempty"`
65
66 Matches *[]MatchRecord `json:"matches,omitempty"`
67
68 WikipediaLanguage *string `json:"wikipediaLanguage,omitempty"`
69
70 WikipediaID *string `json:"wikipediaId,omitempty"`
71
72 WikipediaURL *string `json:"wikipediaUrl,omitempty"`
73
74 BingID *string `json:"bingId,omitempty"`
75 }
76
77
78 func (er EntityRecord) MarshalJSON() ([]byte, error) {
79 objectMap := make(map[string]interface{})
80 if er.Name != nil {
81 objectMap["name"] = er.Name
82 }
83 if er.WikipediaLanguage != nil {
84 objectMap["wikipediaLanguage"] = er.WikipediaLanguage
85 }
86 if er.WikipediaID != nil {
87 objectMap["wikipediaId"] = er.WikipediaID
88 }
89 if er.BingID != nil {
90 objectMap["bingId"] = er.BingID
91 }
92 return json.Marshal(objectMap)
93 }
94
95
96 type ErrorRecord struct {
97
98 ID *string `json:"id,omitempty"`
99
100 Message *string `json:"message,omitempty"`
101 }
102
103
104 type ErrorResponse struct {
105 Code *string `json:"code,omitempty"`
106 Message *string `json:"message,omitempty"`
107 Target *string `json:"target,omitempty"`
108 InnerError *InternalError `json:"innerError,omitempty"`
109 }
110
111
112 type Input struct {
113
114 ID *string `json:"id,omitempty"`
115 Text *string `json:"text,omitempty"`
116 }
117
118
119 type InternalError struct {
120 Code *string `json:"code,omitempty"`
121 Message *string `json:"message,omitempty"`
122 InnerError *InternalError `json:"innerError,omitempty"`
123 }
124
125
126 type KeyPhraseBatchResult struct {
127 autorest.Response `json:"-"`
128
129 Documents *[]KeyPhraseBatchResultItem `json:"documents,omitempty"`
130
131 Errors *[]ErrorRecord `json:"errors,omitempty"`
132 }
133
134
135 func (kpbr KeyPhraseBatchResult) MarshalJSON() ([]byte, error) {
136 objectMap := make(map[string]interface{})
137 return json.Marshal(objectMap)
138 }
139
140
141 type KeyPhraseBatchResultItem struct {
142
143 KeyPhrases *[]string `json:"keyPhrases,omitempty"`
144
145 ID *string `json:"id,omitempty"`
146 }
147
148
149 func (kpbri KeyPhraseBatchResultItem) MarshalJSON() ([]byte, error) {
150 objectMap := make(map[string]interface{})
151 return json.Marshal(objectMap)
152 }
153
154
155 type LanguageBatchResult struct {
156 autorest.Response `json:"-"`
157
158 Documents *[]LanguageBatchResultItem `json:"documents,omitempty"`
159
160 Errors *[]ErrorRecord `json:"errors,omitempty"`
161 }
162
163
164 func (lbr LanguageBatchResult) MarshalJSON() ([]byte, error) {
165 objectMap := make(map[string]interface{})
166 return json.Marshal(objectMap)
167 }
168
169
170 type LanguageBatchResultItem struct {
171
172 ID *string `json:"id,omitempty"`
173
174 DetectedLanguages *[]DetectedLanguage `json:"detectedLanguages,omitempty"`
175 }
176
177
178 func (lbri LanguageBatchResultItem) MarshalJSON() ([]byte, error) {
179 objectMap := make(map[string]interface{})
180 return json.Marshal(objectMap)
181 }
182
183
184 type MatchRecord struct {
185
186 Text *string `json:"text,omitempty"`
187
188 Offset *int32 `json:"offset,omitempty"`
189
190 Length *int32 `json:"length,omitempty"`
191 }
192
193
194 type MultiLanguageBatchInput struct {
195 Documents *[]MultiLanguageInput `json:"documents,omitempty"`
196 }
197
198
199 type MultiLanguageInput struct {
200
201 Language *string `json:"language,omitempty"`
202
203 ID *string `json:"id,omitempty"`
204 Text *string `json:"text,omitempty"`
205 }
206
207
208 type SentimentBatchResult struct {
209 autorest.Response `json:"-"`
210
211 Documents *[]SentimentBatchResultItem `json:"documents,omitempty"`
212
213 Errors *[]ErrorRecord `json:"errors,omitempty"`
214 }
215
216
217 func (sbr SentimentBatchResult) MarshalJSON() ([]byte, error) {
218 objectMap := make(map[string]interface{})
219 return json.Marshal(objectMap)
220 }
221
222
223 type SentimentBatchResultItem struct {
224
225 Score *float64 `json:"score,omitempty"`
226
227 ID *string `json:"id,omitempty"`
228 }
229
230
231 func (sbri SentimentBatchResultItem) MarshalJSON() ([]byte, error) {
232 objectMap := make(map[string]interface{})
233 return json.Marshal(objectMap)
234 }
235
View as plain text