stackit-observability 0.0.1a0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. stackit/observability/__init__.py +190 -0
  2. stackit/observability/api/__init__.py +4 -0
  3. stackit/observability/api/default_api.py +9455 -0
  4. stackit/observability/api_client.py +627 -0
  5. stackit/observability/api_response.py +23 -0
  6. stackit/observability/configuration.py +112 -0
  7. stackit/observability/exceptions.py +199 -0
  8. stackit/observability/models/__init__.py +171 -0
  9. stackit/observability/models/alert.py +125 -0
  10. stackit/observability/models/alert_config_receivers_response.py +97 -0
  11. stackit/observability/models/alert_config_route_response.py +93 -0
  12. stackit/observability/models/basic_auth.py +83 -0
  13. stackit/observability/models/create_alert_config_receiver_payload.py +152 -0
  14. stackit/observability/models/create_alert_config_receiver_payload_email_configs_inner.py +114 -0
  15. stackit/observability/models/create_alert_config_receiver_payload_opsgenie_configs_inner.py +94 -0
  16. stackit/observability/models/create_alert_config_receiver_payload_web_hook_configs_inner.py +92 -0
  17. stackit/observability/models/create_alert_config_route_payload.py +157 -0
  18. stackit/observability/models/create_alert_config_route_payload_routes_inner.py +119 -0
  19. stackit/observability/models/create_credentials_response.py +95 -0
  20. stackit/observability/models/create_instance_payload.py +88 -0
  21. stackit/observability/models/create_instance_response.py +90 -0
  22. stackit/observability/models/create_scrape_config_payload.py +267 -0
  23. stackit/observability/models/create_scrape_config_payload_basic_auth.py +87 -0
  24. stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner.py +133 -0
  25. stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2.py +115 -0
  26. stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config.py +90 -0
  27. stackit/observability/models/create_scrape_config_payload_metrics_relabel_configs_inner.py +146 -0
  28. stackit/observability/models/create_scrape_config_payload_static_configs_inner.py +88 -0
  29. stackit/observability/models/credentials.py +83 -0
  30. stackit/observability/models/credentials_remote_write_config.py +90 -0
  31. stackit/observability/models/credentials_remote_write_delete_response.py +83 -0
  32. stackit/observability/models/delete_scrape_config_response.py +97 -0
  33. stackit/observability/models/email_config.py +114 -0
  34. stackit/observability/models/error.py +83 -0
  35. stackit/observability/models/get_alert_configs_response.py +93 -0
  36. stackit/observability/models/get_credentials_response.py +92 -0
  37. stackit/observability/models/get_instance_response.py +164 -0
  38. stackit/observability/models/get_metrics_storage_retention_response.py +103 -0
  39. stackit/observability/models/get_scrape_config_response.py +90 -0
  40. stackit/observability/models/grafana_configs.py +99 -0
  41. stackit/observability/models/grafana_oauth.py +124 -0
  42. stackit/observability/models/http_service_sd.py +109 -0
  43. stackit/observability/models/inhibit_rules.py +120 -0
  44. stackit/observability/models/instance.py +155 -0
  45. stackit/observability/models/instance_response.py +82 -0
  46. stackit/observability/models/instance_sensitive_data.py +159 -0
  47. stackit/observability/models/job.py +207 -0
  48. stackit/observability/models/list_acl_response.py +83 -0
  49. stackit/observability/models/list_credentials_response.py +101 -0
  50. stackit/observability/models/list_instances_response.py +101 -0
  51. stackit/observability/models/list_scrape_configs_response.py +97 -0
  52. stackit/observability/models/message.py +82 -0
  53. stackit/observability/models/metrics_relabel_config.py +122 -0
  54. stackit/observability/models/model_global.py +125 -0
  55. stackit/observability/models/o_auth2.py +101 -0
  56. stackit/observability/models/opsgenie_config.py +98 -0
  57. stackit/observability/models/permission_denied.py +82 -0
  58. stackit/observability/models/plan.py +156 -0
  59. stackit/observability/models/plan_model.py +147 -0
  60. stackit/observability/models/plans_response.py +97 -0
  61. stackit/observability/models/project_instance_full.py +124 -0
  62. stackit/observability/models/receiver.py +93 -0
  63. stackit/observability/models/receivers.py +129 -0
  64. stackit/observability/models/route.py +135 -0
  65. stackit/observability/models/route_serializer.py +127 -0
  66. stackit/observability/models/scrape_configs_response.py +97 -0
  67. stackit/observability/models/service_keys_list.py +86 -0
  68. stackit/observability/models/static_configs.py +83 -0
  69. stackit/observability/models/tls_config.py +88 -0
  70. stackit/observability/models/update_acl_payload.py +82 -0
  71. stackit/observability/models/update_alert_config_receiver_payload.py +152 -0
  72. stackit/observability/models/update_alert_config_route_payload.py +157 -0
  73. stackit/observability/models/update_alert_configs_payload.py +133 -0
  74. stackit/observability/models/update_alert_configs_payload_global.py +139 -0
  75. stackit/observability/models/update_alert_configs_payload_inhibit_rules.py +113 -0
  76. stackit/observability/models/update_alert_configs_payload_receivers_inner.py +152 -0
  77. stackit/observability/models/update_alert_configs_payload_route.py +157 -0
  78. stackit/observability/models/update_alert_configs_response.py +93 -0
  79. stackit/observability/models/update_credentials_remote_write_config_payload.py +86 -0
  80. stackit/observability/models/update_grafana_configs_payload.py +109 -0
  81. stackit/observability/models/update_grafana_configs_payload_generic_oauth.py +135 -0
  82. stackit/observability/models/update_instance_payload.py +88 -0
  83. stackit/observability/models/update_metrics_storage_retention_payload.py +99 -0
  84. stackit/observability/models/update_scrape_config_payload.py +225 -0
  85. stackit/observability/models/update_scrape_config_payload_static_configs_inner.py +88 -0
  86. stackit/observability/models/web_hook.py +90 -0
  87. stackit/observability/py.typed +0 -0
  88. stackit/observability/rest.py +149 -0
  89. stackit_observability-0.0.1a0.dist-info/METADATA +44 -0
  90. stackit_observability-0.0.1a0.dist-info/RECORD +91 -0
  91. stackit_observability-0.0.1a0.dist-info/WHEEL +4 -0
@@ -0,0 +1,97 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Observability API
5
+
6
+ API endpoints for Observability on STACKIT
7
+
8
+ The version of the OpenAPI document: 1.1.1
9
+ Contact: stackit-argus@mail.schwarz
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501 docstring might be too long
14
+
15
+ from __future__ import annotations
16
+
17
+ import json
18
+ import pprint
19
+ from typing import Any, ClassVar, Dict, List, Optional, Set
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field
22
+ from typing_extensions import Annotated, Self
23
+
24
+ from stackit.observability.models.job import Job
25
+
26
+
27
+ class ScrapeConfigsResponse(BaseModel):
28
+ """
29
+ ScrapeConfigsResponse
30
+ """
31
+
32
+ data: List[Job]
33
+ message: Annotated[str, Field(min_length=1, strict=True)]
34
+ __properties: ClassVar[List[str]] = ["data", "message"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of ScrapeConfigsResponse from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ # override the default output from pydantic by calling `to_dict()` of each item in data (list)
74
+ _items = []
75
+ if self.data:
76
+ for _item in self.data:
77
+ if _item:
78
+ _items.append(_item.to_dict())
79
+ _dict["data"] = _items
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of ScrapeConfigsResponse from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate(
92
+ {
93
+ "data": [Job.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None,
94
+ "message": obj.get("message"),
95
+ }
96
+ )
97
+ return _obj
@@ -0,0 +1,86 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Observability API
5
+
6
+ API endpoints for Observability on STACKIT
7
+
8
+ The version of the OpenAPI document: 1.1.1
9
+ Contact: stackit-argus@mail.schwarz
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501 docstring might be too long
14
+
15
+ from __future__ import annotations
16
+
17
+ import json
18
+ import pprint
19
+ from typing import Any, ClassVar, Dict, List, Optional, Set
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
+ from typing_extensions import Annotated, Self
23
+
24
+
25
+ class ServiceKeysList(BaseModel):
26
+ """
27
+ ServiceKeysList
28
+ """
29
+
30
+ credentials_info: Optional[Dict[str, Optional[StrictStr]]] = Field(default=None, alias="credentialsInfo")
31
+ id: Annotated[str, Field(min_length=1, strict=True, max_length=200)]
32
+ name: Annotated[str, Field(min_length=1, strict=True, max_length=200)]
33
+ __properties: ClassVar[List[str]] = ["credentialsInfo", "id", "name"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of ServiceKeysList from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of ServiceKeysList from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate(
84
+ {"credentialsInfo": obj.get("credentialsInfo"), "id": obj.get("id"), "name": obj.get("name")}
85
+ )
86
+ return _obj
@@ -0,0 +1,83 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Observability API
5
+
6
+ API endpoints for Observability on STACKIT
7
+
8
+ The version of the OpenAPI document: 1.1.1
9
+ Contact: stackit-argus@mail.schwarz
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501 docstring might be too long
14
+
15
+ from __future__ import annotations
16
+
17
+ import json
18
+ import pprint
19
+ from typing import Any, ClassVar, Dict, List, Optional, Set
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field
22
+ from typing_extensions import Annotated, Self
23
+
24
+
25
+ class StaticConfigs(BaseModel):
26
+ """
27
+ StaticConfigs
28
+ """
29
+
30
+ labels: Optional[Dict[str, Annotated[str, Field(min_length=1, strict=True)]]] = None
31
+ targets: List[Annotated[str, Field(min_length=1, strict=True, max_length=400)]]
32
+ __properties: ClassVar[List[str]] = ["labels", "targets"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of StaticConfigs from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of StaticConfigs from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({"labels": obj.get("labels"), "targets": obj.get("targets")})
83
+ return _obj
@@ -0,0 +1,88 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Observability API
5
+
6
+ API endpoints for Observability on STACKIT
7
+
8
+ The version of the OpenAPI document: 1.1.1
9
+ Contact: stackit-argus@mail.schwarz
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501 docstring might be too long
14
+
15
+ from __future__ import annotations
16
+
17
+ import json
18
+ import pprint
19
+ from typing import Any, ClassVar, Dict, List, Optional, Set
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool
22
+ from typing_extensions import Self
23
+
24
+
25
+ class TLSConfig(BaseModel):
26
+ """
27
+ TLSConfig
28
+ """
29
+
30
+ insecure_skip_verify: Optional[StrictBool] = Field(default=False, alias="insecureSkipVerify")
31
+ __properties: ClassVar[List[str]] = ["insecureSkipVerify"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of TLSConfig from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([])
64
+
65
+ _dict = self.model_dump(
66
+ by_alias=True,
67
+ exclude=excluded_fields,
68
+ exclude_none=True,
69
+ )
70
+ return _dict
71
+
72
+ @classmethod
73
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
74
+ """Create an instance of TLSConfig from a dict"""
75
+ if obj is None:
76
+ return None
77
+
78
+ if not isinstance(obj, dict):
79
+ return cls.model_validate(obj)
80
+
81
+ _obj = cls.model_validate(
82
+ {
83
+ "insecureSkipVerify": (
84
+ obj.get("insecureSkipVerify") if obj.get("insecureSkipVerify") is not None else False
85
+ )
86
+ }
87
+ )
88
+ return _obj
@@ -0,0 +1,82 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Observability API
5
+
6
+ API endpoints for Observability on STACKIT
7
+
8
+ The version of the OpenAPI document: 1.1.1
9
+ Contact: stackit-argus@mail.schwarz
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501 docstring might be too long
14
+
15
+ from __future__ import annotations
16
+
17
+ import json
18
+ import pprint
19
+ from typing import Any, ClassVar, Dict, List, Optional, Set
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field
22
+ from typing_extensions import Annotated, Self
23
+
24
+
25
+ class UpdateACLPayload(BaseModel):
26
+ """
27
+ List of cidr. Send empty string to remove acl.
28
+ """
29
+
30
+ acl: List[Annotated[str, Field(strict=True, max_length=100)]] = Field(description="list of cidr")
31
+ __properties: ClassVar[List[str]] = ["acl"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of UpdateACLPayload from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([])
64
+
65
+ _dict = self.model_dump(
66
+ by_alias=True,
67
+ exclude=excluded_fields,
68
+ exclude_none=True,
69
+ )
70
+ return _dict
71
+
72
+ @classmethod
73
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
74
+ """Create an instance of UpdateACLPayload from a dict"""
75
+ if obj is None:
76
+ return None
77
+
78
+ if not isinstance(obj, dict):
79
+ return cls.model_validate(obj)
80
+
81
+ _obj = cls.model_validate({"acl": obj.get("acl")})
82
+ return _obj
@@ -0,0 +1,152 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Observability API
5
+
6
+ API endpoints for Observability on STACKIT
7
+
8
+ The version of the OpenAPI document: 1.1.1
9
+ Contact: stackit-argus@mail.schwarz
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501 docstring might be too long
14
+
15
+ from __future__ import annotations
16
+
17
+ import json
18
+ import pprint
19
+ from typing import Any, ClassVar, Dict, List, Optional, Set
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field
22
+ from typing_extensions import Annotated, Self
23
+
24
+ from stackit.observability.models.create_alert_config_receiver_payload_email_configs_inner import (
25
+ CreateAlertConfigReceiverPayloadEmailConfigsInner,
26
+ )
27
+ from stackit.observability.models.create_alert_config_receiver_payload_opsgenie_configs_inner import (
28
+ CreateAlertConfigReceiverPayloadOpsgenieConfigsInner,
29
+ )
30
+ from stackit.observability.models.create_alert_config_receiver_payload_web_hook_configs_inner import (
31
+ CreateAlertConfigReceiverPayloadWebHookConfigsInner,
32
+ )
33
+
34
+
35
+ class UpdateAlertConfigReceiverPayload(BaseModel):
36
+ """
37
+ Receivers
38
+ """
39
+
40
+ email_configs: Optional[List[CreateAlertConfigReceiverPayloadEmailConfigsInner]] = Field(
41
+ default=None, description="Email configurations", alias="emailConfigs"
42
+ )
43
+ name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field(
44
+ description="`Additional Validators:` * must be unique * should only include the characters: a-zA-Z0-9-"
45
+ )
46
+ opsgenie_configs: Optional[List[CreateAlertConfigReceiverPayloadOpsgenieConfigsInner]] = Field(
47
+ default=None, description="Configuration for ops genie.", alias="opsgenieConfigs"
48
+ )
49
+ web_hook_configs: Optional[List[CreateAlertConfigReceiverPayloadWebHookConfigsInner]] = Field(
50
+ default=None, alias="webHookConfigs"
51
+ )
52
+ __properties: ClassVar[List[str]] = ["emailConfigs", "name", "opsgenieConfigs", "webHookConfigs"]
53
+
54
+ model_config = ConfigDict(
55
+ populate_by_name=True,
56
+ validate_assignment=True,
57
+ protected_namespaces=(),
58
+ )
59
+
60
+ def to_str(self) -> str:
61
+ """Returns the string representation of the model using alias"""
62
+ return pprint.pformat(self.model_dump(by_alias=True))
63
+
64
+ def to_json(self) -> str:
65
+ """Returns the JSON representation of the model using alias"""
66
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
67
+ return json.dumps(self.to_dict())
68
+
69
+ @classmethod
70
+ def from_json(cls, json_str: str) -> Optional[Self]:
71
+ """Create an instance of UpdateAlertConfigReceiverPayload from a JSON string"""
72
+ return cls.from_dict(json.loads(json_str))
73
+
74
+ def to_dict(self) -> Dict[str, Any]:
75
+ """Return the dictionary representation of the model using alias.
76
+
77
+ This has the following differences from calling pydantic's
78
+ `self.model_dump(by_alias=True)`:
79
+
80
+ * `None` is only added to the output dict for nullable fields that
81
+ were set at model initialization. Other fields with value `None`
82
+ are ignored.
83
+ """
84
+ excluded_fields: Set[str] = set([])
85
+
86
+ _dict = self.model_dump(
87
+ by_alias=True,
88
+ exclude=excluded_fields,
89
+ exclude_none=True,
90
+ )
91
+ # override the default output from pydantic by calling `to_dict()` of each item in email_configs (list)
92
+ _items = []
93
+ if self.email_configs:
94
+ for _item in self.email_configs:
95
+ if _item:
96
+ _items.append(_item.to_dict())
97
+ _dict["emailConfigs"] = _items
98
+ # override the default output from pydantic by calling `to_dict()` of each item in opsgenie_configs (list)
99
+ _items = []
100
+ if self.opsgenie_configs:
101
+ for _item in self.opsgenie_configs:
102
+ if _item:
103
+ _items.append(_item.to_dict())
104
+ _dict["opsgenieConfigs"] = _items
105
+ # override the default output from pydantic by calling `to_dict()` of each item in web_hook_configs (list)
106
+ _items = []
107
+ if self.web_hook_configs:
108
+ for _item in self.web_hook_configs:
109
+ if _item:
110
+ _items.append(_item.to_dict())
111
+ _dict["webHookConfigs"] = _items
112
+ return _dict
113
+
114
+ @classmethod
115
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
116
+ """Create an instance of UpdateAlertConfigReceiverPayload from a dict"""
117
+ if obj is None:
118
+ return None
119
+
120
+ if not isinstance(obj, dict):
121
+ return cls.model_validate(obj)
122
+
123
+ _obj = cls.model_validate(
124
+ {
125
+ "emailConfigs": (
126
+ [
127
+ CreateAlertConfigReceiverPayloadEmailConfigsInner.from_dict(_item)
128
+ for _item in obj["emailConfigs"]
129
+ ]
130
+ if obj.get("emailConfigs") is not None
131
+ else None
132
+ ),
133
+ "name": obj.get("name"),
134
+ "opsgenieConfigs": (
135
+ [
136
+ CreateAlertConfigReceiverPayloadOpsgenieConfigsInner.from_dict(_item)
137
+ for _item in obj["opsgenieConfigs"]
138
+ ]
139
+ if obj.get("opsgenieConfigs") is not None
140
+ else None
141
+ ),
142
+ "webHookConfigs": (
143
+ [
144
+ CreateAlertConfigReceiverPayloadWebHookConfigsInner.from_dict(_item)
145
+ for _item in obj["webHookConfigs"]
146
+ ]
147
+ if obj.get("webHookConfigs") is not None
148
+ else None
149
+ ),
150
+ }
151
+ )
152
+ return _obj