Skip to content

Commit 6b7e828

Browse files
Generate telemetryrouter
1 parent 1616198 commit 6b7e828

9 files changed

Lines changed: 131 additions & 11 deletions
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
915f82be0b0f434901fcedc91fafe58b652035ef
1+
ef9232ba8d49c72fc3397a365b09ca1a8205b25e

‎services/telemetryrouter/src/stackit/telemetryrouter/models/config_filter_attributes.py‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515

1616
import json
1717
import pprint
18+
import re # noqa: F401
1819
from typing import Any, ClassVar, Dict, List, Optional, Set
1920

20-
from pydantic import BaseModel, ConfigDict, Field
21+
from pydantic import BaseModel, ConfigDict, Field, field_validator
2122
from pydantic_core import to_jsonable_python
2223
from typing_extensions import Annotated, Self
2324

@@ -38,6 +39,16 @@ class ConfigFilterAttributes(BaseModel):
3839
]
3940
__properties: ClassVar[List[str]] = ["key", "level", "matcher", "values"]
4041

42+
@field_validator("key")
43+
def key_validate_regular_expression(cls, value):
44+
"""Validates the regular expression"""
45+
if not isinstance(value, str):
46+
value = str(value)
47+
48+
if not re.match(r"^[^\0-\x1F\x7F-\x9F]+$", value):
49+
raise ValueError(r"must validate the regular expression /^[^\0-\x1F\x7F-\x9F]+$/")
50+
return value
51+
4152
model_config = ConfigDict(
4253
validate_by_name=True,
4354
validate_by_alias=True,

‎services/telemetryrouter/src/stackit/telemetryrouter/models/create_telemetry_router_payload.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import re # noqa: F401
1919
from typing import Any, ClassVar, Dict, List, Optional, Set
2020

21-
from pydantic import BaseModel, ConfigDict, Field, field_validator
21+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
2222
from pydantic_core import to_jsonable_python
2323
from typing_extensions import Annotated, Self
2424

@@ -38,7 +38,8 @@ class CreateTelemetryRouterPayload(BaseModel):
3838
description="The display name is a short name chosen by the user to identify the resource.", alias="displayName"
3939
)
4040
filter: Optional[ConfigFilter] = None
41-
__properties: ClassVar[List[str]] = ["description", "displayName", "filter"]
41+
resource_labels: Optional[Dict[str, StrictStr]] = Field(default=None, alias="resourceLabels")
42+
__properties: ClassVar[List[str]] = ["description", "displayName", "filter", "resourceLabels"]
4243

4344
@field_validator("description")
4445
def description_validate_regular_expression(cls, value):
@@ -119,6 +120,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
119120
"description": obj.get("description"),
120121
"displayName": obj.get("displayName"),
121122
"filter": ConfigFilter.from_dict(obj["filter"]) if obj.get("filter") is not None else None,
123+
"resourceLabels": obj.get("resourceLabels"),
122124
}
123125
)
124126
return _obj

‎services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_open_telemetry.py‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515

1616
import json
1717
import pprint
18+
import re # noqa: F401
1819
from typing import Any, ClassVar, Dict, List, Optional, Set
1920

20-
from pydantic import BaseModel, ConfigDict, Field
21+
from pydantic import BaseModel, ConfigDict, Field, field_validator
2122
from pydantic_core import to_jsonable_python
2223
from typing_extensions import Annotated, Self
2324

@@ -38,6 +39,29 @@ class DestinationConfigOpenTelemetry(BaseModel):
3839
uri: Annotated[str, Field(strict=True, max_length=1024)] = Field(description="The URI for reaching the resource.")
3940
__properties: ClassVar[List[str]] = ["basicAuth", "bearerToken", "uri"]
4041

42+
@field_validator("bearer_token")
43+
def bearer_token_validate_regular_expression(cls, value):
44+
"""Validates the regular expression"""
45+
if value is None:
46+
return value
47+
48+
if not isinstance(value, str):
49+
value = str(value)
50+
51+
if not re.match(r"^[^\0-\x1F\x7F-\x9F]+$", value):
52+
raise ValueError(r"must validate the regular expression /^[^\0-\x1F\x7F-\x9F]+$/")
53+
return value
54+
55+
@field_validator("uri")
56+
def uri_validate_regular_expression(cls, value):
57+
"""Validates the regular expression"""
58+
if not isinstance(value, str):
59+
value = str(value)
60+
61+
if not re.match(r"^[^\0-\x1F\x7F-\x9F]+$", value):
62+
raise ValueError(r"must validate the regular expression /^[^\0-\x1F\x7F-\x9F]+$/")
63+
return value
64+
4165
model_config = ConfigDict(
4266
validate_by_name=True,
4367
validate_by_alias=True,

‎services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_open_telemetry_basic_auth.py‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515

1616
import json
1717
import pprint
18+
import re # noqa: F401
1819
from typing import Any, ClassVar, Dict, List, Optional, Set
1920

20-
from pydantic import BaseModel, ConfigDict, Field
21+
from pydantic import BaseModel, ConfigDict, Field, field_validator
2122
from pydantic_core import to_jsonable_python
2223
from typing_extensions import Annotated, Self
2324

@@ -31,6 +32,26 @@ class DestinationConfigOpenTelemetryBasicAuth(BaseModel):
3132
username: Annotated[str, Field(min_length=1, strict=True, max_length=1024)]
3233
__properties: ClassVar[List[str]] = ["password", "username"]
3334

35+
@field_validator("password")
36+
def password_validate_regular_expression(cls, value):
37+
"""Validates the regular expression"""
38+
if not isinstance(value, str):
39+
value = str(value)
40+
41+
if not re.match(r"^[^\0-\x1F\x7F-\x9F]+$", value):
42+
raise ValueError(r"must validate the regular expression /^[^\0-\x1F\x7F-\x9F]+$/")
43+
return value
44+
45+
@field_validator("username")
46+
def username_validate_regular_expression(cls, value):
47+
"""Validates the regular expression"""
48+
if not isinstance(value, str):
49+
value = str(value)
50+
51+
if not re.match(r"^[^\0-\x1F\x7F-\x9F]+$", value):
52+
raise ValueError(r"must validate the regular expression /^[^\0-\x1F\x7F-\x9F]+$/")
53+
return value
54+
3455
model_config = ConfigDict(
3556
validate_by_name=True,
3657
validate_by_alias=True,

‎services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_s3.py‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515

1616
import json
1717
import pprint
18+
import re # noqa: F401
1819
from typing import Any, ClassVar, Dict, List, Optional, Set
1920

20-
from pydantic import BaseModel, ConfigDict, Field
21+
from pydantic import BaseModel, ConfigDict, Field, field_validator
2122
from pydantic_core import to_jsonable_python
2223
from typing_extensions import Annotated, Self
2324

@@ -38,6 +39,26 @@ class DestinationConfigS3(BaseModel):
3839
)
3940
__properties: ClassVar[List[str]] = ["accessKey", "bucket", "endpoint"]
4041

42+
@field_validator("bucket")
43+
def bucket_validate_regular_expression(cls, value):
44+
"""Validates the regular expression"""
45+
if not isinstance(value, str):
46+
value = str(value)
47+
48+
if not re.match(r"^[a-z0-9\-]+$", value):
49+
raise ValueError(r"must validate the regular expression /^[a-z0-9\-]+$/")
50+
return value
51+
52+
@field_validator("endpoint")
53+
def endpoint_validate_regular_expression(cls, value):
54+
"""Validates the regular expression"""
55+
if not isinstance(value, str):
56+
value = str(value)
57+
58+
if not re.match(r"^[^\0-\x1F\x7F-\x9F]+$", value):
59+
raise ValueError(r"must validate the regular expression /^[^\0-\x1F\x7F-\x9F]+$/")
60+
return value
61+
4162
model_config = ConfigDict(
4263
validate_by_name=True,
4364
validate_by_alias=True,

‎services/telemetryrouter/src/stackit/telemetryrouter/models/destination_config_s3_access_key.py‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515

1616
import json
1717
import pprint
18+
import re # noqa: F401
1819
from typing import Any, ClassVar, Dict, List, Optional, Set
1920

20-
from pydantic import BaseModel, ConfigDict, Field
21+
from pydantic import BaseModel, ConfigDict, Field, field_validator
2122
from pydantic_core import to_jsonable_python
2223
from typing_extensions import Annotated, Self
2324

@@ -31,6 +32,26 @@ class DestinationConfigS3AccessKey(BaseModel):
3132
secret: Annotated[str, Field(min_length=1, strict=True, max_length=1024)]
3233
__properties: ClassVar[List[str]] = ["id", "secret"]
3334

35+
@field_validator("id")
36+
def id_validate_regular_expression(cls, value):
37+
"""Validates the regular expression"""
38+
if not isinstance(value, str):
39+
value = str(value)
40+
41+
if not re.match(r"^[^\0-\x1F\x7F-\x9F]+$", value):
42+
raise ValueError(r"must validate the regular expression /^[^\0-\x1F\x7F-\x9F]+$/")
43+
return value
44+
45+
@field_validator("secret")
46+
def secret_validate_regular_expression(cls, value):
47+
"""Validates the regular expression"""
48+
if not isinstance(value, str):
49+
value = str(value)
50+
51+
if not re.match(r"^[^\0-\x1F\x7F-\x9F]+$", value):
52+
raise ValueError(r"must validate the regular expression /^[^\0-\x1F\x7F-\x9F]+$/")
53+
return value
54+
3455
model_config = ConfigDict(
3556
validate_by_name=True,
3657
validate_by_alias=True,

‎services/telemetryrouter/src/stackit/telemetryrouter/models/telemetry_router_response.py‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,30 @@ class TelemetryRouterResponse(BaseModel):
3737
default=None,
3838
description="The description is a longer text chosen by the user to provide more context for the resource.",
3939
)
40+
destination_count: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(
41+
default=None,
42+
description="The number of destinations configured for the telemetry router.",
43+
alias="destinationCount",
44+
)
4045
display_name: Annotated[str, Field(min_length=1, strict=True, max_length=32)] = Field(
4146
description="The display name is a short name chosen by the user to identify the resource.", alias="displayName"
4247
)
4348
filter: Optional[ConfigFilter] = None
4449
id: UUID = Field(description="A auto generated unique id which identifies the resource.")
50+
resource_labels: Optional[Dict[str, StrictStr]] = Field(default=None, alias="resourceLabels")
4551
status: StrictStr = Field(description="The current status of the resource.")
4652
uri: Annotated[str, Field(strict=True, max_length=1024)] = Field(description="The URI for reaching the resource.")
47-
__properties: ClassVar[List[str]] = ["creationTime", "description", "displayName", "filter", "id", "status", "uri"]
53+
__properties: ClassVar[List[str]] = [
54+
"creationTime",
55+
"description",
56+
"destinationCount",
57+
"displayName",
58+
"filter",
59+
"id",
60+
"resourceLabels",
61+
"status",
62+
"uri",
63+
]
4864

4965
@field_validator("creation_time", mode="before")
5066
def creation_time_change_year_zero_to_one(cls, value):
@@ -144,9 +160,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
144160
{
145161
"creationTime": obj.get("creationTime"),
146162
"description": obj.get("description"),
163+
"destinationCount": obj.get("destinationCount"),
147164
"displayName": obj.get("displayName"),
148165
"filter": ConfigFilter.from_dict(obj["filter"]) if obj.get("filter") is not None else None,
149166
"id": obj.get("id"),
167+
"resourceLabels": obj.get("resourceLabels"),
150168
"status": obj.get("status"),
151169
"uri": obj.get("uri"),
152170
}

‎services/telemetryrouter/src/stackit/telemetryrouter/models/update_telemetry_router_payload.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import re # noqa: F401
1919
from typing import Any, ClassVar, Dict, List, Optional, Set
2020

21-
from pydantic import BaseModel, ConfigDict, Field, field_validator
21+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
2222
from pydantic_core import to_jsonable_python
2323
from typing_extensions import Annotated, Self
2424

@@ -40,7 +40,8 @@ class UpdateTelemetryRouterPayload(BaseModel):
4040
alias="displayName",
4141
)
4242
filter: Optional[ConfigFilter] = None
43-
__properties: ClassVar[List[str]] = ["description", "displayName", "filter"]
43+
resource_labels: Optional[Dict[str, StrictStr]] = Field(default=None, alias="resourceLabels")
44+
__properties: ClassVar[List[str]] = ["description", "displayName", "filter", "resourceLabels"]
4445

4546
@field_validator("description")
4647
def description_validate_regular_expression(cls, value):
@@ -124,6 +125,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
124125
"description": obj.get("description"),
125126
"displayName": obj.get("displayName"),
126127
"filter": ConfigFilter.from_dict(obj["filter"]) if obj.get("filter") is not None else None,
128+
"resourceLabels": obj.get("resourceLabels"),
127129
}
128130
)
129131
return _obj

0 commit comments

Comments
 (0)