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.1/textanalytics"
16
17
18 type DetectedLanguage struct {
19
20 Name *string `json:"name,omitempty"`
21
22 Iso6391Name *string `json:"iso6391Name,omitempty"`
23
24 Score *float64 `json:"score,omitempty"`
25 }
26
27
28 type DocumentStatistics struct {
29
30 CharactersCount *int32 `json:"charactersCount,omitempty"`
31
32 TransactionsCount *int32 `json:"transactionsCount,omitempty"`
33 }
34
35
36 type EntitiesBatchResult struct {
37 autorest.Response `json:"-"`
38
39 Documents *[]EntitiesBatchResultItem `json:"documents,omitempty"`
40
41 Errors *[]ErrorRecord `json:"errors,omitempty"`
42
43 Statistics *RequestStatistics `json:"statistics,omitempty"`
44 }
45
46
47 func (ebr EntitiesBatchResult) MarshalJSON() ([]byte, error) {
48 objectMap := make(map[string]interface{})
49 return json.Marshal(objectMap)
50 }
51
52
53 type EntitiesBatchResultItem struct {
54
55 ID *string `json:"id,omitempty"`
56
57 Entities *[]EntityRecord `json:"entities,omitempty"`
58
59 Statistics *DocumentStatistics `json:"statistics,omitempty"`
60 }
61
62
63 func (ebri EntitiesBatchResultItem) MarshalJSON() ([]byte, error) {
64 objectMap := make(map[string]interface{})
65 if ebri.ID != nil {
66 objectMap["id"] = ebri.ID
67 }
68 if ebri.Statistics != nil {
69 objectMap["statistics"] = ebri.Statistics
70 }
71 return json.Marshal(objectMap)
72 }
73
74
75 type EntityRecord struct {
76
77 Name *string `json:"name,omitempty"`
78
79 Matches *[]MatchRecord `json:"matches,omitempty"`
80
81 WikipediaLanguage *string `json:"wikipediaLanguage,omitempty"`
82
83 WikipediaID *string `json:"wikipediaId,omitempty"`
84
85 WikipediaURL *string `json:"wikipediaUrl,omitempty"`
86
87 BingID *string `json:"bingId,omitempty"`
88
89 Type *string `json:"type,omitempty"`
90
91 SubType *string `json:"subType,omitempty"`
92 }
93
94
95 func (er EntityRecord) MarshalJSON() ([]byte, error) {
96 objectMap := make(map[string]interface{})
97 if er.Name != nil {
98 objectMap["name"] = er.Name
99 }
100 if er.Matches != nil {
101 objectMap["matches"] = er.Matches
102 }
103 if er.WikipediaLanguage != nil {
104 objectMap["wikipediaLanguage"] = er.WikipediaLanguage
105 }
106 if er.WikipediaID != nil {
107 objectMap["wikipediaId"] = er.WikipediaID
108 }
109 if er.BingID != nil {
110 objectMap["bingId"] = er.BingID
111 }
112 if er.Type != nil {
113 objectMap["type"] = er.Type
114 }
115 if er.SubType != nil {
116 objectMap["subType"] = er.SubType
117 }
118 return json.Marshal(objectMap)
119 }
120
121
122 type ErrorRecord struct {
123
124 ID *string `json:"id,omitempty"`
125
126 Message *string `json:"message,omitempty"`
127 }
128
129
130 type ErrorResponse struct {
131 Code *string `json:"code,omitempty"`
132 Message *string `json:"message,omitempty"`
133 Target *string `json:"target,omitempty"`
134 InnerError *InternalError `json:"innerError,omitempty"`
135 }
136
137
138 type InternalError struct {
139 Code *string `json:"code,omitempty"`
140 Message *string `json:"message,omitempty"`
141 InnerError *InternalError `json:"innerError,omitempty"`
142 }
143
144
145 type KeyPhraseBatchResult struct {
146 autorest.Response `json:"-"`
147
148 Documents *[]KeyPhraseBatchResultItem `json:"documents,omitempty"`
149
150 Errors *[]ErrorRecord `json:"errors,omitempty"`
151
152 Statistics *RequestStatistics `json:"statistics,omitempty"`
153 }
154
155
156 func (kpbr KeyPhraseBatchResult) MarshalJSON() ([]byte, error) {
157 objectMap := make(map[string]interface{})
158 return json.Marshal(objectMap)
159 }
160
161
162 type KeyPhraseBatchResultItem struct {
163
164 ID *string `json:"id,omitempty"`
165
166 KeyPhrases *[]string `json:"keyPhrases,omitempty"`
167
168 Statistics *DocumentStatistics `json:"statistics,omitempty"`
169 }
170
171
172 func (kpbri KeyPhraseBatchResultItem) MarshalJSON() ([]byte, error) {
173 objectMap := make(map[string]interface{})
174 if kpbri.ID != nil {
175 objectMap["id"] = kpbri.ID
176 }
177 if kpbri.Statistics != nil {
178 objectMap["statistics"] = kpbri.Statistics
179 }
180 return json.Marshal(objectMap)
181 }
182
183
184 type LanguageBatchInput struct {
185 Documents *[]LanguageInput `json:"documents,omitempty"`
186 }
187
188
189 type LanguageBatchResult struct {
190 autorest.Response `json:"-"`
191
192 Documents *[]LanguageBatchResultItem `json:"documents,omitempty"`
193
194 Errors *[]ErrorRecord `json:"errors,omitempty"`
195
196 Statistics *RequestStatistics `json:"statistics,omitempty"`
197 }
198
199
200 func (lbr LanguageBatchResult) MarshalJSON() ([]byte, error) {
201 objectMap := make(map[string]interface{})
202 return json.Marshal(objectMap)
203 }
204
205
206 type LanguageBatchResultItem struct {
207
208 ID *string `json:"id,omitempty"`
209
210 DetectedLanguages *[]DetectedLanguage `json:"detectedLanguages,omitempty"`
211
212 Statistics *DocumentStatistics `json:"statistics,omitempty"`
213 }
214
215
216 type LanguageInput struct {
217 CountryHint *string `json:"countryHint,omitempty"`
218
219 ID *string `json:"id,omitempty"`
220 Text *string `json:"text,omitempty"`
221 }
222
223
224 type MatchRecord struct {
225
226 WikipediaScore *float64 `json:"wikipediaScore,omitempty"`
227
228 EntityTypeScore *float64 `json:"entityTypeScore,omitempty"`
229
230 Text *string `json:"text,omitempty"`
231
232 Offset *int32 `json:"offset,omitempty"`
233
234 Length *int32 `json:"length,omitempty"`
235 }
236
237
238 type MultiLanguageBatchInput struct {
239 Documents *[]MultiLanguageInput `json:"documents,omitempty"`
240 }
241
242
243 type MultiLanguageInput struct {
244
245 Language *string `json:"language,omitempty"`
246
247 ID *string `json:"id,omitempty"`
248 Text *string `json:"text,omitempty"`
249 }
250
251
252 type RequestStatistics struct {
253
254 DocumentsCount *int32 `json:"documentsCount,omitempty"`
255
256 ValidDocumentsCount *int32 `json:"validDocumentsCount,omitempty"`
257
258 ErroneousDocumentsCount *int32 `json:"erroneousDocumentsCount,omitempty"`
259
260 TransactionsCount *int64 `json:"transactionsCount,omitempty"`
261 }
262
263
264 type SentimentBatchResult struct {
265 autorest.Response `json:"-"`
266
267 Documents *[]SentimentBatchResultItem `json:"documents,omitempty"`
268
269 Errors *[]ErrorRecord `json:"errors,omitempty"`
270
271 Statistics *RequestStatistics `json:"statistics,omitempty"`
272 }
273
274
275 func (sbr SentimentBatchResult) MarshalJSON() ([]byte, error) {
276 objectMap := make(map[string]interface{})
277 return json.Marshal(objectMap)
278 }
279
280
281 type SentimentBatchResultItem struct {
282
283 ID *string `json:"id,omitempty"`
284
285 Score *float64 `json:"score,omitempty"`
286
287 Statistics *DocumentStatistics `json:"statistics,omitempty"`
288 }
289
View as plain text