File: _models_py3.py

package info (click to toggle)
python-azure 20251202%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 786,344 kB
  • sloc: python: 6,510,493; ansic: 804; javascript: 287; sh: 204; makefile: 198; xml: 109
file content (350 lines) | stat: -rw-r--r-- 13,342 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
# pylint: disable=line-too-long,useless-suppression
# coding=utf-8
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------

from typing import Any, Dict, List, Optional, TYPE_CHECKING

from .._utils import serialization as _serialization

if TYPE_CHECKING:
    from .. import models as _models


class ChangeAttributes(_serialization.Model):
    """Details about the change resource.

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

    :ivar correlation_id: The ARM correlation ID of the change resource.
    :vartype correlation_id: str
    :ivar timestamp: The time the change(s) on the target resource ocurred.
    :vartype timestamp: str
    :ivar changes_count: The number of changes this resource captures.
    :vartype changes_count: int
    :ivar previous_resource_snapshot_id: The GUID of the previous snapshot.
    :vartype previous_resource_snapshot_id: str
    :ivar new_resource_snapshot_id: The GUID of the new snapshot.
    :vartype new_resource_snapshot_id: str
    """

    _validation = {
        "correlation_id": {"readonly": True},
        "timestamp": {"readonly": True},
        "changes_count": {"readonly": True},
        "previous_resource_snapshot_id": {"readonly": True},
        "new_resource_snapshot_id": {"readonly": True},
    }

    _attribute_map = {
        "correlation_id": {"key": "correlationId", "type": "str"},
        "timestamp": {"key": "timestamp", "type": "str"},
        "changes_count": {"key": "changesCount", "type": "int"},
        "previous_resource_snapshot_id": {"key": "previousResourceSnapshotId", "type": "str"},
        "new_resource_snapshot_id": {"key": "newResourceSnapshotId", "type": "str"},
    }

    def __init__(self, **kwargs: Any) -> None:
        """ """
        super().__init__(**kwargs)
        self.correlation_id: Optional[str] = None
        self.timestamp: Optional[str] = None
        self.changes_count: Optional[int] = None
        self.previous_resource_snapshot_id: Optional[str] = None
        self.new_resource_snapshot_id: Optional[str] = None


class ChangeBase(_serialization.Model):
    """An individual change on the target resource.

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

    :ivar property_change_type: The type of change that occurred. Known values are: "Update",
     "Insert", and "Remove".
    :vartype property_change_type: str or ~azure.mgmt.resource.changes.models.PropertyChangeType
    :ivar change_category: The entity that made the change. Known values are: "User" and "System".
    :vartype change_category: str or ~azure.mgmt.resource.changes.models.ChangeCategory
    :ivar previous_value: The target resource property value before the change.
    :vartype previous_value: str
    :ivar new_value: The target resource property value after the change.
    :vartype new_value: str
    """

    _validation = {
        "property_change_type": {"readonly": True},
        "change_category": {"readonly": True},
        "previous_value": {"readonly": True},
        "new_value": {"readonly": True},
    }

    _attribute_map = {
        "property_change_type": {"key": "propertyChangeType", "type": "str"},
        "change_category": {"key": "changeCategory", "type": "str"},
        "previous_value": {"key": "previousValue", "type": "str"},
        "new_value": {"key": "newValue", "type": "str"},
    }

    def __init__(self, **kwargs: Any) -> None:
        """ """
        super().__init__(**kwargs)
        self.property_change_type: Optional[Union[str, "_models.PropertyChangeType"]] = None
        self.change_category: Optional[Union[str, "_models.ChangeCategory"]] = None
        self.previous_value: Optional[str] = None
        self.new_value: Optional[str] = None


class ChangeProperties(_serialization.Model):
    """The properties of a change.

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

    :ivar target_resource_id: The fully qualified ID of the target resource that was changed.
    :vartype target_resource_id: str
    :ivar target_resource_type: The namespace and type of the resource.
    :vartype target_resource_type: str
    :ivar change_type: The type of change that was captured in the resource. Known values are:
     "Update", "Delete", and "Create".
    :vartype change_type: str or ~azure.mgmt.resource.changes.models.ChangeType
    :ivar change_attributes: Details about the change resource.
    :vartype change_attributes: ~azure.mgmt.resource.changes.models.ChangeAttributes
    :ivar changes: A dictionary with changed property name as a key and the change details as the
     value.
    :vartype changes: dict[str, ~azure.mgmt.resource.changes.models.ChangeBase]
    """

    _validation = {
        "target_resource_id": {"readonly": True},
        "target_resource_type": {"readonly": True},
        "change_type": {"readonly": True},
    }

    _attribute_map = {
        "target_resource_id": {"key": "targetResourceId", "type": "str"},
        "target_resource_type": {"key": "targetResourceType", "type": "str"},
        "change_type": {"key": "changeType", "type": "str"},
        "change_attributes": {"key": "changeAttributes", "type": "ChangeAttributes"},
        "changes": {"key": "changes", "type": "{ChangeBase}"},
    }

    def __init__(
        self,
        *,
        change_attributes: Optional["_models.ChangeAttributes"] = None,
        changes: Optional[Dict[str, "_models.ChangeBase"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword change_attributes: Details about the change resource.
        :paramtype change_attributes: ~azure.mgmt.resource.changes.models.ChangeAttributes
        :keyword changes: A dictionary with changed property name as a key and the change details as
         the value.
        :paramtype changes: dict[str, ~azure.mgmt.resource.changes.models.ChangeBase]
        """
        super().__init__(**kwargs)
        self.target_resource_id: Optional[str] = None
        self.target_resource_type: Optional[str] = None
        self.change_type: Optional[Union[str, "_models.ChangeType"]] = None
        self.change_attributes = change_attributes
        self.changes = changes


class ChangeResourceListResult(_serialization.Model):
    """The list of resources.

    :ivar next_link: The link used to get the next page of Change Resources.
    :vartype next_link: str
    :ivar value: The list of resources.
    :vartype value: list[~azure.mgmt.resource.changes.models.ChangeResourceResult]
    """

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

    def __init__(
        self,
        *,
        next_link: Optional[str] = None,
        value: Optional[List["_models.ChangeResourceResult"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword next_link: The link used to get the next page of Change Resources.
        :paramtype next_link: str
        :keyword value: The list of resources.
        :paramtype value: list[~azure.mgmt.resource.changes.models.ChangeResourceResult]
        """
        super().__init__(**kwargs)
        self.next_link = next_link
        self.value = value


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
    """

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

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

    def __init__(self, **kwargs: Any) -> None:
        """ """
        super().__init__(**kwargs)
        self.id: Optional[str] = None
        self.name: Optional[str] = None
        self.type: Optional[str] = None


class ChangeResourceResult(Resource):
    """Change Resource.

    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 properties: The properties of a change.
    :vartype properties: ~azure.mgmt.resource.changes.models.ChangeProperties
    """

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

    _attribute_map = {
        "id": {"key": "id", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "type": {"key": "type", "type": "str"},
        "properties": {"key": "properties", "type": "ChangeProperties"},
    }

    def __init__(self, *, properties: Optional["_models.ChangeProperties"] = None, **kwargs: Any) -> None:
        """
        :keyword properties: The properties of a change.
        :paramtype properties: ~azure.mgmt.resource.changes.models.ChangeProperties
        """
        super().__init__(**kwargs)
        self.properties = properties


class ErrorAdditionalInfo(_serialization.Model):
    """The resource management error additional info.

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

    :ivar type: The additional info type.
    :vartype type: str
    :ivar info: The additional info.
    :vartype info: JSON
    """

    _validation = {
        "type": {"readonly": True},
        "info": {"readonly": True},
    }

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

    def __init__(self, **kwargs: Any) -> None:
        """ """
        super().__init__(**kwargs)
        self.type: Optional[str] = None
        self.info: Optional[JSON] = None


class ErrorDetail(_serialization.Model):
    """The error detail.

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

    :ivar code: The error code.
    :vartype code: str
    :ivar message: The error message.
    :vartype message: str
    :ivar target: The error target.
    :vartype target: str
    :ivar details: The error details.
    :vartype details: list[~azure.mgmt.resource.changes.models.ErrorDetail]
    :ivar additional_info: The error additional info.
    :vartype additional_info: list[~azure.mgmt.resource.changes.models.ErrorAdditionalInfo]
    """

    _validation = {
        "code": {"readonly": True},
        "message": {"readonly": True},
        "target": {"readonly": True},
        "details": {"readonly": True},
        "additional_info": {"readonly": True},
    }

    _attribute_map = {
        "code": {"key": "code", "type": "str"},
        "message": {"key": "message", "type": "str"},
        "target": {"key": "target", "type": "str"},
        "details": {"key": "details", "type": "[ErrorDetail]"},
        "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"},
    }

    def __init__(self, **kwargs: Any) -> None:
        """ """
        super().__init__(**kwargs)
        self.code: Optional[str] = None
        self.message: Optional[str] = None
        self.target: Optional[str] = None
        self.details: Optional[List["_models.ErrorDetail"]] = None
        self.additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = None


class ErrorResponse(_serialization.Model):
    """Common error response for all Azure Resource Manager APIs to return error details for failed
    operations. (This also follows the OData error response format.).

    :ivar error: The error object.
    :vartype error: ~azure.mgmt.resource.changes.models.ErrorDetail
    """

    _attribute_map = {
        "error": {"key": "error", "type": "ErrorDetail"},
    }

    def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None:
        """
        :keyword error: The error object.
        :paramtype error: ~azure.mgmt.resource.changes.models.ErrorDetail
        """
        super().__init__(**kwargs)
        self.error = error