-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
_models.py
2974 lines (2543 loc) · 122 KB
/
_models.py
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
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# coding=utf-8
# pylint: disable=too-many-lines
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import datetime
from typing import Any, Dict, List, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload
from .. import _model_base
from .._model_base import rest_discriminator, rest_field
from ._enums import OperationKind
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
class AddressValue(_model_base.Model): # pylint: disable=too-many-instance-attributes
"""Address field value.
:ivar house_number: House or building number.
:vartype house_number: str
:ivar po_box: Post office box number.
:vartype po_box: str
:ivar road: Street name.
:vartype road: str
:ivar city: Name of city, town, village, etc.
:vartype city: str
:ivar state: First-level administrative division.
:vartype state: str
:ivar postal_code: Postal code used for mail sorting.
:vartype postal_code: str
:ivar country_region: Country/region.
:vartype country_region: str
:ivar street_address: Street-level address, excluding city, state, countryRegion, and
postalCode.
:vartype street_address: str
:ivar unit: Apartment or office number.
:vartype unit: str
:ivar city_district: Districts or boroughs within a city, such as Brooklyn in New York City or
City
of Westminster in London.
:vartype city_district: str
:ivar state_district: Second-level administrative division used in certain locales.
:vartype state_district: str
:ivar suburb: Unofficial neighborhood name, like Chinatown.
:vartype suburb: str
:ivar house: Build name, such as World Trade Center.
:vartype house: str
:ivar level: Floor number, such as 3F.
:vartype level: str
"""
house_number: Optional[str] = rest_field(name="houseNumber")
"""House or building number."""
po_box: Optional[str] = rest_field(name="poBox")
"""Post office box number."""
road: Optional[str] = rest_field()
"""Street name."""
city: Optional[str] = rest_field()
"""Name of city, town, village, etc."""
state: Optional[str] = rest_field()
"""First-level administrative division."""
postal_code: Optional[str] = rest_field(name="postalCode")
"""Postal code used for mail sorting."""
country_region: Optional[str] = rest_field(name="countryRegion")
"""Country/region."""
street_address: Optional[str] = rest_field(name="streetAddress")
"""Street-level address, excluding city, state, countryRegion, and postalCode."""
unit: Optional[str] = rest_field()
"""Apartment or office number."""
city_district: Optional[str] = rest_field(name="cityDistrict")
"""Districts or boroughs within a city, such as Brooklyn in New York City or City
of Westminster in London."""
state_district: Optional[str] = rest_field(name="stateDistrict")
"""Second-level administrative division used in certain locales."""
suburb: Optional[str] = rest_field()
"""Unofficial neighborhood name, like Chinatown."""
house: Optional[str] = rest_field()
"""Build name, such as World Trade Center."""
level: Optional[str] = rest_field()
"""Floor number, such as 3F."""
@overload
def __init__(
self,
*,
house_number: Optional[str] = None,
po_box: Optional[str] = None,
road: Optional[str] = None,
city: Optional[str] = None,
state: Optional[str] = None,
postal_code: Optional[str] = None,
country_region: Optional[str] = None,
street_address: Optional[str] = None,
unit: Optional[str] = None,
city_district: Optional[str] = None,
state_district: Optional[str] = None,
suburb: Optional[str] = None,
house: Optional[str] = None,
level: Optional[str] = None,
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class AnalyzeDocumentRequest(_model_base.Model):
"""Document analysis parameters.
:ivar url_source: Document URL to analyze. Either urlSource or base64Source must be specified.
:vartype url_source: str
:ivar bytes_source: Base64 encoding of the document to analyze. Either urlSource or
base64Source
must be specified.
:vartype bytes_source: bytes
"""
url_source: Optional[str] = rest_field(name="urlSource")
"""Document URL to analyze. Either urlSource or base64Source must be specified."""
bytes_source: Optional[bytes] = rest_field(name="base64Source", format="base64")
"""Base64 encoding of the document to analyze. Either urlSource or base64Source
must be specified."""
@overload
def __init__(
self,
*,
url_source: Optional[str] = None,
bytes_source: Optional[bytes] = None,
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class AnalyzeResult(_model_base.Model): # pylint: disable=too-many-instance-attributes
"""Document analysis result.
All required parameters must be populated in order to send to server.
:ivar api_version: API version used to produce this result. Required.
:vartype api_version: str
:ivar model_id: Document model ID used to produce this result. Required.
:vartype model_id: str
:ivar string_index_type: Method used to compute string offset and length. Required. Known
values are: "textElements", "unicodeCodePoint", and "utf16CodeUnit".
:vartype string_index_type: str or ~azure.ai.documentintelligence.models.StringIndexType
:ivar content_format: Format of the analyze result top-level content. Known values are: "text"
and "markdown".
:vartype content_format: str or ~azure.ai.documentintelligence.models.ContentFormat
:ivar content: Concatenate string representation of all textual and visual elements in reading
order. Required.
:vartype content: str
:ivar pages: Analyzed pages. Required.
:vartype pages: list[~azure.ai.documentintelligence.models.DocumentPage]
:ivar paragraphs: Extracted paragraphs.
:vartype paragraphs: list[~azure.ai.documentintelligence.models.DocumentParagraph]
:ivar tables: Extracted tables.
:vartype tables: list[~azure.ai.documentintelligence.models.DocumentTable]
:ivar figures: Extracted figures.
:vartype figures: list[~azure.ai.documentintelligence.models.DocumentFigure]
:ivar lists: Extracted lists.
:vartype lists: list[~azure.ai.documentintelligence.models.DocumentList]
:ivar sections: Extracted sections.
:vartype sections: list[~azure.ai.documentintelligence.models.DocumentSection]
:ivar key_value_pairs: Extracted key-value pairs.
:vartype key_value_pairs: list[~azure.ai.documentintelligence.models.DocumentKeyValuePair]
:ivar styles: Extracted font styles.
:vartype styles: list[~azure.ai.documentintelligence.models.DocumentStyle]
:ivar languages: Detected languages.
:vartype languages: list[~azure.ai.documentintelligence.models.DocumentLanguage]
:ivar documents: Extracted documents.
:vartype documents: list[~azure.ai.documentintelligence.models.Document]
"""
api_version: str = rest_field(name="apiVersion")
"""API version used to produce this result. Required."""
model_id: str = rest_field(name="modelId")
"""Document model ID used to produce this result. Required."""
string_index_type: Union[str, "_models.StringIndexType"] = rest_field(name="stringIndexType")
"""Method used to compute string offset and length. Required. Known values are: \"textElements\",
\"unicodeCodePoint\", and \"utf16CodeUnit\"."""
content_format: Optional[Union[str, "_models.ContentFormat"]] = rest_field(name="contentFormat")
"""Format of the analyze result top-level content. Known values are: \"text\" and \"markdown\"."""
content: str = rest_field()
"""Concatenate string representation of all textual and visual elements in reading
order. Required."""
pages: List["_models.DocumentPage"] = rest_field()
"""Analyzed pages. Required."""
paragraphs: Optional[List["_models.DocumentParagraph"]] = rest_field()
"""Extracted paragraphs."""
tables: Optional[List["_models.DocumentTable"]] = rest_field()
"""Extracted tables."""
figures: Optional[List["_models.DocumentFigure"]] = rest_field()
"""Extracted figures."""
lists: Optional[List["_models.DocumentList"]] = rest_field()
"""Extracted lists."""
sections: Optional[List["_models.DocumentSection"]] = rest_field()
"""Extracted sections."""
key_value_pairs: Optional[List["_models.DocumentKeyValuePair"]] = rest_field(name="keyValuePairs")
"""Extracted key-value pairs."""
styles: Optional[List["_models.DocumentStyle"]] = rest_field()
"""Extracted font styles."""
languages: Optional[List["_models.DocumentLanguage"]] = rest_field()
"""Detected languages."""
documents: Optional[List["_models.Document"]] = rest_field()
"""Extracted documents."""
@overload
def __init__(
self,
*,
api_version: str,
model_id: str,
string_index_type: Union[str, "_models.StringIndexType"],
content: str,
pages: List["_models.DocumentPage"],
content_format: Optional[Union[str, "_models.ContentFormat"]] = None,
paragraphs: Optional[List["_models.DocumentParagraph"]] = None,
tables: Optional[List["_models.DocumentTable"]] = None,
figures: Optional[List["_models.DocumentFigure"]] = None,
lists: Optional[List["_models.DocumentList"]] = None,
sections: Optional[List["_models.DocumentSection"]] = None,
key_value_pairs: Optional[List["_models.DocumentKeyValuePair"]] = None,
styles: Optional[List["_models.DocumentStyle"]] = None,
languages: Optional[List["_models.DocumentLanguage"]] = None,
documents: Optional[List["_models.Document"]] = None,
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class AnalyzeResultOperation(_model_base.Model):
"""Status and result of the analyze operation.
All required parameters must be populated in order to send to server.
:ivar status: Operation status. notStarted, running, succeeded, or failed. Required. Known
values are: "notStarted", "running", "failed", "succeeded", "completed", and "canceled".
:vartype status: str or ~azure.ai.documentintelligence.models.OperationStatus
:ivar created_date_time: Date and time (UTC) when the analyze operation was submitted.
Required.
:vartype created_date_time: ~datetime.datetime
:ivar last_updated_date_time: Date and time (UTC) when the status was last updated. Required.
:vartype last_updated_date_time: ~datetime.datetime
:ivar error: Encountered error during document analysis.
:vartype error: ~azure.ai.documentintelligence.models.Error
:ivar analyze_result: Document analysis result.
:vartype analyze_result: ~azure.ai.documentintelligence.models.AnalyzeResult
"""
status: Union[str, "_models.OperationStatus"] = rest_field()
"""Operation status. notStarted, running, succeeded, or failed. Required. Known values are:
\"notStarted\", \"running\", \"failed\", \"succeeded\", \"completed\", and \"canceled\"."""
created_date_time: datetime.datetime = rest_field(name="createdDateTime", format="rfc3339")
"""Date and time (UTC) when the analyze operation was submitted. Required."""
last_updated_date_time: datetime.datetime = rest_field(name="lastUpdatedDateTime", format="rfc3339")
"""Date and time (UTC) when the status was last updated. Required."""
error: Optional["_models.Error"] = rest_field()
"""Encountered error during document analysis."""
analyze_result: Optional["_models.AnalyzeResult"] = rest_field(name="analyzeResult")
"""Document analysis result."""
@overload
def __init__(
self,
*,
status: Union[str, "_models.OperationStatus"],
created_date_time: datetime.datetime,
last_updated_date_time: datetime.datetime,
error: Optional["_models.Error"] = None,
analyze_result: Optional["_models.AnalyzeResult"] = None,
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class AuthorizeCopyRequest(_model_base.Model):
"""Request body to authorize document model copy.
All required parameters must be populated in order to send to server.
:ivar model_id: Unique document model name. Required.
:vartype model_id: str
:ivar description: Document model description.
:vartype description: str
:ivar tags: List of key-value tag attributes associated with the document model.
:vartype tags: dict[str, str]
"""
model_id: str = rest_field(name="modelId")
"""Unique document model name. Required."""
description: Optional[str] = rest_field()
"""Document model description."""
tags: Optional[Dict[str, str]] = rest_field()
"""List of key-value tag attributes associated with the document model."""
@overload
def __init__(
self,
*,
model_id: str,
description: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class AzureBlobContentSource(_model_base.Model):
"""Azure Blob Storage content.
All required parameters must be populated in order to send to server.
:ivar container_url: Azure Blob Storage container URL. Required.
:vartype container_url: str
:ivar prefix: Blob name prefix.
:vartype prefix: str
"""
container_url: str = rest_field(name="containerUrl")
"""Azure Blob Storage container URL. Required."""
prefix: Optional[str] = rest_field()
"""Blob name prefix."""
@overload
def __init__(
self,
*,
container_url: str,
prefix: Optional[str] = None,
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class AzureBlobFileListContentSource(_model_base.Model):
"""File list in Azure Blob Storage.
All required parameters must be populated in order to send to server.
:ivar container_url: Azure Blob Storage container URL. Required.
:vartype container_url: str
:ivar file_list: Path to a JSONL file within the container specifying a subset of documents.
Required.
:vartype file_list: str
"""
container_url: str = rest_field(name="containerUrl")
"""Azure Blob Storage container URL. Required."""
file_list: str = rest_field(name="fileList")
"""Path to a JSONL file within the container specifying a subset of documents. Required."""
@overload
def __init__(
self,
*,
container_url: str,
file_list: str,
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class BoundingRegion(_model_base.Model):
"""Bounding polygon on a specific page of the input.
All required parameters must be populated in order to send to server.
:ivar page_number: 1-based page number of page containing the bounding region. Required.
:vartype page_number: int
:ivar polygon: Bounding polygon on the page, or the entire page if not specified.
Coordinates specified relative to the top-left of the page. The numbers
represent the x, y values of the polygon vertices, clockwise from the left
(-180 degrees inclusive) relative to the element orientation. Required.
:vartype polygon: list[float]
"""
page_number: int = rest_field(name="pageNumber")
"""1-based page number of page containing the bounding region. Required."""
polygon: List[float] = rest_field()
"""Bounding polygon on the page, or the entire page if not specified.
Coordinates specified relative to the top-left of the page. The numbers
represent the x, y values of the polygon vertices, clockwise from the left
(-180 degrees inclusive) relative to the element orientation. Required."""
@overload
def __init__(
self,
*,
page_number: int,
polygon: List[float],
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class BuildDocumentClassifierRequest(_model_base.Model):
"""Request body to build a new custom document classifier.
All required parameters must be populated in order to send to server.
:ivar classifier_id: Unique document classifier name. Required.
:vartype classifier_id: str
:ivar description: Document classifier description.
:vartype description: str
:ivar base_classifier_id: Base classifierId on top of which to train the classifier.
:vartype base_classifier_id: str
:ivar doc_types: List of document types to classify against. Required.
:vartype doc_types: dict[str,
~azure.ai.documentintelligence.models.ClassifierDocumentTypeDetails]
"""
classifier_id: str = rest_field(name="classifierId")
"""Unique document classifier name. Required."""
description: Optional[str] = rest_field()
"""Document classifier description."""
base_classifier_id: Optional[str] = rest_field(name="baseClassifierId")
"""Base classifierId on top of which to train the classifier."""
doc_types: Dict[str, "_models.ClassifierDocumentTypeDetails"] = rest_field(name="docTypes")
"""List of document types to classify against. Required."""
@overload
def __init__(
self,
*,
classifier_id: str,
doc_types: Dict[str, "_models.ClassifierDocumentTypeDetails"],
description: Optional[str] = None,
base_classifier_id: Optional[str] = None,
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class BuildDocumentModelRequest(_model_base.Model):
"""Request body to build a new custom document model.
All required parameters must be populated in order to send to server.
:ivar model_id: Unique document model name. Required.
:vartype model_id: str
:ivar description: Document model description.
:vartype description: str
:ivar build_mode: Custom document model build mode. Required. Known values are: "template" and
"neural".
:vartype build_mode: str or ~azure.ai.documentintelligence.models.DocumentBuildMode
:ivar azure_blob_source: Azure Blob Storage location containing the training data. Either
azureBlobSource or azureBlobFileListSource must be specified.
:vartype azure_blob_source: ~azure.ai.documentintelligence.models.AzureBlobContentSource
:ivar azure_blob_file_list_source: Azure Blob Storage file list specifying the training data.
Either
azureBlobSource or azureBlobFileListSource must be specified.
:vartype azure_blob_file_list_source:
~azure.ai.documentintelligence.models.AzureBlobFileListContentSource
:ivar tags: List of key-value tag attributes associated with the document model.
:vartype tags: dict[str, str]
"""
model_id: str = rest_field(name="modelId")
"""Unique document model name. Required."""
description: Optional[str] = rest_field()
"""Document model description."""
build_mode: Union[str, "_models.DocumentBuildMode"] = rest_field(name="buildMode")
"""Custom document model build mode. Required. Known values are: \"template\" and \"neural\"."""
azure_blob_source: Optional["_models.AzureBlobContentSource"] = rest_field(name="azureBlobSource")
"""Azure Blob Storage location containing the training data. Either
azureBlobSource or azureBlobFileListSource must be specified."""
azure_blob_file_list_source: Optional["_models.AzureBlobFileListContentSource"] = rest_field(
name="azureBlobFileListSource"
)
"""Azure Blob Storage file list specifying the training data. Either
azureBlobSource or azureBlobFileListSource must be specified."""
tags: Optional[Dict[str, str]] = rest_field()
"""List of key-value tag attributes associated with the document model."""
@overload
def __init__(
self,
*,
model_id: str,
build_mode: Union[str, "_models.DocumentBuildMode"],
description: Optional[str] = None,
azure_blob_source: Optional["_models.AzureBlobContentSource"] = None,
azure_blob_file_list_source: Optional["_models.AzureBlobFileListContentSource"] = None,
tags: Optional[Dict[str, str]] = None,
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class ClassifierDocumentTypeDetails(_model_base.Model):
"""Classifier document type info.
:ivar source_kind: Type of training data source. Known values are: "url", "base64",
"azureBlob", and "azureBlobFileList".
:vartype source_kind: str or ~azure.ai.documentintelligence.models.ContentSourceKind
:ivar azure_blob_source: Azure Blob Storage location containing the training data for a
classifier
document type. Either azureBlobSource or azureBlobFileListSource must be
specified.
:vartype azure_blob_source: ~azure.ai.documentintelligence.models.AzureBlobContentSource
:ivar azure_blob_file_list_source: Azure Blob Storage file list specifying the training data
for a classifier
document type. Either azureBlobSource or azureBlobFileListSource must be
specified.
:vartype azure_blob_file_list_source:
~azure.ai.documentintelligence.models.AzureBlobFileListContentSource
"""
source_kind: Optional[Union[str, "_models.ContentSourceKind"]] = rest_field(name="sourceKind")
"""Type of training data source. Known values are: \"url\", \"base64\", \"azureBlob\", and
\"azureBlobFileList\"."""
azure_blob_source: Optional["_models.AzureBlobContentSource"] = rest_field(name="azureBlobSource")
"""Azure Blob Storage location containing the training data for a classifier
document type. Either azureBlobSource or azureBlobFileListSource must be
specified."""
azure_blob_file_list_source: Optional["_models.AzureBlobFileListContentSource"] = rest_field(
name="azureBlobFileListSource"
)
"""Azure Blob Storage file list specifying the training data for a classifier
document type. Either azureBlobSource or azureBlobFileListSource must be
specified."""
@overload
def __init__(
self,
*,
source_kind: Optional[Union[str, "_models.ContentSourceKind"]] = None,
azure_blob_source: Optional["_models.AzureBlobContentSource"] = None,
azure_blob_file_list_source: Optional["_models.AzureBlobFileListContentSource"] = None,
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class ClassifyDocumentRequest(_model_base.Model):
"""Document classification parameters.
:ivar url_source: Document URL to classify. Either urlSource or base64Source must be
specified.
:vartype url_source: str
:ivar bytes_source: Base64 encoding of the document to classify. Either urlSource or
base64Source
must be specified.
:vartype bytes_source: bytes
"""
url_source: Optional[str] = rest_field(name="urlSource")
"""Document URL to classify. Either urlSource or base64Source must be specified."""
bytes_source: Optional[bytes] = rest_field(name="base64Source", format="base64")
"""Base64 encoding of the document to classify. Either urlSource or base64Source
must be specified."""
@overload
def __init__(
self,
*,
url_source: Optional[str] = None,
bytes_source: Optional[bytes] = None,
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class ComponentDocumentModelDetails(_model_base.Model):
"""A component of a composed document model.
All required parameters must be populated in order to send to server.
:ivar model_id: Unique document model name. Required.
:vartype model_id: str
"""
model_id: str = rest_field(name="modelId")
"""Unique document model name. Required."""
@overload
def __init__(
self,
*,
model_id: str,
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class ComposeDocumentModelRequest(_model_base.Model):
"""Request body to create a composed document model from component document models.
All required parameters must be populated in order to send to server.
:ivar model_id: Unique document model name. Required.
:vartype model_id: str
:ivar description: Document model description.
:vartype description: str
:ivar component_models: List of component document models to compose. Required.
:vartype component_models:
list[~azure.ai.documentintelligence.models.ComponentDocumentModelDetails]
:ivar tags: List of key-value tag attributes associated with the document model.
:vartype tags: dict[str, str]
"""
model_id: str = rest_field(name="modelId")
"""Unique document model name. Required."""
description: Optional[str] = rest_field()
"""Document model description."""
component_models: List["_models.ComponentDocumentModelDetails"] = rest_field(name="componentModels")
"""List of component document models to compose. Required."""
tags: Optional[Dict[str, str]] = rest_field()
"""List of key-value tag attributes associated with the document model."""
@overload
def __init__(
self,
*,
model_id: str,
component_models: List["_models.ComponentDocumentModelDetails"],
description: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class CopyAuthorization(_model_base.Model):
"""Authorization to copy a document model to the specified target resource and
modelId.
All required parameters must be populated in order to send to server.
:ivar target_resource_id: ID of the target Azure resource where the document model should be
copied to. Required.
:vartype target_resource_id: str
:ivar target_resource_region: Location of the target Azure resource where the document model
should be copied
to. Required.
:vartype target_resource_region: str
:ivar target_model_id: Identifier of the target document model. Required.
:vartype target_model_id: str
:ivar target_model_location: URL of the copied document model in the target account. Required.
:vartype target_model_location: str
:ivar access_token: Token used to authorize the request. Required.
:vartype access_token: str
:ivar expiration_date_time: Date/time when the access token expires. Required.
:vartype expiration_date_time: ~datetime.datetime
"""
target_resource_id: str = rest_field(name="targetResourceId")
"""ID of the target Azure resource where the document model should be copied to. Required."""
target_resource_region: str = rest_field(name="targetResourceRegion")
"""Location of the target Azure resource where the document model should be copied
to. Required."""
target_model_id: str = rest_field(name="targetModelId")
"""Identifier of the target document model. Required."""
target_model_location: str = rest_field(name="targetModelLocation")
"""URL of the copied document model in the target account. Required."""
access_token: str = rest_field(name="accessToken")
"""Token used to authorize the request. Required."""
expiration_date_time: datetime.datetime = rest_field(name="expirationDateTime", format="rfc3339")
"""Date/time when the access token expires. Required."""
@overload
def __init__(
self,
*,
target_resource_id: str,
target_resource_region: str,
target_model_id: str,
target_model_location: str,
access_token: str,
expiration_date_time: datetime.datetime,
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class CurrencyValue(_model_base.Model):
"""Currency field value.
All required parameters must be populated in order to send to server.
:ivar amount: Currency amount. Required.
:vartype amount: float
:ivar currency_symbol: Currency symbol label, if any.
:vartype currency_symbol: str
:ivar currency_code: Resolved currency code (ISO 4217), if any.
:vartype currency_code: str
"""
amount: float = rest_field()
"""Currency amount. Required."""
currency_symbol: Optional[str] = rest_field(name="currencySymbol")
"""Currency symbol label, if any."""
currency_code: Optional[str] = rest_field(name="currencyCode")
"""Resolved currency code (ISO 4217), if any."""
@overload
def __init__(
self,
*,
amount: float,
currency_symbol: Optional[str] = None,
currency_code: Optional[str] = None,
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class CustomDocumentModelsDetails(_model_base.Model):
"""Details regarding custom document models.
All required parameters must be populated in order to send to server.
:ivar count: Number of custom document models in the current resource. Required.
:vartype count: int
:ivar limit: Maximum number of custom document models supported in the current resource.
Required.
:vartype limit: int
"""
count: int = rest_field()
"""Number of custom document models in the current resource. Required."""
limit: int = rest_field()
"""Maximum number of custom document models supported in the current resource. Required."""
@overload
def __init__(
self,
*,
count: int,
limit: int,
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class Document(_model_base.Model):
"""An object describing the location and semantic content of a document.
All required parameters must be populated in order to send to server.
:ivar doc_type: Document type. Required.
:vartype doc_type: str
:ivar bounding_regions: Bounding regions covering the document.
:vartype bounding_regions: list[~azure.ai.documentintelligence.models.BoundingRegion]
:ivar spans: Location of the document in the reading order concatenated content. Required.
:vartype spans: list[~azure.ai.documentintelligence.models.DocumentSpan]
:ivar fields: Dictionary of named field values.
:vartype fields: dict[str, ~azure.ai.documentintelligence.models.DocumentField]
:ivar confidence: Confidence of correctly extracting the document. Required.
:vartype confidence: float
"""
doc_type: str = rest_field(name="docType")
"""Document type. Required."""
bounding_regions: Optional[List["_models.BoundingRegion"]] = rest_field(name="boundingRegions")
"""Bounding regions covering the document."""
spans: List["_models.DocumentSpan"] = rest_field()
"""Location of the document in the reading order concatenated content. Required."""
fields: Optional[Dict[str, "_models.DocumentField"]] = rest_field()
"""Dictionary of named field values."""
confidence: float = rest_field()
"""Confidence of correctly extracting the document. Required."""
@overload
def __init__(
self,
*,
doc_type: str,
spans: List["_models.DocumentSpan"],
confidence: float,
bounding_regions: Optional[List["_models.BoundingRegion"]] = None,
fields: Optional[Dict[str, "_models.DocumentField"]] = None,
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""
def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)
class DocumentBarcode(_model_base.Model):
"""A barcode object.
All required parameters must be populated in order to send to server.
:ivar kind: Barcode kind. Required. Known values are: "QRCode", "PDF417", "UPCA", "UPCE",
"Code39", "Code128", "EAN8", "EAN13", "DataBar", "Code93", "Codabar", "DataBarExpanded", "ITF",
"MicroQRCode", "Aztec", "DataMatrix", and "MaxiCode".
:vartype kind: str or ~azure.ai.documentintelligence.models.DocumentBarcodeKind
:ivar value: Barcode value. Required.
:vartype value: str
:ivar polygon: Bounding polygon of the barcode, with coordinates specified relative to the
top-left of the page. The numbers represent the x, y values of the polygon
vertices, clockwise from the left (-180 degrees inclusive) relative to the
element orientation.
:vartype polygon: list[float]
:ivar span: Location of the barcode in the reading order concatenated content. Required.
:vartype span: ~azure.ai.documentintelligence.models.DocumentSpan
:ivar confidence: Confidence of correctly extracting the barcode. Required.
:vartype confidence: float
"""
kind: Union[str, "_models.DocumentBarcodeKind"] = rest_field()
"""Barcode kind. Required. Known values are: \"QRCode\", \"PDF417\", \"UPCA\", \"UPCE\",
\"Code39\", \"Code128\", \"EAN8\", \"EAN13\", \"DataBar\", \"Code93\", \"Codabar\",
\"DataBarExpanded\", \"ITF\", \"MicroQRCode\", \"Aztec\", \"DataMatrix\", and \"MaxiCode\"."""
value: str = rest_field()
"""Barcode value. Required."""
polygon: Optional[List[float]] = rest_field()
"""Bounding polygon of the barcode, with coordinates specified relative to the
top-left of the page. The numbers represent the x, y values of the polygon
vertices, clockwise from the left (-180 degrees inclusive) relative to the
element orientation."""
span: "_models.DocumentSpan" = rest_field()
"""Location of the barcode in the reading order concatenated content. Required."""
confidence: float = rest_field()
"""Confidence of correctly extracting the barcode. Required."""
@overload
def __init__(
self,
*,
kind: Union[str, "_models.DocumentBarcodeKind"],
value: str,
span: "_models.DocumentSpan",
confidence: float,
polygon: Optional[List[float]] = None,
):
...
@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""