main
py 67 lines 1.69 KB
Raw
1 from enum import Enum
2 from typing import Any
3 from typing import Dict
4
5 from pydantic import BaseModel
6 from pydantic import Field
7 from pydantic import model_validator
8
9
10 class PipelineRuleTitles(Enum):
11 WAZUH_INFO = "WAZUH CREATE FIELD SYSLOG LEVEL - INFO"
12 WAZUH_WARNING = "WAZUH CREATE FIELD SYSLOG LEVEL - WARNING"
13 WAZUH_NOTICE = "WAZUH CREATE FIELD SYSLOG LEVEL - NOTICE"
14 WAZUH_ALERT = "WAZUH CREATE FIELD SYSLOG LEVEL - ALERT"
15 OFFICE365_TIMESTAMP = "Office365 Timestamp - UTC"
16
17
18 class PipelineTitles(Enum):
19 OFFICE365 = "OFFICE365 PROCESSING PIPELINE"
20
21
22 class ProvisionOffice365Request(BaseModel):
23 customer_code: str = Field(
24 ...,
25 description="The customer code.",
26 examples=["00002"],
27 )
28 integration_name: str = Field(
29 "Office365",
30 description="The integration name.",
31 examples=["Office365"],
32 )
33
34 # ensure the `integration_name` is always set to "Office365"
35 @model_validator(mode="before")
36 @classmethod
37 def set_integration_name(cls, values: Dict[str, Any]) -> Dict[str, Any]:
38 values["integration_name"] = "Office365"
39 return values
40
41
42 class ProvisionOffice365Response(BaseModel):
43 success: bool
44 message: str
45
46
47 class ProvisionOffice365AuthKeys(BaseModel):
48 TENANT_ID: str = Field(
49 ...,
50 description="The tenant id.",
51 examples=["00002"],
52 )
53 CLIENT_ID: str = Field(
54 ...,
55 description="The client id.",
56 examples=["00002"],
57 )
58 CLIENT_SECRET: str = Field(
59 ...,
60 description="The client secret.",
61 examples=["00002"],
62 )
63 API_TYPE: str = Field(
64 ...,
65 description="The api type.",
66 examples=["00002"],
67 )