1 package contentmoderator
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/v1.0/contentmoderator"
16
17
18 type Address struct {
19
20 Text *string `json:"Text,omitempty"`
21
22 Index *int32 `json:"Index,omitempty"`
23 }
24
25
26 type APIError struct {
27 Error *Error `json:"Error,omitempty"`
28 }
29
30
31 type Body struct {
32
33 Name *string `json:"Name,omitempty"`
34
35 Description *string `json:"Description,omitempty"`
36
37 Metadata map[string]*string `json:"Metadata"`
38 }
39
40
41 func (b Body) MarshalJSON() ([]byte, error) {
42 objectMap := make(map[string]interface{})
43 if b.Name != nil {
44 objectMap["Name"] = b.Name
45 }
46 if b.Description != nil {
47 objectMap["Description"] = b.Description
48 }
49 if b.Metadata != nil {
50 objectMap["Metadata"] = b.Metadata
51 }
52 return json.Marshal(objectMap)
53 }
54
55
56 type Candidate struct {
57
58 Text *string `json:"Text,omitempty"`
59
60 Confidence *float64 `json:"Confidence,omitempty"`
61 }
62
63
64 type Classification struct {
65
66 Category1 *ClassificationCategory1 `json:"Category1,omitempty"`
67
68 Category2 *ClassificationCategory2 `json:"Category2,omitempty"`
69
70 Category3 *ClassificationCategory3 `json:"Category3,omitempty"`
71
72 ReviewRecommended *bool `json:"ReviewRecommended,omitempty"`
73 }
74
75
76
77 type ClassificationCategory1 struct {
78
79 Score *float64 `json:"Score,omitempty"`
80 }
81
82
83
84 type ClassificationCategory2 struct {
85
86 Score *float64 `json:"Score,omitempty"`
87 }
88
89
90
91 type ClassificationCategory3 struct {
92
93 Score *float64 `json:"Score,omitempty"`
94 }
95
96
97 type Content struct {
98
99 ContentValue *string `json:"ContentValue,omitempty"`
100 }
101
102
103 type CreateReviewBodyItem struct {
104
105 Type Type `json:"Type,omitempty"`
106
107 Content *string `json:"Content,omitempty"`
108
109 ContentID *string `json:"ContentId,omitempty"`
110
111 CallbackEndpoint *string `json:"CallbackEndpoint,omitempty"`
112
113 Metadata *[]CreateReviewBodyItemMetadataItem `json:"Metadata,omitempty"`
114 }
115
116
117 type CreateReviewBodyItemMetadataItem struct {
118
119 Key *string `json:"Key,omitempty"`
120
121 Value *string `json:"Value,omitempty"`
122 }
123
124
125 type CreateVideoReviewsBodyItem struct {
126
127 VideoFrames *[]CreateVideoReviewsBodyItemVideoFramesItem `json:"VideoFrames,omitempty"`
128
129 Metadata *[]CreateVideoReviewsBodyItemMetadataItem `json:"Metadata,omitempty"`
130
131 Type *string `json:"Type,omitempty"`
132
133 Content *string `json:"Content,omitempty"`
134
135 ContentID *string `json:"ContentId,omitempty"`
136
137 Status StatusEnum `json:"Status,omitempty"`
138
139 Timescale *int32 `json:"Timescale,omitempty"`
140
141 CallbackEndpoint *string `json:"CallbackEndpoint,omitempty"`
142 }
143
144
145 type CreateVideoReviewsBodyItemMetadataItem struct {
146
147 Key *string `json:"Key,omitempty"`
148
149 Value *string `json:"Value,omitempty"`
150 }
151
152
153 type CreateVideoReviewsBodyItemVideoFramesItem struct {
154
155 ID *string `json:"Id,omitempty"`
156
157 Timestamp *int32 `json:"Timestamp,omitempty"`
158
159 FrameImage *string `json:"FrameImage,omitempty"`
160 ReviewerResultTags *[]CreateVideoReviewsBodyItemVideoFramesItemReviewerResultTagsItem `json:"ReviewerResultTags,omitempty"`
161
162 Metadata *[]CreateVideoReviewsBodyItemVideoFramesItemMetadataItem `json:"Metadata,omitempty"`
163 }
164
165
166 type CreateVideoReviewsBodyItemVideoFramesItemMetadataItem struct {
167
168 Key *string `json:"Key,omitempty"`
169
170 Value *string `json:"Value,omitempty"`
171 }
172
173
174 type CreateVideoReviewsBodyItemVideoFramesItemReviewerResultTagsItem struct {
175
176 Key *string `json:"Key,omitempty"`
177
178 Value *string `json:"Value,omitempty"`
179 }
180
181
182 type DetectedLanguage struct {
183 autorest.Response `json:"-"`
184
185 DetectedLanguage *string `json:"DetectedLanguage,omitempty"`
186
187 Status *Status `json:"Status,omitempty"`
188
189 TrackingID *string `json:"TrackingId,omitempty"`
190 }
191
192
193 type DetectedTerms struct {
194
195 Index *int32 `json:"Index,omitempty"`
196
197 OriginalIndex *int32 `json:"OriginalIndex,omitempty"`
198
199 ListID *int32 `json:"ListId,omitempty"`
200
201 Term *string `json:"Term,omitempty"`
202 }
203
204
205 type Email struct {
206
207 Detected *string `json:"Detected,omitempty"`
208
209 SubType *string `json:"SubType,omitempty"`
210
211 Text *string `json:"Text,omitempty"`
212
213 Index *int32 `json:"Index,omitempty"`
214 }
215
216
217 type Error struct {
218 Code *string `json:"Code,omitempty"`
219 Message *string `json:"Message,omitempty"`
220 }
221
222
223 type Evaluate struct {
224 autorest.Response `json:"-"`
225
226 CacheID *string `json:"CacheID,omitempty"`
227
228 Result *bool `json:"Result,omitempty"`
229
230 TrackingID *string `json:"TrackingId,omitempty"`
231
232 AdultClassificationScore *float64 `json:"AdultClassificationScore,omitempty"`
233
234 IsImageAdultClassified *bool `json:"IsImageAdultClassified,omitempty"`
235
236 RacyClassificationScore *float64 `json:"RacyClassificationScore,omitempty"`
237
238 IsImageRacyClassified *bool `json:"IsImageRacyClassified,omitempty"`
239
240 AdvancedInfo *[]KeyValuePair `json:"AdvancedInfo,omitempty"`
241
242 Status *Status `json:"Status,omitempty"`
243 }
244
245
246 type Face struct {
247
248 Bottom *int32 `json:"Bottom,omitempty"`
249
250 Left *int32 `json:"Left,omitempty"`
251
252 Right *int32 `json:"Right,omitempty"`
253
254 Top *int32 `json:"Top,omitempty"`
255 }
256
257
258 type FoundFaces struct {
259 autorest.Response `json:"-"`
260
261 Status *Status `json:"Status,omitempty"`
262
263 TrackingID *string `json:"TrackingId,omitempty"`
264
265 CacheID *string `json:"CacheId,omitempty"`
266
267 Result *bool `json:"Result,omitempty"`
268
269 Count *int32 `json:"Count,omitempty"`
270
271 AdvancedInfo *[]KeyValuePair `json:"AdvancedInfo,omitempty"`
272
273 Faces *[]Face `json:"Faces,omitempty"`
274 }
275
276
277 type Frame struct {
278
279 Timestamp *string `json:"Timestamp,omitempty"`
280
281 FrameImage *string `json:"FrameImage,omitempty"`
282
283 Metadata *[]KeyValuePair `json:"Metadata,omitempty"`
284
285 ReviewerResultTags *[]Tag `json:"ReviewerResultTags,omitempty"`
286 }
287
288
289 type Frames struct {
290 autorest.Response `json:"-"`
291
292 ReviewID *string `json:"ReviewId,omitempty"`
293 VideoFrames *[]Frame `json:"VideoFrames,omitempty"`
294 }
295
296
297 type Image struct {
298 autorest.Response `json:"-"`
299
300 ContentID *string `json:"ContentId,omitempty"`
301
302 AdditionalInfo *[]ImageAdditionalInfoItem `json:"AdditionalInfo,omitempty"`
303
304 Status *Status `json:"Status,omitempty"`
305
306 TrackingID *string `json:"TrackingId,omitempty"`
307 }
308
309
310 type ImageAdditionalInfoItem struct {
311
312 Key *string `json:"Key,omitempty"`
313
314 Value *string `json:"Value,omitempty"`
315 }
316
317
318 type ImageIds struct {
319 autorest.Response `json:"-"`
320
321 ContentSource *string `json:"ContentSource,omitempty"`
322
323 ContentIds *[]int32 `json:"ContentIds,omitempty"`
324
325 Status *Status `json:"Status,omitempty"`
326
327 TrackingID *string `json:"TrackingId,omitempty"`
328 }
329
330
331 type ImageList struct {
332 autorest.Response `json:"-"`
333
334 ID *int32 `json:"Id,omitempty"`
335
336 Name *string `json:"Name,omitempty"`
337
338 Description *string `json:"Description,omitempty"`
339
340 Metadata map[string]*string `json:"Metadata"`
341 }
342
343
344 func (il ImageList) MarshalJSON() ([]byte, error) {
345 objectMap := make(map[string]interface{})
346 if il.ID != nil {
347 objectMap["Id"] = il.ID
348 }
349 if il.Name != nil {
350 objectMap["Name"] = il.Name
351 }
352 if il.Description != nil {
353 objectMap["Description"] = il.Description
354 }
355 if il.Metadata != nil {
356 objectMap["Metadata"] = il.Metadata
357 }
358 return json.Marshal(objectMap)
359 }
360
361
362 type ImageURL struct {
363 DataRepresentation *string `json:"DataRepresentation,omitempty"`
364 Value *string `json:"Value,omitempty"`
365 }
366
367
368 type IPA struct {
369
370 SubType *string `json:"SubType,omitempty"`
371
372 Text *string `json:"Text,omitempty"`
373
374 Index *int32 `json:"Index,omitempty"`
375 }
376
377
378 type Job struct {
379 autorest.Response `json:"-"`
380
381 ID *string `json:"Id,omitempty"`
382
383 TeamName *string `json:"TeamName,omitempty"`
384
385 Status *string `json:"Status,omitempty"`
386
387 WorkflowID *string `json:"WorkflowId,omitempty"`
388
389 Type *string `json:"Type,omitempty"`
390
391 CallBackEndpoint *string `json:"CallBackEndpoint,omitempty"`
392
393 ReviewID *string `json:"ReviewId,omitempty"`
394
395 ResultMetaData *[]KeyValuePair `json:"ResultMetaData,omitempty"`
396
397 JobExecutionReport *[]JobExecutionReportDetails `json:"JobExecutionReport,omitempty"`
398 }
399
400
401 type JobExecutionReportDetails struct {
402
403 Ts *string `json:"Ts,omitempty"`
404
405 Msg *string `json:"Msg,omitempty"`
406 }
407
408
409 type JobID struct {
410 autorest.Response `json:"-"`
411
412 JobID *string `json:"JobId,omitempty"`
413 }
414
415
416 type JobListResult struct {
417
418 Value *[]string `json:"Value,omitempty"`
419 }
420
421
422 type KeyValuePair struct {
423
424 Key *string `json:"Key,omitempty"`
425
426 Value *string `json:"Value,omitempty"`
427 }
428
429
430 type ListImageList struct {
431 autorest.Response `json:"-"`
432 Value *[]ImageList `json:"value,omitempty"`
433 }
434
435
436 type ListString struct {
437 autorest.Response `json:"-"`
438 Value *[]string `json:"value,omitempty"`
439 }
440
441
442 type ListTermList struct {
443 autorest.Response `json:"-"`
444 Value *[]TermList `json:"value,omitempty"`
445 }
446
447
448 type Match struct {
449
450 Score *float64 `json:"Score,omitempty"`
451
452 MatchID *int32 `json:"MatchId,omitempty"`
453
454 Source *string `json:"Source,omitempty"`
455
456 Tags *[]int32 `json:"Tags,omitempty"`
457
458 Label *string `json:"Label,omitempty"`
459 }
460
461
462 type MatchResponse struct {
463 autorest.Response `json:"-"`
464
465 TrackingID *string `json:"TrackingId,omitempty"`
466
467 CacheID *string `json:"CacheID,omitempty"`
468
469 IsMatch *bool `json:"IsMatch,omitempty"`
470
471 Matches *[]Match `json:"Matches,omitempty"`
472
473 Status *Status `json:"Status,omitempty"`
474 }
475
476
477 type OCR struct {
478 autorest.Response `json:"-"`
479
480 Status *Status `json:"Status,omitempty"`
481
482 Metadata *[]KeyValuePair `json:"Metadata,omitempty"`
483
484 TrackingID *string `json:"TrackingId,omitempty"`
485
486 CacheID *string `json:"CacheId,omitempty"`
487
488 Language *string `json:"Language,omitempty"`
489
490 Text *string `json:"Text,omitempty"`
491
492 Candidates *[]Candidate `json:"Candidates,omitempty"`
493 }
494
495
496 type Phone struct {
497
498 CountryCode *string `json:"CountryCode,omitempty"`
499
500 Text *string `json:"Text,omitempty"`
501
502 Index *int32 `json:"Index,omitempty"`
503 }
504
505
506 type PII struct {
507 Email *[]Email `json:"Email,omitempty"`
508 SSN *[]SSN `json:"SSN,omitempty"`
509 IPA *[]IPA `json:"IPA,omitempty"`
510 Phone *[]Phone `json:"Phone,omitempty"`
511 Address *[]Address `json:"Address,omitempty"`
512 }
513
514
515 type RefreshIndex struct {
516 autorest.Response `json:"-"`
517
518 ContentSourceID *string `json:"ContentSourceId,omitempty"`
519
520 IsUpdateSuccess *bool `json:"IsUpdateSuccess,omitempty"`
521
522 AdvancedInfo *[]map[string]*string `json:"AdvancedInfo,omitempty"`
523
524 Status *Status `json:"Status,omitempty"`
525
526 TrackingID *string `json:"TrackingId,omitempty"`
527 }
528
529
530 type Review struct {
531 autorest.Response `json:"-"`
532
533 ReviewID *string `json:"ReviewId,omitempty"`
534
535 SubTeam *string `json:"SubTeam,omitempty"`
536
537 Status *string `json:"Status,omitempty"`
538
539 ReviewerResultTags *[]KeyValuePair `json:"ReviewerResultTags,omitempty"`
540
541 CreatedBy *string `json:"CreatedBy,omitempty"`
542
543 Metadata *[]KeyValuePair `json:"Metadata,omitempty"`
544
545 Type *string `json:"Type,omitempty"`
546
547 Content *string `json:"Content,omitempty"`
548
549 ContentID *string `json:"ContentId,omitempty"`
550
551 CallbackEndpoint *string `json:"CallbackEndpoint,omitempty"`
552 }
553
554
555 type Screen struct {
556 autorest.Response `json:"-"`
557
558 OriginalText *string `json:"OriginalText,omitempty"`
559
560 NormalizedText *string `json:"NormalizedText,omitempty"`
561
562 AutoCorrectedText *string `json:"AutoCorrectedText,omitempty"`
563
564 Misrepresentation *[]string `json:"Misrepresentation,omitempty"`
565
566 Classification *Classification `json:"Classification,omitempty"`
567
568 Status *Status `json:"Status,omitempty"`
569
570 PII *PII `json:"PII,omitempty"`
571
572 Language *string `json:"Language,omitempty"`
573 Terms *[]DetectedTerms `json:"Terms,omitempty"`
574
575 TrackingID *string `json:"TrackingId,omitempty"`
576 }
577
578
579 type SSN struct {
580
581 Text *string `json:"Text,omitempty"`
582
583 Index *int32 `json:"Index,omitempty"`
584 }
585
586
587 type Status struct {
588
589 Code *int32 `json:"Code,omitempty"`
590
591 Description *string `json:"Description,omitempty"`
592
593 Exception *string `json:"Exception,omitempty"`
594 }
595
596
597 type String struct {
598 autorest.Response `json:"-"`
599 Value *string `json:"value,omitempty"`
600 }
601
602
603 type Tag struct {
604
605 Key *string `json:"Key,omitempty"`
606
607 Value *string `json:"Value,omitempty"`
608 }
609
610
611 type TermList struct {
612 autorest.Response `json:"-"`
613
614 ID *int32 `json:"Id,omitempty"`
615
616 Name *string `json:"Name,omitempty"`
617
618 Description *string `json:"Description,omitempty"`
619
620 Metadata map[string]*string `json:"Metadata"`
621 }
622
623
624 func (tl TermList) MarshalJSON() ([]byte, error) {
625 objectMap := make(map[string]interface{})
626 if tl.ID != nil {
627 objectMap["Id"] = tl.ID
628 }
629 if tl.Name != nil {
630 objectMap["Name"] = tl.Name
631 }
632 if tl.Description != nil {
633 objectMap["Description"] = tl.Description
634 }
635 if tl.Metadata != nil {
636 objectMap["Metadata"] = tl.Metadata
637 }
638 return json.Marshal(objectMap)
639 }
640
641
642 type Terms struct {
643 autorest.Response `json:"-"`
644
645 Data *TermsData `json:"Data,omitempty"`
646
647 Paging *TermsPaging `json:"Paging,omitempty"`
648 }
649
650
651 type TermsData struct {
652
653 Language *string `json:"Language,omitempty"`
654
655 Terms *[]TermsInList `json:"Terms,omitempty"`
656
657 Status *Status `json:"Status,omitempty"`
658
659 TrackingID *string `json:"TrackingId,omitempty"`
660 }
661
662
663 type TermsInList struct {
664
665 Term *string `json:"Term,omitempty"`
666 }
667
668
669 type TermsPaging struct {
670
671 Total *int32 `json:"Total,omitempty"`
672
673 Limit *int32 `json:"Limit,omitempty"`
674
675 Offset *int32 `json:"Offset,omitempty"`
676
677 Returned *int32 `json:"Returned,omitempty"`
678 }
679
680
681 type TranscriptModerationBodyItem struct {
682
683 Timestamp *string `json:"Timestamp,omitempty"`
684
685 Terms *[]TranscriptModerationBodyItemTermsItem `json:"Terms,omitempty"`
686 }
687
688
689 type TranscriptModerationBodyItemTermsItem struct {
690
691 Index *int32 `json:"Index,omitempty"`
692
693 Term *string `json:"Term,omitempty"`
694 }
695
696
697 type VideoFrameBodyItem struct {
698
699 Timestamp *string `json:"Timestamp,omitempty"`
700
701 FrameImage *string `json:"FrameImage,omitempty"`
702 ReviewerResultTags *[]VideoFrameBodyItemReviewerResultTagsItem `json:"ReviewerResultTags,omitempty"`
703
704 Metadata *[]VideoFrameBodyItemMetadataItem `json:"Metadata,omitempty"`
705 }
706
707
708 type VideoFrameBodyItemMetadataItem struct {
709
710 Key *string `json:"Key,omitempty"`
711
712 Value *string `json:"Value,omitempty"`
713 }
714
715
716 type VideoFrameBodyItemReviewerResultTagsItem struct {
717
718 Key *string `json:"Key,omitempty"`
719
720 Value *string `json:"Value,omitempty"`
721 }
722
View as plain text