-
Notifications
You must be signed in to change notification settings - Fork 87
Expand file tree
/
Copy pathattack_simulation_operation.py
More file actions
71 lines (61 loc) · 3 KB
/
attack_simulation_operation.py
File metadata and controls
71 lines (61 loc) · 3 KB
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
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass, field
from kiota_abstractions.serialization import Parsable, ParseNode, SerializationWriter
from typing import Any, Optional, TYPE_CHECKING, Union
if TYPE_CHECKING:
from .attack_simulation_operation_type import AttackSimulationOperationType
from .long_running_operation import LongRunningOperation
from .long_running_operation import LongRunningOperation
@dataclass
class AttackSimulationOperation(LongRunningOperation, Parsable):
"""
The status of a long-running operation.
"""
# The OdataType property
odata_type: Optional[str] = None
# Percentage of completion of the respective operation.
percentage_completed: Optional[int] = None
# Tenant identifier.
tenant_id: Optional[str] = None
# The attack simulation operation type. The possible values are: createSimulation, updateSimulation, unknownFutureValue.
type: Optional[AttackSimulationOperationType] = None
@staticmethod
def create_from_discriminator_value(parse_node: ParseNode) -> AttackSimulationOperation:
"""
Creates a new instance of the appropriate class based on discriminator value
param parse_node: The parse node to use to read the discriminator value and create the object
Returns: AttackSimulationOperation
"""
if parse_node is None:
raise TypeError("parse_node cannot be null.")
return AttackSimulationOperation()
def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
"""
The deserialization information for the current model
Returns: dict[str, Callable[[ParseNode], None]]
"""
from .attack_simulation_operation_type import AttackSimulationOperationType
from .long_running_operation import LongRunningOperation
from .attack_simulation_operation_type import AttackSimulationOperationType
from .long_running_operation import LongRunningOperation
fields: dict[str, Callable[[Any], None]] = {
"percentageCompleted": lambda n : setattr(self, 'percentage_completed', n.get_int_value()),
"tenantId": lambda n : setattr(self, 'tenant_id', n.get_str_value()),
"type": lambda n : setattr(self, 'type', n.get_enum_value(AttackSimulationOperationType)),
}
super_fields = super().get_field_deserializers()
fields.update(super_fields)
return fields
def serialize(self,writer: SerializationWriter) -> None:
"""
Serializes information the current object
param writer: Serialization writer to use to serialize this model
Returns: None
"""
if writer is None:
raise TypeError("writer cannot be null.")
super().serialize(writer)
writer.write_int_value("percentageCompleted", self.percentage_completed)
writer.write_str_value("tenantId", self.tenant_id)
writer.write_enum_value("type", self.type)