File: _models_py3.py

package info (click to toggle)
python-azure 20230112%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 749,544 kB
  • sloc: python: 6,815,827; javascript: 287; makefile: 195; xml: 109; sh: 105
file content (2020 lines) | stat: -rw-r--r-- 87,957 bytes parent folder | download
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
# 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) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

import datetime
import sys
from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union

from .. import _serialization

if sys.version_info >= (3, 9):
    from collections.abc import MutableMapping
else:
    from typing import MutableMapping  # type: ignore  # pylint: disable=ungrouped-imports

if TYPE_CHECKING:
    # pylint: disable=unused-import,ungrouped-imports
    from .. import models as _models
JSON = MutableMapping[str, Any]  # pylint: disable=unsubscriptable-object


class CloudErrorBody(_serialization.Model):
    """An error response from the Azure VM Image Builder service.

    :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed
     programmatically.
    :vartype code: str
    :ivar message: A message describing the error, intended to be suitable for display in a user
     interface.
    :vartype message: str
    :ivar target: The target of the particular error. For example, the name of the property in
     error.
    :vartype target: str
    :ivar details: A list of additional details about the error.
    :vartype details: list[~azure.mgmt.imagebuilder.models.CloudErrorBody]
    """

    _attribute_map = {
        "code": {"key": "code", "type": "str"},
        "message": {"key": "message", "type": "str"},
        "target": {"key": "target", "type": "str"},
        "details": {"key": "details", "type": "[CloudErrorBody]"},
    }

    def __init__(
        self,
        *,
        code: Optional[str] = None,
        message: Optional[str] = None,
        target: Optional[str] = None,
        details: Optional[List["_models.CloudErrorBody"]] = None,
        **kwargs
    ):
        """
        :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed
         programmatically.
        :paramtype code: str
        :keyword message: A message describing the error, intended to be suitable for display in a user
         interface.
        :paramtype message: str
        :keyword target: The target of the particular error. For example, the name of the property in
         error.
        :paramtype target: str
        :keyword details: A list of additional details about the error.
        :paramtype details: list[~azure.mgmt.imagebuilder.models.CloudErrorBody]
        """
        super().__init__(**kwargs)
        self.code = code
        self.message = message
        self.target = target
        self.details = details


class ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties(
    _serialization.Model
):
    """ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties.

    Variables are only populated by the server, and will be ignored when sending a request.

    :ivar principal_id: The principal id of user assigned identity.
    :vartype principal_id: str
    :ivar client_id: The client id of user assigned identity.
    :vartype client_id: str
    """

    _validation = {
        "principal_id": {"readonly": True},
        "client_id": {"readonly": True},
    }

    _attribute_map = {
        "principal_id": {"key": "principalId", "type": "str"},
        "client_id": {"key": "clientId", "type": "str"},
    }

    def __init__(self, **kwargs):
        """ """
        super().__init__(**kwargs)
        self.principal_id = None
        self.client_id = None


class Resource(_serialization.Model):
    """Common fields that are returned in the response for all Azure Resource Manager resources.

    Variables are only populated by the server, and will be ignored when sending a request.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.imagebuilder.models.SystemData
    """

    _validation = {
        "id": {"readonly": True},
        "name": {"readonly": True},
        "type": {"readonly": True},
        "system_data": {"readonly": True},
    }

    _attribute_map = {
        "id": {"key": "id", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "type": {"key": "type", "type": "str"},
        "system_data": {"key": "systemData", "type": "SystemData"},
    }

    def __init__(self, **kwargs):
        """ """
        super().__init__(**kwargs)
        self.id = None
        self.name = None
        self.type = None
        self.system_data = None


class TrackedResource(Resource):
    """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'.

    Variables are only populated by the server, and will be ignored when sending a request.

    All required parameters must be populated in order to send to Azure.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.imagebuilder.models.SystemData
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar location: The geo-location where the resource lives. Required.
    :vartype location: str
    """

    _validation = {
        "id": {"readonly": True},
        "name": {"readonly": True},
        "type": {"readonly": True},
        "system_data": {"readonly": True},
        "location": {"required": True},
    }

    _attribute_map = {
        "id": {"key": "id", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "type": {"key": "type", "type": "str"},
        "system_data": {"key": "systemData", "type": "SystemData"},
        "tags": {"key": "tags", "type": "{str}"},
        "location": {"key": "location", "type": "str"},
    }

    def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs):
        """
        :keyword tags: Resource tags.
        :paramtype tags: dict[str, str]
        :keyword location: The geo-location where the resource lives. Required.
        :paramtype location: str
        """
        super().__init__(**kwargs)
        self.tags = tags
        self.location = location


class ImageTemplate(TrackedResource):  # pylint: disable=too-many-instance-attributes
    """Image template is an ARM resource managed by Microsoft.VirtualMachineImages provider.

    Variables are only populated by the server, and will be ignored when sending a request.

    All required parameters must be populated in order to send to Azure.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.imagebuilder.models.SystemData
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar location: The geo-location where the resource lives. Required.
    :vartype location: str
    :ivar identity: The identity of the image template, if configured. Required.
    :vartype identity: ~azure.mgmt.imagebuilder.models.ImageTemplateIdentity
    :ivar source: Specifies the properties used to describe the source image.
    :vartype source: ~azure.mgmt.imagebuilder.models.ImageTemplateSource
    :ivar customize: Specifies the properties used to describe the customization steps of the
     image, like Image source etc.
    :vartype customize: list[~azure.mgmt.imagebuilder.models.ImageTemplateCustomizer]
    :ivar validate: Configuration options and list of validations to be performed on the resulting
     image.
    :vartype validate: ~azure.mgmt.imagebuilder.models.ImageTemplatePropertiesValidate
    :ivar distribute: The distribution targets where the image output needs to go to.
    :vartype distribute: list[~azure.mgmt.imagebuilder.models.ImageTemplateDistributor]
    :ivar provisioning_state: Provisioning state of the resource. Known values are: "Creating",
     "Updating", "Succeeded", "Failed", and "Deleting".
    :vartype provisioning_state: str or ~azure.mgmt.imagebuilder.models.ProvisioningState
    :ivar provisioning_error: Provisioning error, if any.
    :vartype provisioning_error: ~azure.mgmt.imagebuilder.models.ProvisioningError
    :ivar last_run_status: State of 'run' that is currently executing or was last executed.
    :vartype last_run_status: ~azure.mgmt.imagebuilder.models.ImageTemplateLastRunStatus
    :ivar build_timeout_in_minutes: Maximum duration to wait while building the image template
     (includes all customizations, validations, and distributions). Omit or specify 0 to use the
     default (4 hours).
    :vartype build_timeout_in_minutes: int
    :ivar vm_profile: Describes how virtual machine is set up to build images.
    :vartype vm_profile: ~azure.mgmt.imagebuilder.models.ImageTemplateVmProfile
    :ivar staging_resource_group: The staging resource group id in the same subscription as the
     image template that will be used to build the image. If this field is empty, a resource group
     with a random name will be created. If the resource group specified in this field doesn't
     exist, it will be created with the same name. If the resource group specified exists, it must
     be empty and in the same region as the image template. The resource group created will be
     deleted during template deletion if this field is empty or the resource group specified doesn't
     exist, but if the resource group specified exists the resources created in the resource group
     will be deleted during template deletion and the resource group itself will remain.
    :vartype staging_resource_group: str
    :ivar exact_staging_resource_group: The staging resource group id in the same subscription as
     the image template that will be used to build the image. This read-only field differs from
     'stagingResourceGroup' only if the value specified in the 'stagingResourceGroup' field is
     empty.
    :vartype exact_staging_resource_group: str
    """

    _validation = {
        "id": {"readonly": True},
        "name": {"readonly": True},
        "type": {"readonly": True},
        "system_data": {"readonly": True},
        "location": {"required": True},
        "identity": {"required": True},
        "provisioning_state": {"readonly": True},
        "provisioning_error": {"readonly": True},
        "last_run_status": {"readonly": True},
        "build_timeout_in_minutes": {"maximum": 960, "minimum": 0},
        "exact_staging_resource_group": {"readonly": True},
    }

    _attribute_map = {
        "id": {"key": "id", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "type": {"key": "type", "type": "str"},
        "system_data": {"key": "systemData", "type": "SystemData"},
        "tags": {"key": "tags", "type": "{str}"},
        "location": {"key": "location", "type": "str"},
        "identity": {"key": "identity", "type": "ImageTemplateIdentity"},
        "source": {"key": "properties.source", "type": "ImageTemplateSource"},
        "customize": {"key": "properties.customize", "type": "[ImageTemplateCustomizer]"},
        "validate": {"key": "properties.validate", "type": "ImageTemplatePropertiesValidate"},
        "distribute": {"key": "properties.distribute", "type": "[ImageTemplateDistributor]"},
        "provisioning_state": {"key": "properties.provisioningState", "type": "str"},
        "provisioning_error": {"key": "properties.provisioningError", "type": "ProvisioningError"},
        "last_run_status": {"key": "properties.lastRunStatus", "type": "ImageTemplateLastRunStatus"},
        "build_timeout_in_minutes": {"key": "properties.buildTimeoutInMinutes", "type": "int"},
        "vm_profile": {"key": "properties.vmProfile", "type": "ImageTemplateVmProfile"},
        "staging_resource_group": {"key": "properties.stagingResourceGroup", "type": "str"},
        "exact_staging_resource_group": {"key": "properties.exactStagingResourceGroup", "type": "str"},
    }

    def __init__(
        self,
        *,
        location: str,
        identity: "_models.ImageTemplateIdentity",
        tags: Optional[Dict[str, str]] = None,
        source: Optional["_models.ImageTemplateSource"] = None,
        customize: Optional[List["_models.ImageTemplateCustomizer"]] = None,
        validate: Optional["_models.ImageTemplatePropertiesValidate"] = None,
        distribute: Optional[List["_models.ImageTemplateDistributor"]] = None,
        build_timeout_in_minutes: int = 0,
        vm_profile: Optional["_models.ImageTemplateVmProfile"] = None,
        staging_resource_group: Optional[str] = None,
        **kwargs
    ):
        """
        :keyword tags: Resource tags.
        :paramtype tags: dict[str, str]
        :keyword location: The geo-location where the resource lives. Required.
        :paramtype location: str
        :keyword identity: The identity of the image template, if configured. Required.
        :paramtype identity: ~azure.mgmt.imagebuilder.models.ImageTemplateIdentity
        :keyword source: Specifies the properties used to describe the source image.
        :paramtype source: ~azure.mgmt.imagebuilder.models.ImageTemplateSource
        :keyword customize: Specifies the properties used to describe the customization steps of the
         image, like Image source etc.
        :paramtype customize: list[~azure.mgmt.imagebuilder.models.ImageTemplateCustomizer]
        :keyword validate: Configuration options and list of validations to be performed on the
         resulting image.
        :paramtype validate: ~azure.mgmt.imagebuilder.models.ImageTemplatePropertiesValidate
        :keyword distribute: The distribution targets where the image output needs to go to.
        :paramtype distribute: list[~azure.mgmt.imagebuilder.models.ImageTemplateDistributor]
        :keyword build_timeout_in_minutes: Maximum duration to wait while building the image template
         (includes all customizations, validations, and distributions). Omit or specify 0 to use the
         default (4 hours).
        :paramtype build_timeout_in_minutes: int
        :keyword vm_profile: Describes how virtual machine is set up to build images.
        :paramtype vm_profile: ~azure.mgmt.imagebuilder.models.ImageTemplateVmProfile
        :keyword staging_resource_group: The staging resource group id in the same subscription as the
         image template that will be used to build the image. If this field is empty, a resource group
         with a random name will be created. If the resource group specified in this field doesn't
         exist, it will be created with the same name. If the resource group specified exists, it must
         be empty and in the same region as the image template. The resource group created will be
         deleted during template deletion if this field is empty or the resource group specified doesn't
         exist, but if the resource group specified exists the resources created in the resource group
         will be deleted during template deletion and the resource group itself will remain.
        :paramtype staging_resource_group: str
        """
        super().__init__(tags=tags, location=location, **kwargs)
        self.identity = identity
        self.source = source
        self.customize = customize
        self.validate = validate
        self.distribute = distribute
        self.provisioning_state = None
        self.provisioning_error = None
        self.last_run_status = None
        self.build_timeout_in_minutes = build_timeout_in_minutes
        self.vm_profile = vm_profile
        self.staging_resource_group = staging_resource_group
        self.exact_staging_resource_group = None


class ImageTemplateCustomizer(_serialization.Model):
    """Describes a unit of image customization.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    ImageTemplateFileCustomizer, ImageTemplatePowerShellCustomizer, ImageTemplateShellCustomizer,
    ImageTemplateRestartCustomizer, ImageTemplateWindowsUpdateCustomizer

    All required parameters must be populated in order to send to Azure.

    :ivar type: The type of customization tool you want to use on the Image. For example, "Shell"
     can be shell customizer. Required.
    :vartype type: str
    :ivar name: Friendly Name to provide context on what this customization step does.
    :vartype name: str
    """

    _validation = {
        "type": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "name": {"key": "name", "type": "str"},
    }

    _subtype_map = {
        "type": {
            "File": "ImageTemplateFileCustomizer",
            "PowerShell": "ImageTemplatePowerShellCustomizer",
            "Shell": "ImageTemplateShellCustomizer",
            "WindowsRestart": "ImageTemplateRestartCustomizer",
            "WindowsUpdate": "ImageTemplateWindowsUpdateCustomizer",
        }
    }

    def __init__(self, *, name: Optional[str] = None, **kwargs):
        """
        :keyword name: Friendly Name to provide context on what this customization step does.
        :paramtype name: str
        """
        super().__init__(**kwargs)
        self.type: Optional[str] = None
        self.name = name


class ImageTemplateDistributor(_serialization.Model):
    """Generic distribution object.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    ImageTemplateManagedImageDistributor, ImageTemplateSharedImageDistributor,
    ImageTemplateVhdDistributor

    All required parameters must be populated in order to send to Azure.

    :ivar type: Type of distribution. Required.
    :vartype type: str
    :ivar run_output_name: The name to be used for the associated RunOutput. Required.
    :vartype run_output_name: str
    :ivar artifact_tags: Tags that will be applied to the artifact once it has been created/updated
     by the distributor.
    :vartype artifact_tags: dict[str, str]
    """

    _validation = {
        "type": {"required": True},
        "run_output_name": {"required": True, "pattern": r"^[A-Za-z0-9-_.]{1,64}$"},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "run_output_name": {"key": "runOutputName", "type": "str"},
        "artifact_tags": {"key": "artifactTags", "type": "{str}"},
    }

    _subtype_map = {
        "type": {
            "ManagedImage": "ImageTemplateManagedImageDistributor",
            "SharedImage": "ImageTemplateSharedImageDistributor",
            "VHD": "ImageTemplateVhdDistributor",
        }
    }

    def __init__(self, *, run_output_name: str, artifact_tags: Optional[Dict[str, str]] = None, **kwargs):
        """
        :keyword run_output_name: The name to be used for the associated RunOutput. Required.
        :paramtype run_output_name: str
        :keyword artifact_tags: Tags that will be applied to the artifact once it has been
         created/updated by the distributor.
        :paramtype artifact_tags: dict[str, str]
        """
        super().__init__(**kwargs)
        self.type: Optional[str] = None
        self.run_output_name = run_output_name
        self.artifact_tags = artifact_tags


class ImageTemplateFileCustomizer(ImageTemplateCustomizer):
    """Uploads files to VMs (Linux, Windows). Corresponds to Packer file provisioner.

    All required parameters must be populated in order to send to Azure.

    :ivar type: The type of customization tool you want to use on the Image. For example, "Shell"
     can be shell customizer. Required.
    :vartype type: str
    :ivar name: Friendly Name to provide context on what this customization step does.
    :vartype name: str
    :ivar source_uri: The URI of the file to be uploaded for customizing the VM. It can be a github
     link, SAS URI for Azure Storage, etc.
    :vartype source_uri: str
    :ivar sha256_checksum: SHA256 checksum of the file provided in the sourceUri field above.
    :vartype sha256_checksum: str
    :ivar destination: The absolute path to a file (with nested directory structures already
     created) where the file (from sourceUri) will be uploaded to in the VM.
    :vartype destination: str
    """

    _validation = {
        "type": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "source_uri": {"key": "sourceUri", "type": "str"},
        "sha256_checksum": {"key": "sha256Checksum", "type": "str"},
        "destination": {"key": "destination", "type": "str"},
    }

    def __init__(
        self,
        *,
        name: Optional[str] = None,
        source_uri: Optional[str] = None,
        sha256_checksum: str = "",
        destination: Optional[str] = None,
        **kwargs
    ):
        """
        :keyword name: Friendly Name to provide context on what this customization step does.
        :paramtype name: str
        :keyword source_uri: The URI of the file to be uploaded for customizing the VM. It can be a
         github link, SAS URI for Azure Storage, etc.
        :paramtype source_uri: str
        :keyword sha256_checksum: SHA256 checksum of the file provided in the sourceUri field above.
        :paramtype sha256_checksum: str
        :keyword destination: The absolute path to a file (with nested directory structures already
         created) where the file (from sourceUri) will be uploaded to in the VM.
        :paramtype destination: str
        """
        super().__init__(name=name, **kwargs)
        self.type: str = "File"
        self.source_uri = source_uri
        self.sha256_checksum = sha256_checksum
        self.destination = destination


class ImageTemplateIdentity(_serialization.Model):
    """Identity for the image template.

    :ivar type: The type of identity used for the image template. The type 'None' will remove any
     identities from the image template. Known values are: "UserAssigned" and "None".
    :vartype type: str or ~azure.mgmt.imagebuilder.models.ResourceIdentityType
    :ivar user_assigned_identities: The list of user identities associated with the image template.
     The user identity dictionary key references will be ARM resource ids in the form:
     '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
    :vartype user_assigned_identities: dict[str,
     ~azure.mgmt.imagebuilder.models.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties]
    """

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "user_assigned_identities": {
            "key": "userAssignedIdentities",
            "type": "{ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties}",
        },
    }

    def __init__(
        self,
        *,
        type: Optional[Union[str, "_models.ResourceIdentityType"]] = None,
        user_assigned_identities: Optional[
            Dict[
                str,
                "_models.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties",
            ]
        ] = None,
        **kwargs
    ):
        """
        :keyword type: The type of identity used for the image template. The type 'None' will remove
         any identities from the image template. Known values are: "UserAssigned" and "None".
        :paramtype type: str or ~azure.mgmt.imagebuilder.models.ResourceIdentityType
        :keyword user_assigned_identities: The list of user identities associated with the image
         template. The user identity dictionary key references will be ARM resource ids in the form:
         '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
        :paramtype user_assigned_identities: dict[str,
         ~azure.mgmt.imagebuilder.models.ComponentsVrq145SchemasImagetemplateidentityPropertiesUserassignedidentitiesAdditionalproperties]
        """
        super().__init__(**kwargs)
        self.type = type
        self.user_assigned_identities = user_assigned_identities


class ImageTemplateInVMValidator(_serialization.Model):
    """Describes a unit of in-VM validation of image.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    ImageTemplatePowerShellValidator, ImageTemplateShellValidator

    All required parameters must be populated in order to send to Azure.

    :ivar type: The type of validation you want to use on the Image. For example, "Shell" can be
     shell validation. Required.
    :vartype type: str
    :ivar name: Friendly Name to provide context on what this validation step does.
    :vartype name: str
    """

    _validation = {
        "type": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "name": {"key": "name", "type": "str"},
    }

    _subtype_map = {"type": {"PowerShell": "ImageTemplatePowerShellValidator", "Shell": "ImageTemplateShellValidator"}}

    def __init__(self, *, name: Optional[str] = None, **kwargs):
        """
        :keyword name: Friendly Name to provide context on what this validation step does.
        :paramtype name: str
        """
        super().__init__(**kwargs)
        self.type: Optional[str] = None
        self.name = name


class ImageTemplateLastRunStatus(_serialization.Model):
    """Describes the latest status of running an image template.

    :ivar start_time: Start time of the last run (UTC).
    :vartype start_time: ~datetime.datetime
    :ivar end_time: End time of the last run (UTC).
    :vartype end_time: ~datetime.datetime
    :ivar run_state: State of the last run. Known values are: "Running", "Canceling", "Succeeded",
     "PartiallySucceeded", "Failed", and "Canceled".
    :vartype run_state: str or ~azure.mgmt.imagebuilder.models.RunState
    :ivar run_sub_state: Sub-state of the last run. Known values are: "Queued", "Building",
     "Customizing", "Validating", and "Distributing".
    :vartype run_sub_state: str or ~azure.mgmt.imagebuilder.models.RunSubState
    :ivar message: Verbose information about the last run state.
    :vartype message: str
    """

    _attribute_map = {
        "start_time": {"key": "startTime", "type": "iso-8601"},
        "end_time": {"key": "endTime", "type": "iso-8601"},
        "run_state": {"key": "runState", "type": "str"},
        "run_sub_state": {"key": "runSubState", "type": "str"},
        "message": {"key": "message", "type": "str"},
    }

    def __init__(
        self,
        *,
        start_time: Optional[datetime.datetime] = None,
        end_time: Optional[datetime.datetime] = None,
        run_state: Optional[Union[str, "_models.RunState"]] = None,
        run_sub_state: Optional[Union[str, "_models.RunSubState"]] = None,
        message: Optional[str] = None,
        **kwargs
    ):
        """
        :keyword start_time: Start time of the last run (UTC).
        :paramtype start_time: ~datetime.datetime
        :keyword end_time: End time of the last run (UTC).
        :paramtype end_time: ~datetime.datetime
        :keyword run_state: State of the last run. Known values are: "Running", "Canceling",
         "Succeeded", "PartiallySucceeded", "Failed", and "Canceled".
        :paramtype run_state: str or ~azure.mgmt.imagebuilder.models.RunState
        :keyword run_sub_state: Sub-state of the last run. Known values are: "Queued", "Building",
         "Customizing", "Validating", and "Distributing".
        :paramtype run_sub_state: str or ~azure.mgmt.imagebuilder.models.RunSubState
        :keyword message: Verbose information about the last run state.
        :paramtype message: str
        """
        super().__init__(**kwargs)
        self.start_time = start_time
        self.end_time = end_time
        self.run_state = run_state
        self.run_sub_state = run_sub_state
        self.message = message


class ImageTemplateListResult(_serialization.Model):
    """The result of List image templates operation.

    :ivar value: An array of image templates.
    :vartype value: list[~azure.mgmt.imagebuilder.models.ImageTemplate]
    :ivar next_link: The continuation token.
    :vartype next_link: str
    """

    _attribute_map = {
        "value": {"key": "value", "type": "[ImageTemplate]"},
        "next_link": {"key": "nextLink", "type": "str"},
    }

    def __init__(
        self, *, value: Optional[List["_models.ImageTemplate"]] = None, next_link: Optional[str] = None, **kwargs
    ):
        """
        :keyword value: An array of image templates.
        :paramtype value: list[~azure.mgmt.imagebuilder.models.ImageTemplate]
        :keyword next_link: The continuation token.
        :paramtype next_link: str
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link = next_link


class ImageTemplateManagedImageDistributor(ImageTemplateDistributor):
    """Distribute as a Managed Disk Image.

    All required parameters must be populated in order to send to Azure.

    :ivar type: Type of distribution. Required.
    :vartype type: str
    :ivar run_output_name: The name to be used for the associated RunOutput. Required.
    :vartype run_output_name: str
    :ivar artifact_tags: Tags that will be applied to the artifact once it has been created/updated
     by the distributor.
    :vartype artifact_tags: dict[str, str]
    :ivar image_id: Resource Id of the Managed Disk Image. Required.
    :vartype image_id: str
    :ivar location: Azure location for the image, should match if image already exists. Required.
    :vartype location: str
    """

    _validation = {
        "type": {"required": True},
        "run_output_name": {"required": True, "pattern": r"^[A-Za-z0-9-_.]{1,64}$"},
        "image_id": {"required": True},
        "location": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "run_output_name": {"key": "runOutputName", "type": "str"},
        "artifact_tags": {"key": "artifactTags", "type": "{str}"},
        "image_id": {"key": "imageId", "type": "str"},
        "location": {"key": "location", "type": "str"},
    }

    def __init__(
        self,
        *,
        run_output_name: str,
        image_id: str,
        location: str,
        artifact_tags: Optional[Dict[str, str]] = None,
        **kwargs
    ):
        """
        :keyword run_output_name: The name to be used for the associated RunOutput. Required.
        :paramtype run_output_name: str
        :keyword artifact_tags: Tags that will be applied to the artifact once it has been
         created/updated by the distributor.
        :paramtype artifact_tags: dict[str, str]
        :keyword image_id: Resource Id of the Managed Disk Image. Required.
        :paramtype image_id: str
        :keyword location: Azure location for the image, should match if image already exists.
         Required.
        :paramtype location: str
        """
        super().__init__(run_output_name=run_output_name, artifact_tags=artifact_tags, **kwargs)
        self.type: str = "ManagedImage"
        self.image_id = image_id
        self.location = location


class ImageTemplateSource(_serialization.Model):
    """Describes a virtual machine image source for building, customizing and distributing.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    ImageTemplateManagedImageSource, ImageTemplatePlatformImageSource,
    ImageTemplateSharedImageVersionSource

    All required parameters must be populated in order to send to Azure.

    :ivar type: Specifies the type of source image you want to start with. Required.
    :vartype type: str
    """

    _validation = {
        "type": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
    }

    _subtype_map = {
        "type": {
            "ManagedImage": "ImageTemplateManagedImageSource",
            "PlatformImage": "ImageTemplatePlatformImageSource",
            "SharedImageVersion": "ImageTemplateSharedImageVersionSource",
        }
    }

    def __init__(self, **kwargs):
        """ """
        super().__init__(**kwargs)
        self.type: Optional[str] = None


class ImageTemplateManagedImageSource(ImageTemplateSource):
    """Describes an image source that is a managed image in customer subscription. This image must reside in the same subscription and region as the Image Builder template.

    All required parameters must be populated in order to send to Azure.

    :ivar type: Specifies the type of source image you want to start with. Required.
    :vartype type: str
    :ivar image_id: ARM resource id of the managed image in customer subscription. Required.
    :vartype image_id: str
    """

    _validation = {
        "type": {"required": True},
        "image_id": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "image_id": {"key": "imageId", "type": "str"},
    }

    def __init__(self, *, image_id: str, **kwargs):
        """
        :keyword image_id: ARM resource id of the managed image in customer subscription. Required.
        :paramtype image_id: str
        """
        super().__init__(**kwargs)
        self.type: str = "ManagedImage"
        self.image_id = image_id


class ImageTemplatePlatformImageSource(ImageTemplateSource):
    """Describes an image source from `Azure Gallery Images <https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages>`_.

    Variables are only populated by the server, and will be ignored when sending a request.

    All required parameters must be populated in order to send to Azure.

    :ivar type: Specifies the type of source image you want to start with. Required.
    :vartype type: str
    :ivar publisher: Image Publisher in `Azure Gallery Images
     <https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages>`_.
    :vartype publisher: str
    :ivar offer: Image offer from the `Azure Gallery Images
     <https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages>`_.
    :vartype offer: str
    :ivar sku: Image sku from the `Azure Gallery Images
     <https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages>`_.
    :vartype sku: str
    :ivar version: Image version from the `Azure Gallery Images
     <https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages>`_. If 'latest' is
     specified here, the version is evaluated when the image build takes place, not when the
     template is submitted.
    :vartype version: str
    :ivar exact_version: Image version from the `Azure Gallery Images
     <https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages>`_. This readonly field
     differs from 'version', only if the value specified in 'version' field is 'latest'.
    :vartype exact_version: str
    :ivar plan_info: Optional configuration of purchase plan for platform image.
    :vartype plan_info: ~azure.mgmt.imagebuilder.models.PlatformImagePurchasePlan
    """

    _validation = {
        "type": {"required": True},
        "exact_version": {"readonly": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "publisher": {"key": "publisher", "type": "str"},
        "offer": {"key": "offer", "type": "str"},
        "sku": {"key": "sku", "type": "str"},
        "version": {"key": "version", "type": "str"},
        "exact_version": {"key": "exactVersion", "type": "str"},
        "plan_info": {"key": "planInfo", "type": "PlatformImagePurchasePlan"},
    }

    def __init__(
        self,
        *,
        publisher: Optional[str] = None,
        offer: Optional[str] = None,
        sku: Optional[str] = None,
        version: Optional[str] = None,
        plan_info: Optional["_models.PlatformImagePurchasePlan"] = None,
        **kwargs
    ):
        """
        :keyword publisher: Image Publisher in `Azure Gallery Images
         <https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages>`_.
        :paramtype publisher: str
        :keyword offer: Image offer from the `Azure Gallery Images
         <https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages>`_.
        :paramtype offer: str
        :keyword sku: Image sku from the `Azure Gallery Images
         <https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages>`_.
        :paramtype sku: str
        :keyword version: Image version from the `Azure Gallery Images
         <https://docs.microsoft.com/en-us/rest/api/compute/virtualmachineimages>`_. If 'latest' is
         specified here, the version is evaluated when the image build takes place, not when the
         template is submitted.
        :paramtype version: str
        :keyword plan_info: Optional configuration of purchase plan for platform image.
        :paramtype plan_info: ~azure.mgmt.imagebuilder.models.PlatformImagePurchasePlan
        """
        super().__init__(**kwargs)
        self.type: str = "PlatformImage"
        self.publisher = publisher
        self.offer = offer
        self.sku = sku
        self.version = version
        self.exact_version = None
        self.plan_info = plan_info


class ImageTemplatePowerShellCustomizer(ImageTemplateCustomizer):
    """Runs the specified PowerShell on the VM (Windows). Corresponds to Packer powershell provisioner. Exactly one of 'scriptUri' or 'inline' can be specified.

    All required parameters must be populated in order to send to Azure.

    :ivar type: The type of customization tool you want to use on the Image. For example, "Shell"
     can be shell customizer. Required.
    :vartype type: str
    :ivar name: Friendly Name to provide context on what this customization step does.
    :vartype name: str
    :ivar script_uri: URI of the PowerShell script to be run for customizing. It can be a github
     link, SAS URI for Azure Storage, etc.
    :vartype script_uri: str
    :ivar sha256_checksum: SHA256 checksum of the power shell script provided in the scriptUri
     field above.
    :vartype sha256_checksum: str
    :ivar inline: Array of PowerShell commands to execute.
    :vartype inline: list[str]
    :ivar run_elevated: If specified, the PowerShell script will be run with elevated privileges.
    :vartype run_elevated: bool
    :ivar run_as_system: If specified, the PowerShell script will be run with elevated privileges
     using the Local System user. Can only be true when the runElevated field above is set to true.
    :vartype run_as_system: bool
    :ivar valid_exit_codes: Valid exit codes for the PowerShell script. [Default: 0].
    :vartype valid_exit_codes: list[int]
    """

    _validation = {
        "type": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "script_uri": {"key": "scriptUri", "type": "str"},
        "sha256_checksum": {"key": "sha256Checksum", "type": "str"},
        "inline": {"key": "inline", "type": "[str]"},
        "run_elevated": {"key": "runElevated", "type": "bool"},
        "run_as_system": {"key": "runAsSystem", "type": "bool"},
        "valid_exit_codes": {"key": "validExitCodes", "type": "[int]"},
    }

    def __init__(
        self,
        *,
        name: Optional[str] = None,
        script_uri: Optional[str] = None,
        sha256_checksum: str = "",
        inline: Optional[List[str]] = None,
        run_elevated: bool = False,
        run_as_system: bool = False,
        valid_exit_codes: Optional[List[int]] = None,
        **kwargs
    ):
        """
        :keyword name: Friendly Name to provide context on what this customization step does.
        :paramtype name: str
        :keyword script_uri: URI of the PowerShell script to be run for customizing. It can be a github
         link, SAS URI for Azure Storage, etc.
        :paramtype script_uri: str
        :keyword sha256_checksum: SHA256 checksum of the power shell script provided in the scriptUri
         field above.
        :paramtype sha256_checksum: str
        :keyword inline: Array of PowerShell commands to execute.
        :paramtype inline: list[str]
        :keyword run_elevated: If specified, the PowerShell script will be run with elevated
         privileges.
        :paramtype run_elevated: bool
        :keyword run_as_system: If specified, the PowerShell script will be run with elevated
         privileges using the Local System user. Can only be true when the runElevated field above is
         set to true.
        :paramtype run_as_system: bool
        :keyword valid_exit_codes: Valid exit codes for the PowerShell script. [Default: 0].
        :paramtype valid_exit_codes: list[int]
        """
        super().__init__(name=name, **kwargs)
        self.type: str = "PowerShell"
        self.script_uri = script_uri
        self.sha256_checksum = sha256_checksum
        self.inline = inline
        self.run_elevated = run_elevated
        self.run_as_system = run_as_system
        self.valid_exit_codes = valid_exit_codes


class ImageTemplatePowerShellValidator(ImageTemplateInVMValidator):
    """Runs the specified PowerShell script during the validation phase (Windows). Corresponds to Packer powershell provisioner. Exactly one of 'scriptUri' or 'inline' can be specified.

    All required parameters must be populated in order to send to Azure.

    :ivar type: The type of validation you want to use on the Image. For example, "Shell" can be
     shell validation. Required.
    :vartype type: str
    :ivar name: Friendly Name to provide context on what this validation step does.
    :vartype name: str
    :ivar script_uri: URI of the PowerShell script to be run for validation. It can be a github
     link, Azure Storage URI, etc.
    :vartype script_uri: str
    :ivar sha256_checksum: SHA256 checksum of the power shell script provided in the scriptUri
     field above.
    :vartype sha256_checksum: str
    :ivar inline: Array of PowerShell commands to execute.
    :vartype inline: list[str]
    :ivar run_elevated: If specified, the PowerShell script will be run with elevated privileges.
    :vartype run_elevated: bool
    :ivar run_as_system: If specified, the PowerShell script will be run with elevated privileges
     using the Local System user. Can only be true when the runElevated field above is set to true.
    :vartype run_as_system: bool
    :ivar valid_exit_codes: Valid exit codes for the PowerShell script. [Default: 0].
    :vartype valid_exit_codes: list[int]
    """

    _validation = {
        "type": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "script_uri": {"key": "scriptUri", "type": "str"},
        "sha256_checksum": {"key": "sha256Checksum", "type": "str"},
        "inline": {"key": "inline", "type": "[str]"},
        "run_elevated": {"key": "runElevated", "type": "bool"},
        "run_as_system": {"key": "runAsSystem", "type": "bool"},
        "valid_exit_codes": {"key": "validExitCodes", "type": "[int]"},
    }

    def __init__(
        self,
        *,
        name: Optional[str] = None,
        script_uri: Optional[str] = None,
        sha256_checksum: str = "",
        inline: Optional[List[str]] = None,
        run_elevated: bool = False,
        run_as_system: bool = False,
        valid_exit_codes: Optional[List[int]] = None,
        **kwargs
    ):
        """
        :keyword name: Friendly Name to provide context on what this validation step does.
        :paramtype name: str
        :keyword script_uri: URI of the PowerShell script to be run for validation. It can be a github
         link, Azure Storage URI, etc.
        :paramtype script_uri: str
        :keyword sha256_checksum: SHA256 checksum of the power shell script provided in the scriptUri
         field above.
        :paramtype sha256_checksum: str
        :keyword inline: Array of PowerShell commands to execute.
        :paramtype inline: list[str]
        :keyword run_elevated: If specified, the PowerShell script will be run with elevated
         privileges.
        :paramtype run_elevated: bool
        :keyword run_as_system: If specified, the PowerShell script will be run with elevated
         privileges using the Local System user. Can only be true when the runElevated field above is
         set to true.
        :paramtype run_as_system: bool
        :keyword valid_exit_codes: Valid exit codes for the PowerShell script. [Default: 0].
        :paramtype valid_exit_codes: list[int]
        """
        super().__init__(name=name, **kwargs)
        self.type: str = "PowerShell"
        self.script_uri = script_uri
        self.sha256_checksum = sha256_checksum
        self.inline = inline
        self.run_elevated = run_elevated
        self.run_as_system = run_as_system
        self.valid_exit_codes = valid_exit_codes


class ImageTemplatePropertiesValidate(_serialization.Model):
    """Configuration options and list of validations to be performed on the resulting image.

    :ivar continue_distribute_on_failure: If validation fails and this field is set to false,
     output image(s) will not be distributed. This is the default behavior. If validation fails and
     this field is set to true, output image(s) will still be distributed. Please use this option
     with caution as it may result in bad images being distributed for use. In either case (true or
     false), the end to end image run will be reported as having failed in case of a validation
     failure. [Note: This field has no effect if validation succeeds.].
    :vartype continue_distribute_on_failure: bool
    :ivar source_validation_only: If this field is set to true, the image specified in the 'source'
     section will directly be validated. No separate build will be run to generate and then validate
     a customized image.
    :vartype source_validation_only: bool
    :ivar in_vm_validations: List of validations to be performed.
    :vartype in_vm_validations: list[~azure.mgmt.imagebuilder.models.ImageTemplateInVMValidator]
    """

    _attribute_map = {
        "continue_distribute_on_failure": {"key": "continueDistributeOnFailure", "type": "bool"},
        "source_validation_only": {"key": "sourceValidationOnly", "type": "bool"},
        "in_vm_validations": {"key": "inVMValidations", "type": "[ImageTemplateInVMValidator]"},
    }

    def __init__(
        self,
        *,
        continue_distribute_on_failure: bool = False,
        source_validation_only: bool = False,
        in_vm_validations: Optional[List["_models.ImageTemplateInVMValidator"]] = None,
        **kwargs
    ):
        """
        :keyword continue_distribute_on_failure: If validation fails and this field is set to false,
         output image(s) will not be distributed. This is the default behavior. If validation fails and
         this field is set to true, output image(s) will still be distributed. Please use this option
         with caution as it may result in bad images being distributed for use. In either case (true or
         false), the end to end image run will be reported as having failed in case of a validation
         failure. [Note: This field has no effect if validation succeeds.].
        :paramtype continue_distribute_on_failure: bool
        :keyword source_validation_only: If this field is set to true, the image specified in the
         'source' section will directly be validated. No separate build will be run to generate and then
         validate a customized image.
        :paramtype source_validation_only: bool
        :keyword in_vm_validations: List of validations to be performed.
        :paramtype in_vm_validations: list[~azure.mgmt.imagebuilder.models.ImageTemplateInVMValidator]
        """
        super().__init__(**kwargs)
        self.continue_distribute_on_failure = continue_distribute_on_failure
        self.source_validation_only = source_validation_only
        self.in_vm_validations = in_vm_validations


class ImageTemplateRestartCustomizer(ImageTemplateCustomizer):
    """Reboots a VM and waits for it to come back online (Windows). Corresponds to Packer windows-restart provisioner.

    All required parameters must be populated in order to send to Azure.

    :ivar type: The type of customization tool you want to use on the Image. For example, "Shell"
     can be shell customizer. Required.
    :vartype type: str
    :ivar name: Friendly Name to provide context on what this customization step does.
    :vartype name: str
    :ivar restart_command: Command to execute the restart [Default: 'shutdown /r /f /t 0 /c "packer
     restart"'].
    :vartype restart_command: str
    :ivar restart_check_command: Command to check if restart succeeded [Default: ''].
    :vartype restart_check_command: str
    :ivar restart_timeout: Restart timeout specified as a string of magnitude and unit, e.g. '5m'
     (5 minutes) or '2h' (2 hours) [Default: '5m'].
    :vartype restart_timeout: str
    """

    _validation = {
        "type": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "restart_command": {"key": "restartCommand", "type": "str"},
        "restart_check_command": {"key": "restartCheckCommand", "type": "str"},
        "restart_timeout": {"key": "restartTimeout", "type": "str"},
    }

    def __init__(
        self,
        *,
        name: Optional[str] = None,
        restart_command: Optional[str] = None,
        restart_check_command: Optional[str] = None,
        restart_timeout: Optional[str] = None,
        **kwargs
    ):
        """
        :keyword name: Friendly Name to provide context on what this customization step does.
        :paramtype name: str
        :keyword restart_command: Command to execute the restart [Default: 'shutdown /r /f /t 0 /c
         "packer restart"'].
        :paramtype restart_command: str
        :keyword restart_check_command: Command to check if restart succeeded [Default: ''].
        :paramtype restart_check_command: str
        :keyword restart_timeout: Restart timeout specified as a string of magnitude and unit, e.g.
         '5m' (5 minutes) or '2h' (2 hours) [Default: '5m'].
        :paramtype restart_timeout: str
        """
        super().__init__(name=name, **kwargs)
        self.type: str = "WindowsRestart"
        self.restart_command = restart_command
        self.restart_check_command = restart_check_command
        self.restart_timeout = restart_timeout


class ImageTemplateSharedImageDistributor(ImageTemplateDistributor):
    """Distribute via Shared Image Gallery.

    All required parameters must be populated in order to send to Azure.

    :ivar type: Type of distribution. Required.
    :vartype type: str
    :ivar run_output_name: The name to be used for the associated RunOutput. Required.
    :vartype run_output_name: str
    :ivar artifact_tags: Tags that will be applied to the artifact once it has been created/updated
     by the distributor.
    :vartype artifact_tags: dict[str, str]
    :ivar gallery_image_id: Resource Id of the Shared Image Gallery image. Required.
    :vartype gallery_image_id: str
    :ivar replication_regions: A list of regions that the image will be replicated to. Required.
    :vartype replication_regions: list[str]
    :ivar exclude_from_latest: Flag that indicates whether created image version should be excluded
     from latest. Omit to use the default (false).
    :vartype exclude_from_latest: bool
    :ivar storage_account_type: Storage account type to be used to store the shared image. Omit to
     use the default (Standard_LRS). Known values are: "Standard_LRS" and "Standard_ZRS".
    :vartype storage_account_type: str or
     ~azure.mgmt.imagebuilder.models.SharedImageStorageAccountType
    """

    _validation = {
        "type": {"required": True},
        "run_output_name": {"required": True, "pattern": r"^[A-Za-z0-9-_.]{1,64}$"},
        "gallery_image_id": {"required": True},
        "replication_regions": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "run_output_name": {"key": "runOutputName", "type": "str"},
        "artifact_tags": {"key": "artifactTags", "type": "{str}"},
        "gallery_image_id": {"key": "galleryImageId", "type": "str"},
        "replication_regions": {"key": "replicationRegions", "type": "[str]"},
        "exclude_from_latest": {"key": "excludeFromLatest", "type": "bool"},
        "storage_account_type": {"key": "storageAccountType", "type": "str"},
    }

    def __init__(
        self,
        *,
        run_output_name: str,
        gallery_image_id: str,
        replication_regions: List[str],
        artifact_tags: Optional[Dict[str, str]] = None,
        exclude_from_latest: bool = False,
        storage_account_type: Optional[Union[str, "_models.SharedImageStorageAccountType"]] = None,
        **kwargs
    ):
        """
        :keyword run_output_name: The name to be used for the associated RunOutput. Required.
        :paramtype run_output_name: str
        :keyword artifact_tags: Tags that will be applied to the artifact once it has been
         created/updated by the distributor.
        :paramtype artifact_tags: dict[str, str]
        :keyword gallery_image_id: Resource Id of the Shared Image Gallery image. Required.
        :paramtype gallery_image_id: str
        :keyword replication_regions: A list of regions that the image will be replicated to. Required.
        :paramtype replication_regions: list[str]
        :keyword exclude_from_latest: Flag that indicates whether created image version should be
         excluded from latest. Omit to use the default (false).
        :paramtype exclude_from_latest: bool
        :keyword storage_account_type: Storage account type to be used to store the shared image. Omit
         to use the default (Standard_LRS). Known values are: "Standard_LRS" and "Standard_ZRS".
        :paramtype storage_account_type: str or
         ~azure.mgmt.imagebuilder.models.SharedImageStorageAccountType
        """
        super().__init__(run_output_name=run_output_name, artifact_tags=artifact_tags, **kwargs)
        self.type: str = "SharedImage"
        self.gallery_image_id = gallery_image_id
        self.replication_regions = replication_regions
        self.exclude_from_latest = exclude_from_latest
        self.storage_account_type = storage_account_type


class ImageTemplateSharedImageVersionSource(ImageTemplateSource):
    """Describes an image source that is an image version in a shared image gallery.

    All required parameters must be populated in order to send to Azure.

    :ivar type: Specifies the type of source image you want to start with. Required.
    :vartype type: str
    :ivar image_version_id: ARM resource id of the image version in the shared image gallery.
     Required.
    :vartype image_version_id: str
    """

    _validation = {
        "type": {"required": True},
        "image_version_id": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "image_version_id": {"key": "imageVersionId", "type": "str"},
    }

    def __init__(self, *, image_version_id: str, **kwargs):
        """
        :keyword image_version_id: ARM resource id of the image version in the shared image gallery.
         Required.
        :paramtype image_version_id: str
        """
        super().__init__(**kwargs)
        self.type: str = "SharedImageVersion"
        self.image_version_id = image_version_id


class ImageTemplateShellCustomizer(ImageTemplateCustomizer):
    """Runs a shell script during the customization phase (Linux). Corresponds to Packer shell provisioner. Exactly one of 'scriptUri' or 'inline' can be specified.

    All required parameters must be populated in order to send to Azure.

    :ivar type: The type of customization tool you want to use on the Image. For example, "Shell"
     can be shell customizer. Required.
    :vartype type: str
    :ivar name: Friendly Name to provide context on what this customization step does.
    :vartype name: str
    :ivar script_uri: URI of the shell script to be run for customizing. It can be a github link,
     SAS URI for Azure Storage, etc.
    :vartype script_uri: str
    :ivar sha256_checksum: SHA256 checksum of the shell script provided in the scriptUri field.
    :vartype sha256_checksum: str
    :ivar inline: Array of shell commands to execute.
    :vartype inline: list[str]
    """

    _validation = {
        "type": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "script_uri": {"key": "scriptUri", "type": "str"},
        "sha256_checksum": {"key": "sha256Checksum", "type": "str"},
        "inline": {"key": "inline", "type": "[str]"},
    }

    def __init__(
        self,
        *,
        name: Optional[str] = None,
        script_uri: Optional[str] = None,
        sha256_checksum: str = "",
        inline: Optional[List[str]] = None,
        **kwargs
    ):
        """
        :keyword name: Friendly Name to provide context on what this customization step does.
        :paramtype name: str
        :keyword script_uri: URI of the shell script to be run for customizing. It can be a github
         link, SAS URI for Azure Storage, etc.
        :paramtype script_uri: str
        :keyword sha256_checksum: SHA256 checksum of the shell script provided in the scriptUri field.
        :paramtype sha256_checksum: str
        :keyword inline: Array of shell commands to execute.
        :paramtype inline: list[str]
        """
        super().__init__(name=name, **kwargs)
        self.type: str = "Shell"
        self.script_uri = script_uri
        self.sha256_checksum = sha256_checksum
        self.inline = inline


class ImageTemplateShellValidator(ImageTemplateInVMValidator):
    """Runs the specified shell script during the validation phase (Linux). Corresponds to Packer shell provisioner. Exactly one of 'scriptUri' or 'inline' can be specified.

    All required parameters must be populated in order to send to Azure.

    :ivar type: The type of validation you want to use on the Image. For example, "Shell" can be
     shell validation. Required.
    :vartype type: str
    :ivar name: Friendly Name to provide context on what this validation step does.
    :vartype name: str
    :ivar script_uri: URI of the shell script to be run for validation. It can be a github link,
     Azure Storage URI, etc.
    :vartype script_uri: str
    :ivar sha256_checksum: SHA256 checksum of the shell script provided in the scriptUri field.
    :vartype sha256_checksum: str
    :ivar inline: Array of shell commands to execute.
    :vartype inline: list[str]
    """

    _validation = {
        "type": {"required": True},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "script_uri": {"key": "scriptUri", "type": "str"},
        "sha256_checksum": {"key": "sha256Checksum", "type": "str"},
        "inline": {"key": "inline", "type": "[str]"},
    }

    def __init__(
        self,
        *,
        name: Optional[str] = None,
        script_uri: Optional[str] = None,
        sha256_checksum: str = "",
        inline: Optional[List[str]] = None,
        **kwargs
    ):
        """
        :keyword name: Friendly Name to provide context on what this validation step does.
        :paramtype name: str
        :keyword script_uri: URI of the shell script to be run for validation. It can be a github link,
         Azure Storage URI, etc.
        :paramtype script_uri: str
        :keyword sha256_checksum: SHA256 checksum of the shell script provided in the scriptUri field.
        :paramtype sha256_checksum: str
        :keyword inline: Array of shell commands to execute.
        :paramtype inline: list[str]
        """
        super().__init__(name=name, **kwargs)
        self.type: str = "Shell"
        self.script_uri = script_uri
        self.sha256_checksum = sha256_checksum
        self.inline = inline


class ImageTemplateUpdateParameters(_serialization.Model):
    """Parameters for updating an image template.

    :ivar identity: The identity of the image template, if configured.
    :vartype identity: ~azure.mgmt.imagebuilder.models.ImageTemplateIdentity
    :ivar tags: The user-specified tags associated with the image template.
    :vartype tags: dict[str, str]
    """

    _attribute_map = {
        "identity": {"key": "identity", "type": "ImageTemplateIdentity"},
        "tags": {"key": "tags", "type": "{str}"},
    }

    def __init__(
        self,
        *,
        identity: Optional["_models.ImageTemplateIdentity"] = None,
        tags: Optional[Dict[str, str]] = None,
        **kwargs
    ):
        """
        :keyword identity: The identity of the image template, if configured.
        :paramtype identity: ~azure.mgmt.imagebuilder.models.ImageTemplateIdentity
        :keyword tags: The user-specified tags associated with the image template.
        :paramtype tags: dict[str, str]
        """
        super().__init__(**kwargs)
        self.identity = identity
        self.tags = tags


class ImageTemplateVhdDistributor(ImageTemplateDistributor):
    """Distribute via VHD in a storage account.

    All required parameters must be populated in order to send to Azure.

    :ivar type: Type of distribution. Required.
    :vartype type: str
    :ivar run_output_name: The name to be used for the associated RunOutput. Required.
    :vartype run_output_name: str
    :ivar artifact_tags: Tags that will be applied to the artifact once it has been created/updated
     by the distributor.
    :vartype artifact_tags: dict[str, str]
    """

    _validation = {
        "type": {"required": True},
        "run_output_name": {"required": True, "pattern": r"^[A-Za-z0-9-_.]{1,64}$"},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "run_output_name": {"key": "runOutputName", "type": "str"},
        "artifact_tags": {"key": "artifactTags", "type": "{str}"},
    }

    def __init__(self, *, run_output_name: str, artifact_tags: Optional[Dict[str, str]] = None, **kwargs):
        """
        :keyword run_output_name: The name to be used for the associated RunOutput. Required.
        :paramtype run_output_name: str
        :keyword artifact_tags: Tags that will be applied to the artifact once it has been
         created/updated by the distributor.
        :paramtype artifact_tags: dict[str, str]
        """
        super().__init__(run_output_name=run_output_name, artifact_tags=artifact_tags, **kwargs)
        self.type: str = "VHD"


class ImageTemplateVmProfile(_serialization.Model):
    """Describes the virtual machines used to build and validate images.

    :ivar vm_size: Size of the virtual machine used to build, customize and capture images. Omit or
     specify empty string to use the default (Standard_D1_v2 for Gen1 images and Standard_D2ds_v4
     for Gen2 images).
    :vartype vm_size: str
    :ivar os_disk_size_gb: Size of the OS disk in GB. Omit or specify 0 to use Azure's default OS
     disk size.
    :vartype os_disk_size_gb: int
    :ivar user_assigned_identities: Optional array of resource IDs of user assigned managed
     identities to be configured on the build VM and validation VM. This may include the identity of
     the image template.
    :vartype user_assigned_identities: list[str]
    :ivar vnet_config: Optional configuration of the virtual network to use to deploy the build VM
     and validation VM in. Omit if no specific virtual network needs to be used.
    :vartype vnet_config: ~azure.mgmt.imagebuilder.models.VirtualNetworkConfig
    """

    _validation = {
        "os_disk_size_gb": {"minimum": 0},
    }

    _attribute_map = {
        "vm_size": {"key": "vmSize", "type": "str"},
        "os_disk_size_gb": {"key": "osDiskSizeGB", "type": "int"},
        "user_assigned_identities": {"key": "userAssignedIdentities", "type": "[str]"},
        "vnet_config": {"key": "vnetConfig", "type": "VirtualNetworkConfig"},
    }

    def __init__(
        self,
        *,
        vm_size: str = "",
        os_disk_size_gb: int = 0,
        user_assigned_identities: Optional[List[str]] = None,
        vnet_config: Optional["_models.VirtualNetworkConfig"] = None,
        **kwargs
    ):
        """
        :keyword vm_size: Size of the virtual machine used to build, customize and capture images. Omit
         or specify empty string to use the default (Standard_D1_v2 for Gen1 images and Standard_D2ds_v4
         for Gen2 images).
        :paramtype vm_size: str
        :keyword os_disk_size_gb: Size of the OS disk in GB. Omit or specify 0 to use Azure's default
         OS disk size.
        :paramtype os_disk_size_gb: int
        :keyword user_assigned_identities: Optional array of resource IDs of user assigned managed
         identities to be configured on the build VM and validation VM. This may include the identity of
         the image template.
        :paramtype user_assigned_identities: list[str]
        :keyword vnet_config: Optional configuration of the virtual network to use to deploy the build
         VM and validation VM in. Omit if no specific virtual network needs to be used.
        :paramtype vnet_config: ~azure.mgmt.imagebuilder.models.VirtualNetworkConfig
        """
        super().__init__(**kwargs)
        self.vm_size = vm_size
        self.os_disk_size_gb = os_disk_size_gb
        self.user_assigned_identities = user_assigned_identities
        self.vnet_config = vnet_config


class ImageTemplateWindowsUpdateCustomizer(ImageTemplateCustomizer):
    """Installs Windows Updates. Corresponds to Packer Windows Update Provisioner (https://github.com/rgl/packer-provisioner-windows-update).

    All required parameters must be populated in order to send to Azure.

    :ivar type: The type of customization tool you want to use on the Image. For example, "Shell"
     can be shell customizer. Required.
    :vartype type: str
    :ivar name: Friendly Name to provide context on what this customization step does.
    :vartype name: str
    :ivar search_criteria: Criteria to search updates. Omit or specify empty string to use the
     default (search all). Refer to above link for examples and detailed description of this field.
    :vartype search_criteria: str
    :ivar filters: Array of filters to select updates to apply. Omit or specify empty array to use
     the default (no filter). Refer to above link for examples and detailed description of this
     field.
    :vartype filters: list[str]
    :ivar update_limit: Maximum number of updates to apply at a time. Omit or specify 0 to use the
     default (1000).
    :vartype update_limit: int
    """

    _validation = {
        "type": {"required": True},
        "update_limit": {"minimum": 0},
    }

    _attribute_map = {
        "type": {"key": "type", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "search_criteria": {"key": "searchCriteria", "type": "str"},
        "filters": {"key": "filters", "type": "[str]"},
        "update_limit": {"key": "updateLimit", "type": "int"},
    }

    def __init__(
        self,
        *,
        name: Optional[str] = None,
        search_criteria: Optional[str] = None,
        filters: Optional[List[str]] = None,
        update_limit: Optional[int] = None,
        **kwargs
    ):
        """
        :keyword name: Friendly Name to provide context on what this customization step does.
        :paramtype name: str
        :keyword search_criteria: Criteria to search updates. Omit or specify empty string to use the
         default (search all). Refer to above link for examples and detailed description of this field.
        :paramtype search_criteria: str
        :keyword filters: Array of filters to select updates to apply. Omit or specify empty array to
         use the default (no filter). Refer to above link for examples and detailed description of this
         field.
        :paramtype filters: list[str]
        :keyword update_limit: Maximum number of updates to apply at a time. Omit or specify 0 to use
         the default (1000).
        :paramtype update_limit: int
        """
        super().__init__(name=name, **kwargs)
        self.type: str = "WindowsUpdate"
        self.search_criteria = search_criteria
        self.filters = filters
        self.update_limit = update_limit


class Operation(_serialization.Model):
    """A REST API operation.

    :ivar name: This is of the format {provider}/{resource}/{operation}.
    :vartype name: str
    :ivar display: The object that describes the operation.
    :vartype display: ~azure.mgmt.imagebuilder.models.OperationDisplay
    :ivar origin: The intended executor of the operation.
    :vartype origin: str
    :ivar properties: Properties of the operation.
    :vartype properties: JSON
    :ivar is_data_action: The flag that indicates whether the operation applies to data plane.
    :vartype is_data_action: bool
    """

    _attribute_map = {
        "name": {"key": "name", "type": "str"},
        "display": {"key": "display", "type": "OperationDisplay"},
        "origin": {"key": "origin", "type": "str"},
        "properties": {"key": "properties", "type": "object"},
        "is_data_action": {"key": "isDataAction", "type": "bool"},
    }

    def __init__(
        self,
        *,
        name: Optional[str] = None,
        display: Optional["_models.OperationDisplay"] = None,
        origin: Optional[str] = None,
        properties: Optional[JSON] = None,
        is_data_action: Optional[bool] = None,
        **kwargs
    ):
        """
        :keyword name: This is of the format {provider}/{resource}/{operation}.
        :paramtype name: str
        :keyword display: The object that describes the operation.
        :paramtype display: ~azure.mgmt.imagebuilder.models.OperationDisplay
        :keyword origin: The intended executor of the operation.
        :paramtype origin: str
        :keyword properties: Properties of the operation.
        :paramtype properties: JSON
        :keyword is_data_action: The flag that indicates whether the operation applies to data plane.
        :paramtype is_data_action: bool
        """
        super().__init__(**kwargs)
        self.name = name
        self.display = display
        self.origin = origin
        self.properties = properties
        self.is_data_action = is_data_action


class OperationDisplay(_serialization.Model):
    """The object that describes the operation.

    :ivar provider: Friendly name of the resource provider.
    :vartype provider: str
    :ivar operation: For example: read, write, delete, or listKeys/action.
    :vartype operation: str
    :ivar resource: The resource type on which the operation is performed.
    :vartype resource: str
    :ivar description: The friendly name of the operation.
    :vartype description: str
    """

    _attribute_map = {
        "provider": {"key": "provider", "type": "str"},
        "operation": {"key": "operation", "type": "str"},
        "resource": {"key": "resource", "type": "str"},
        "description": {"key": "description", "type": "str"},
    }

    def __init__(
        self,
        *,
        provider: Optional[str] = None,
        operation: Optional[str] = None,
        resource: Optional[str] = None,
        description: Optional[str] = None,
        **kwargs
    ):
        """
        :keyword provider: Friendly name of the resource provider.
        :paramtype provider: str
        :keyword operation: For example: read, write, delete, or listKeys/action.
        :paramtype operation: str
        :keyword resource: The resource type on which the operation is performed.
        :paramtype resource: str
        :keyword description: The friendly name of the operation.
        :paramtype description: str
        """
        super().__init__(**kwargs)
        self.provider = provider
        self.operation = operation
        self.resource = resource
        self.description = description


class OperationListResult(_serialization.Model):
    """Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the next set of results.

    :ivar value: The list of operations supported by the resource provider.
    :vartype value: list[~azure.mgmt.imagebuilder.models.Operation]
    :ivar next_link: The URL to get the next set of operation list results if there are any.
    :vartype next_link: str
    """

    _attribute_map = {
        "value": {"key": "value", "type": "[Operation]"},
        "next_link": {"key": "nextLink", "type": "str"},
    }

    def __init__(self, *, value: Optional[List["_models.Operation"]] = None, next_link: Optional[str] = None, **kwargs):
        """
        :keyword value: The list of operations supported by the resource provider.
        :paramtype value: list[~azure.mgmt.imagebuilder.models.Operation]
        :keyword next_link: The URL to get the next set of operation list results if there are any.
        :paramtype next_link: str
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link = next_link


class PlatformImagePurchasePlan(_serialization.Model):
    """Purchase plan configuration for platform image.

    All required parameters must be populated in order to send to Azure.

    :ivar plan_name: Name of the purchase plan. Required.
    :vartype plan_name: str
    :ivar plan_product: Product of the purchase plan. Required.
    :vartype plan_product: str
    :ivar plan_publisher: Publisher of the purchase plan. Required.
    :vartype plan_publisher: str
    """

    _validation = {
        "plan_name": {"required": True},
        "plan_product": {"required": True},
        "plan_publisher": {"required": True},
    }

    _attribute_map = {
        "plan_name": {"key": "planName", "type": "str"},
        "plan_product": {"key": "planProduct", "type": "str"},
        "plan_publisher": {"key": "planPublisher", "type": "str"},
    }

    def __init__(self, *, plan_name: str, plan_product: str, plan_publisher: str, **kwargs):
        """
        :keyword plan_name: Name of the purchase plan. Required.
        :paramtype plan_name: str
        :keyword plan_product: Product of the purchase plan. Required.
        :paramtype plan_product: str
        :keyword plan_publisher: Publisher of the purchase plan. Required.
        :paramtype plan_publisher: str
        """
        super().__init__(**kwargs)
        self.plan_name = plan_name
        self.plan_product = plan_product
        self.plan_publisher = plan_publisher


class ProvisioningError(_serialization.Model):
    """Describes the error happened when create or update an image template.

    :ivar provisioning_error_code: Error code of the provisioning failure. Known values are:
     "BadSourceType", "BadPIRSource", "BadManagedImageSource", "BadSharedImageVersionSource",
     "BadCustomizerType", "UnsupportedCustomizerType", "NoCustomizerScript", "BadValidatorType",
     "UnsupportedValidatorType", "NoValidatorScript", "BadDistributeType",
     "BadSharedImageDistribute", "BadStagingResourceGroup", "ServerError", and "Other".
    :vartype provisioning_error_code: str or ~azure.mgmt.imagebuilder.models.ProvisioningErrorCode
    :ivar message: Verbose error message about the provisioning failure.
    :vartype message: str
    """

    _attribute_map = {
        "provisioning_error_code": {"key": "provisioningErrorCode", "type": "str"},
        "message": {"key": "message", "type": "str"},
    }

    def __init__(
        self,
        *,
        provisioning_error_code: Optional[Union[str, "_models.ProvisioningErrorCode"]] = None,
        message: Optional[str] = None,
        **kwargs
    ):
        """
        :keyword provisioning_error_code: Error code of the provisioning failure. Known values are:
         "BadSourceType", "BadPIRSource", "BadManagedImageSource", "BadSharedImageVersionSource",
         "BadCustomizerType", "UnsupportedCustomizerType", "NoCustomizerScript", "BadValidatorType",
         "UnsupportedValidatorType", "NoValidatorScript", "BadDistributeType",
         "BadSharedImageDistribute", "BadStagingResourceGroup", "ServerError", and "Other".
        :paramtype provisioning_error_code: str or
         ~azure.mgmt.imagebuilder.models.ProvisioningErrorCode
        :keyword message: Verbose error message about the provisioning failure.
        :paramtype message: str
        """
        super().__init__(**kwargs)
        self.provisioning_error_code = provisioning_error_code
        self.message = message


class ProxyResource(Resource):
    """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location.

    Variables are only populated by the server, and will be ignored when sending a request.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.imagebuilder.models.SystemData
    """

    _validation = {
        "id": {"readonly": True},
        "name": {"readonly": True},
        "type": {"readonly": True},
        "system_data": {"readonly": True},
    }

    _attribute_map = {
        "id": {"key": "id", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "type": {"key": "type", "type": "str"},
        "system_data": {"key": "systemData", "type": "SystemData"},
    }

    def __init__(self, **kwargs):
        """ """
        super().__init__(**kwargs)


class RunOutput(ProxyResource):
    """Represents an output that was created by running an image template.

    Variables are only populated by the server, and will be ignored when sending a request.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.imagebuilder.models.SystemData
    :ivar artifact_id: The resource id of the artifact.
    :vartype artifact_id: str
    :ivar artifact_uri: The location URI of the artifact.
    :vartype artifact_uri: str
    :ivar provisioning_state: Provisioning state of the resource. Known values are: "Creating",
     "Updating", "Succeeded", "Failed", and "Deleting".
    :vartype provisioning_state: str or ~azure.mgmt.imagebuilder.models.ProvisioningState
    """

    _validation = {
        "id": {"readonly": True},
        "name": {"readonly": True},
        "type": {"readonly": True},
        "system_data": {"readonly": True},
        "provisioning_state": {"readonly": True},
    }

    _attribute_map = {
        "id": {"key": "id", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "type": {"key": "type", "type": "str"},
        "system_data": {"key": "systemData", "type": "SystemData"},
        "artifact_id": {"key": "properties.artifactId", "type": "str"},
        "artifact_uri": {"key": "properties.artifactUri", "type": "str"},
        "provisioning_state": {"key": "properties.provisioningState", "type": "str"},
    }

    def __init__(self, *, artifact_id: Optional[str] = None, artifact_uri: Optional[str] = None, **kwargs):
        """
        :keyword artifact_id: The resource id of the artifact.
        :paramtype artifact_id: str
        :keyword artifact_uri: The location URI of the artifact.
        :paramtype artifact_uri: str
        """
        super().__init__(**kwargs)
        self.artifact_id = artifact_id
        self.artifact_uri = artifact_uri
        self.provisioning_state = None


class RunOutputCollection(_serialization.Model):
    """The result of List run outputs operation.

    :ivar value: An array of run outputs.
    :vartype value: list[~azure.mgmt.imagebuilder.models.RunOutput]
    :ivar next_link: The continuation token.
    :vartype next_link: str
    """

    _attribute_map = {
        "value": {"key": "value", "type": "[RunOutput]"},
        "next_link": {"key": "nextLink", "type": "str"},
    }

    def __init__(self, *, value: Optional[List["_models.RunOutput"]] = None, next_link: Optional[str] = None, **kwargs):
        """
        :keyword value: An array of run outputs.
        :paramtype value: list[~azure.mgmt.imagebuilder.models.RunOutput]
        :keyword next_link: The continuation token.
        :paramtype next_link: str
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link = next_link


class SystemData(_serialization.Model):
    """Metadata pertaining to creation and last modification of the resource.

    :ivar created_by: The identity that created the resource.
    :vartype created_by: str
    :ivar created_by_type: The type of identity that created the resource. Known values are:
     "User", "Application", "ManagedIdentity", and "Key".
    :vartype created_by_type: str or ~azure.mgmt.imagebuilder.models.CreatedByType
    :ivar created_at: The timestamp of resource creation (UTC).
    :vartype created_at: ~datetime.datetime
    :ivar last_modified_by: The identity that last modified the resource.
    :vartype last_modified_by: str
    :ivar last_modified_by_type: The type of identity that last modified the resource. Known values
     are: "User", "Application", "ManagedIdentity", and "Key".
    :vartype last_modified_by_type: str or ~azure.mgmt.imagebuilder.models.CreatedByType
    :ivar last_modified_at: The timestamp of resource last modification (UTC).
    :vartype last_modified_at: ~datetime.datetime
    """

    _attribute_map = {
        "created_by": {"key": "createdBy", "type": "str"},
        "created_by_type": {"key": "createdByType", "type": "str"},
        "created_at": {"key": "createdAt", "type": "iso-8601"},
        "last_modified_by": {"key": "lastModifiedBy", "type": "str"},
        "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"},
        "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"},
    }

    def __init__(
        self,
        *,
        created_by: Optional[str] = None,
        created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
        created_at: Optional[datetime.datetime] = None,
        last_modified_by: Optional[str] = None,
        last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
        last_modified_at: Optional[datetime.datetime] = None,
        **kwargs
    ):
        """
        :keyword created_by: The identity that created the resource.
        :paramtype created_by: str
        :keyword created_by_type: The type of identity that created the resource. Known values are:
         "User", "Application", "ManagedIdentity", and "Key".
        :paramtype created_by_type: str or ~azure.mgmt.imagebuilder.models.CreatedByType
        :keyword created_at: The timestamp of resource creation (UTC).
        :paramtype created_at: ~datetime.datetime
        :keyword last_modified_by: The identity that last modified the resource.
        :paramtype last_modified_by: str
        :keyword last_modified_by_type: The type of identity that last modified the resource. Known
         values are: "User", "Application", "ManagedIdentity", and "Key".
        :paramtype last_modified_by_type: str or ~azure.mgmt.imagebuilder.models.CreatedByType
        :keyword last_modified_at: The timestamp of resource last modification (UTC).
        :paramtype last_modified_at: ~datetime.datetime
        """
        super().__init__(**kwargs)
        self.created_by = created_by
        self.created_by_type = created_by_type
        self.created_at = created_at
        self.last_modified_by = last_modified_by
        self.last_modified_by_type = last_modified_by_type
        self.last_modified_at = last_modified_at


class VirtualNetworkConfig(_serialization.Model):
    """Virtual Network configuration.

    :ivar subnet_id: Resource id of a pre-existing subnet.
    :vartype subnet_id: str
    :ivar proxy_vm_size: Size of the proxy virtual machine used to pass traffic to the build VM and
     validation VM. Omit or specify empty string to use the default (Standard_A1_v2).
    :vartype proxy_vm_size: str
    """

    _attribute_map = {
        "subnet_id": {"key": "subnetId", "type": "str"},
        "proxy_vm_size": {"key": "proxyVmSize", "type": "str"},
    }

    def __init__(self, *, subnet_id: Optional[str] = None, proxy_vm_size: str = "", **kwargs):
        """
        :keyword subnet_id: Resource id of a pre-existing subnet.
        :paramtype subnet_id: str
        :keyword proxy_vm_size: Size of the proxy virtual machine used to pass traffic to the build VM
         and validation VM. Omit or specify empty string to use the default (Standard_A1_v2).
        :paramtype proxy_vm_size: str
        """
        super().__init__(**kwargs)
        self.subnet_id = subnet_id
        self.proxy_vm_size = proxy_vm_size