Skip to content

Commit 8226126

Browse files
expobrainGithub Actions
andauthored
feat: Updated API at 2024-03-18 (#418)
Co-authored-by: Github Actions <[email protected]>
1 parent 96a4fa8 commit 8226126

17 files changed

+211
-93
lines changed

incident_io_client/api/catalog_v2/catalog_v2_create_type.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ def sync_detailed(
6969
body (CatalogV2CreateTypeRequestBody): Example: {'annotations': {'incident.io/catalog-
7070
importer/id': 'id-of-config'}, 'color': 'yellow', 'description': 'Represents Kubernetes
7171
clusters that we run inside of GKE.', 'icon': 'bolt', 'name': 'Kubernetes Cluster',
72-
'ranked': True, 'type_name': 'Custom["BackstageGroup"]'}.
72+
'ranked': True, 'source_repo_url': 'https://github.com/my-company/incident-io-catalog',
73+
'type_name': 'Custom["BackstageGroup"]'}.
7374
7475
Raises:
7576
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -103,7 +104,8 @@ def sync(
103104
body (CatalogV2CreateTypeRequestBody): Example: {'annotations': {'incident.io/catalog-
104105
importer/id': 'id-of-config'}, 'color': 'yellow', 'description': 'Represents Kubernetes
105106
clusters that we run inside of GKE.', 'icon': 'bolt', 'name': 'Kubernetes Cluster',
106-
'ranked': True, 'type_name': 'Custom["BackstageGroup"]'}.
107+
'ranked': True, 'source_repo_url': 'https://github.com/my-company/incident-io-catalog',
108+
'type_name': 'Custom["BackstageGroup"]'}.
107109
108110
Raises:
109111
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -132,7 +134,8 @@ async def asyncio_detailed(
132134
body (CatalogV2CreateTypeRequestBody): Example: {'annotations': {'incident.io/catalog-
133135
importer/id': 'id-of-config'}, 'color': 'yellow', 'description': 'Represents Kubernetes
134136
clusters that we run inside of GKE.', 'icon': 'bolt', 'name': 'Kubernetes Cluster',
135-
'ranked': True, 'type_name': 'Custom["BackstageGroup"]'}.
137+
'ranked': True, 'source_repo_url': 'https://github.com/my-company/incident-io-catalog',
138+
'type_name': 'Custom["BackstageGroup"]'}.
136139
137140
Raises:
138141
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -164,7 +167,8 @@ async def asyncio(
164167
body (CatalogV2CreateTypeRequestBody): Example: {'annotations': {'incident.io/catalog-
165168
importer/id': 'id-of-config'}, 'color': 'yellow', 'description': 'Represents Kubernetes
166169
clusters that we run inside of GKE.', 'icon': 'bolt', 'name': 'Kubernetes Cluster',
167-
'ranked': True, 'type_name': 'Custom["BackstageGroup"]'}.
170+
'ranked': True, 'source_repo_url': 'https://github.com/my-company/incident-io-catalog',
171+
'type_name': 'Custom["BackstageGroup"]'}.
168172
169173
Raises:
170174
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

incident_io_client/api/catalog_v2/catalog_v2_update_type.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def sync_detailed(
7474
body (CatalogV2UpdateTypeRequestBody): Example: {'annotations': {'incident.io/catalog-
7575
importer/id': 'id-of-config'}, 'color': 'yellow', 'description': 'Represents Kubernetes
7676
clusters that we run inside of GKE.', 'icon': 'bolt', 'name': 'Kubernetes Cluster',
77-
'ranked': True}.
77+
'ranked': True, 'source_repo_url': 'https://github.com/my-company/incident-io-catalog'}.
7878
7979
Raises:
8080
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -111,7 +111,7 @@ def sync(
111111
body (CatalogV2UpdateTypeRequestBody): Example: {'annotations': {'incident.io/catalog-
112112
importer/id': 'id-of-config'}, 'color': 'yellow', 'description': 'Represents Kubernetes
113113
clusters that we run inside of GKE.', 'icon': 'bolt', 'name': 'Kubernetes Cluster',
114-
'ranked': True}.
114+
'ranked': True, 'source_repo_url': 'https://github.com/my-company/incident-io-catalog'}.
115115
116116
Raises:
117117
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -143,7 +143,7 @@ async def asyncio_detailed(
143143
body (CatalogV2UpdateTypeRequestBody): Example: {'annotations': {'incident.io/catalog-
144144
importer/id': 'id-of-config'}, 'color': 'yellow', 'description': 'Represents Kubernetes
145145
clusters that we run inside of GKE.', 'icon': 'bolt', 'name': 'Kubernetes Cluster',
146-
'ranked': True}.
146+
'ranked': True, 'source_repo_url': 'https://github.com/my-company/incident-io-catalog'}.
147147
148148
Raises:
149149
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -178,7 +178,7 @@ async def asyncio(
178178
body (CatalogV2UpdateTypeRequestBody): Example: {'annotations': {'incident.io/catalog-
179179
importer/id': 'id-of-config'}, 'color': 'yellow', 'description': 'Represents Kubernetes
180180
clusters that we run inside of GKE.', 'icon': 'bolt', 'name': 'Kubernetes Cluster',
181-
'ranked': True}.
181+
'ranked': True, 'source_repo_url': 'https://github.com/my-company/incident-io-catalog'}.
182182
183183
Raises:
184184
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

incident_io_client/errors.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ def __init__(self, status_code: int, content: bytes):
88
self.status_code = status_code
99
self.content = content
1010

11-
super().__init__(f"Unexpected status code: {status_code}")
11+
super().__init__(
12+
f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}"
13+
)
1214

1315

1416
__all__ = ["UnexpectedStatus"]

incident_io_client/models/catalog_type_v2_response_body.py

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ class CatalogTypeV2ResponseBody:
2828
{'annotations': {'incident.io/catalog-importer/id': 'id-of-config'}, 'color': 'yellow', 'created_at':
2929
'2021-08-17T13:28:57.801578Z', 'description': 'Represents Kubernetes clusters that we run inside of GKE.',
3030
'dynamic_resource_parameter': 'abc123', 'estimated_count': 7, 'icon': 'bolt', 'id':
31-
'01FCNDV6P870EA6S7TK1DSYDG0', 'is_editable': False, 'name': 'Kubernetes Cluster', 'ranked': True,
32-
'registry_type': 'PagerDutyService', 'required_integrations': ['pager_duty'], 'schema': {'attributes':
33-
[{'array': False, 'id': '01GW2G3V0S59R238FAHPDS1R66', 'mode': 'manual', 'name': 'tier', 'type':
34-
'Custom["Service"]'}], 'version': 1}, 'semantic_type': 'custom', 'type_name': 'Custom["BackstageGroup"]',
35-
'updated_at': '2021-08-17T13:28:57.801578Z'}
31+
'01FCNDV6P870EA6S7TK1DSYDG0', 'is_editable': False, 'last_synced_at': '2021-08-17T13:28:57.801578Z', 'name':
32+
'Kubernetes Cluster', 'ranked': True, 'registry_type': 'PagerDutyService', 'required_integrations':
33+
['pager_duty'], 'schema': {'attributes': [{'array': False, 'id': '01GW2G3V0S59R238FAHPDS1R66', 'mode': 'manual',
34+
'name': 'tier', 'type': 'Custom["Service"]'}], 'version': 1}, 'semantic_type': 'custom', 'source_repo_url':
35+
'https://github.com/my-company/incident-io-catalog', 'type_name': 'Custom["BackstageGroup"]', 'updated_at':
36+
'2021-08-17T13:28:57.801578Z'}
3637
3738
Attributes:
3839
annotations (CatalogTypeV2ResponseBodyAnnotations): Annotations that can track metadata about this type Example:
@@ -56,10 +57,14 @@ class CatalogTypeV2ResponseBody:
5657
dynamic_resource_parameter (Union[Unset, str]): If this is a dynamic catalog type, this will be the unique
5758
parameter for identitfying this resource externally. Example: abc123.
5859
estimated_count (Union[Unset, int]): If populated, gives an estimated count of entries for this type Example: 7.
60+
last_synced_at (Union[Unset, datetime.datetime]): When this type was last synced (if it's ever been sync'd)
61+
Example: 2021-08-17T13:28:57.801578Z.
5962
registry_type (Union[Unset, str]): The registry resource this type is synced from, if any Example:
6063
PagerDutyService.
6164
required_integrations (Union[Unset, List[str]]): If populated, the integrations required for this type Example:
6265
['pager_duty'].
66+
source_repo_url (Union[Unset, str]): The url of the external repository where this type is managed Example:
67+
https://github.com/my-company/incident-io-catalog.
6368
"""
6469

6570
annotations: "CatalogTypeV2ResponseBodyAnnotations"
@@ -77,8 +82,10 @@ class CatalogTypeV2ResponseBody:
7782
updated_at: datetime.datetime
7883
dynamic_resource_parameter: Union[Unset, str] = UNSET
7984
estimated_count: Union[Unset, int] = UNSET
85+
last_synced_at: Union[Unset, datetime.datetime] = UNSET
8086
registry_type: Union[Unset, str] = UNSET
8187
required_integrations: Union[Unset, List[str]] = UNSET
88+
source_repo_url: Union[Unset, str] = UNSET
8289
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
8390

8491
def to_dict(self) -> Dict[str, Any]:
@@ -112,12 +119,18 @@ def to_dict(self) -> Dict[str, Any]:
112119

113120
estimated_count = self.estimated_count
114121

122+
last_synced_at: Union[Unset, str] = UNSET
123+
if not isinstance(self.last_synced_at, Unset):
124+
last_synced_at = self.last_synced_at.isoformat()
125+
115126
registry_type = self.registry_type
116127

117128
required_integrations: Union[Unset, List[str]] = UNSET
118129
if not isinstance(self.required_integrations, Unset):
119130
required_integrations = self.required_integrations
120131

132+
source_repo_url = self.source_repo_url
133+
121134
field_dict: Dict[str, Any] = {}
122135
field_dict.update(self.additional_properties)
123136
field_dict.update(
@@ -141,10 +154,14 @@ def to_dict(self) -> Dict[str, Any]:
141154
field_dict["dynamic_resource_parameter"] = dynamic_resource_parameter
142155
if estimated_count is not UNSET:
143156
field_dict["estimated_count"] = estimated_count
157+
if last_synced_at is not UNSET:
158+
field_dict["last_synced_at"] = last_synced_at
144159
if registry_type is not UNSET:
145160
field_dict["registry_type"] = registry_type
146161
if required_integrations is not UNSET:
147162
field_dict["required_integrations"] = required_integrations
163+
if source_repo_url is not UNSET:
164+
field_dict["source_repo_url"] = source_repo_url
148165

149166
return field_dict
150167

@@ -188,10 +205,19 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
188205

189206
estimated_count = d.pop("estimated_count", UNSET)
190207

208+
_last_synced_at = d.pop("last_synced_at", UNSET)
209+
last_synced_at: Union[Unset, datetime.datetime]
210+
if isinstance(_last_synced_at, Unset):
211+
last_synced_at = UNSET
212+
else:
213+
last_synced_at = isoparse(_last_synced_at)
214+
191215
registry_type = d.pop("registry_type", UNSET)
192216

193217
required_integrations = cast(List[str], d.pop("required_integrations", UNSET))
194218

219+
source_repo_url = d.pop("source_repo_url", UNSET)
220+
195221
catalog_type_v2_response_body = cls(
196222
annotations=annotations,
197223
color=color,
@@ -208,8 +234,10 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
208234
updated_at=updated_at,
209235
dynamic_resource_parameter=dynamic_resource_parameter,
210236
estimated_count=estimated_count,
237+
last_synced_at=last_synced_at,
211238
registry_type=registry_type,
212239
required_integrations=required_integrations,
240+
source_repo_url=source_repo_url,
213241
)
214242

215243
catalog_type_v2_response_body.additional_properties = d

incident_io_client/models/catalog_v2_create_type_request_body.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ class CatalogV2CreateTypeRequestBody:
2626
Example:
2727
{'annotations': {'incident.io/catalog-importer/id': 'id-of-config'}, 'color': 'yellow', 'description':
2828
'Represents Kubernetes clusters that we run inside of GKE.', 'icon': 'bolt', 'name': 'Kubernetes Cluster',
29-
'ranked': True, 'type_name': 'Custom["BackstageGroup"]'}
29+
'ranked': True, 'source_repo_url': 'https://github.com/my-company/incident-io-catalog', 'type_name':
30+
'Custom["BackstageGroup"]'}
3031
3132
Attributes:
3233
description (str): Human readble description of this type Example: Represents Kubernetes clusters that we run
@@ -39,6 +40,8 @@ class CatalogV2CreateTypeRequestBody:
3940
icon (Union[Unset, CatalogV2CreateTypeRequestBodyIcon]): Sets the display icon of this type in the dashboard
4041
Example: bolt.
4142
ranked (Union[Unset, bool]): If this type should be ranked Example: True.
43+
source_repo_url (Union[Unset, str]): The url of the external repository where this type is managed Example:
44+
https://github.com/my-company/incident-io-catalog.
4245
type_name (Union[Unset, str]): The type name of this catalog type, to be used when defining attributes. This is
4346
immutable once a CatalogType has been created. For non-externally sync types, it must follow the pattern
4447
Custom["SomeName "] Example: Custom["BackstageGroup"].
@@ -50,6 +53,7 @@ class CatalogV2CreateTypeRequestBody:
5053
color: Union[Unset, CatalogV2CreateTypeRequestBodyColor] = UNSET
5154
icon: Union[Unset, CatalogV2CreateTypeRequestBodyIcon] = UNSET
5255
ranked: Union[Unset, bool] = UNSET
56+
source_repo_url: Union[Unset, str] = UNSET
5357
type_name: Union[Unset, str] = UNSET
5458
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
5559

@@ -72,6 +76,8 @@ def to_dict(self) -> Dict[str, Any]:
7276

7377
ranked = self.ranked
7478

79+
source_repo_url = self.source_repo_url
80+
7581
type_name = self.type_name
7682

7783
field_dict: Dict[str, Any] = {}
@@ -90,6 +96,8 @@ def to_dict(self) -> Dict[str, Any]:
9096
field_dict["icon"] = icon
9197
if ranked is not UNSET:
9298
field_dict["ranked"] = ranked
99+
if source_repo_url is not UNSET:
100+
field_dict["source_repo_url"] = source_repo_url
93101
if type_name is not UNSET:
94102
field_dict["type_name"] = type_name
95103

@@ -129,6 +137,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
129137

130138
ranked = d.pop("ranked", UNSET)
131139

140+
source_repo_url = d.pop("source_repo_url", UNSET)
141+
132142
type_name = d.pop("type_name", UNSET)
133143

134144
catalog_v2_create_type_request_body = cls(
@@ -138,6 +148,7 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
138148
color=color,
139149
icon=icon,
140150
ranked=ranked,
151+
source_repo_url=source_repo_url,
141152
type_name=type_name,
142153
)
143154

incident_io_client/models/catalog_v2_create_type_response_body.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,23 @@ class CatalogV2CreateTypeResponseBody:
1717
{'catalog_type': {'annotations': {'incident.io/catalog-importer/id': 'id-of-config'}, 'color': 'yellow',
1818
'created_at': '2021-08-17T13:28:57.801578Z', 'description': 'Represents Kubernetes clusters that we run inside
1919
of GKE.', 'dynamic_resource_parameter': 'abc123', 'estimated_count': 7, 'icon': 'bolt', 'id':
20-
'01FCNDV6P870EA6S7TK1DSYDG0', 'is_editable': False, 'name': 'Kubernetes Cluster', 'ranked': True,
21-
'registry_type': 'PagerDutyService', 'required_integrations': ['pager_duty'], 'schema': {'attributes':
22-
[{'array': False, 'id': '01GW2G3V0S59R238FAHPDS1R66', 'mode': 'manual', 'name': 'tier', 'type':
23-
'Custom["Service"]'}], 'version': 1}, 'semantic_type': 'custom', 'type_name': 'Custom["BackstageGroup"]',
24-
'updated_at': '2021-08-17T13:28:57.801578Z'}}
20+
'01FCNDV6P870EA6S7TK1DSYDG0', 'is_editable': False, 'last_synced_at': '2021-08-17T13:28:57.801578Z', 'name':
21+
'Kubernetes Cluster', 'ranked': True, 'registry_type': 'PagerDutyService', 'required_integrations':
22+
['pager_duty'], 'schema': {'attributes': [{'array': False, 'id': '01GW2G3V0S59R238FAHPDS1R66', 'mode': 'manual',
23+
'name': 'tier', 'type': 'Custom["Service"]'}], 'version': 1}, 'semantic_type': 'custom', 'source_repo_url':
24+
'https://github.com/my-company/incident-io-catalog', 'type_name': 'Custom["BackstageGroup"]', 'updated_at':
25+
'2021-08-17T13:28:57.801578Z'}}
2526
2627
Attributes:
2728
catalog_type (CatalogTypeV2ResponseBody): Example: {'annotations': {'incident.io/catalog-importer/id': 'id-of-
2829
config'}, 'color': 'yellow', 'created_at': '2021-08-17T13:28:57.801578Z', 'description': 'Represents Kubernetes
2930
clusters that we run inside of GKE.', 'dynamic_resource_parameter': 'abc123', 'estimated_count': 7, 'icon':
30-
'bolt', 'id': '01FCNDV6P870EA6S7TK1DSYDG0', 'is_editable': False, 'name': 'Kubernetes Cluster', 'ranked': True,
31-
'registry_type': 'PagerDutyService', 'required_integrations': ['pager_duty'], 'schema': {'attributes':
32-
[{'array': False, 'id': '01GW2G3V0S59R238FAHPDS1R66', 'mode': 'manual', 'name': 'tier', 'type':
33-
'Custom["Service"]'}], 'version': 1}, 'semantic_type': 'custom', 'type_name': 'Custom["BackstageGroup"]',
34-
'updated_at': '2021-08-17T13:28:57.801578Z'}.
31+
'bolt', 'id': '01FCNDV6P870EA6S7TK1DSYDG0', 'is_editable': False, 'last_synced_at':
32+
'2021-08-17T13:28:57.801578Z', 'name': 'Kubernetes Cluster', 'ranked': True, 'registry_type':
33+
'PagerDutyService', 'required_integrations': ['pager_duty'], 'schema': {'attributes': [{'array': False, 'id':
34+
'01GW2G3V0S59R238FAHPDS1R66', 'mode': 'manual', 'name': 'tier', 'type': 'Custom["Service"]'}], 'version': 1},
35+
'semantic_type': 'custom', 'source_repo_url': 'https://github.com/my-company/incident-io-catalog', 'type_name':
36+
'Custom["BackstageGroup"]', 'updated_at': '2021-08-17T13:28:57.801578Z'}.
3537
"""
3638

3739
catalog_type: "CatalogTypeV2ResponseBody"

0 commit comments

Comments
 (0)