Skip to content

Commit cb43ae2

Browse files
Generate cdn
1 parent 95c0a3e commit cb43ae2

11 files changed

Lines changed: 143 additions & 33 deletions

services/cdn/oas_commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bda6ad3d9e8850526f25eddcb6589fcc7559c625
1+
a39a8b7c097d5f7f28b3cfc2392c2036edf374f0

services/cdn/src/stackit/cdn/models/bucket_backend.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import pprint
1818
from typing import Any, ClassVar, Dict, List, Optional, Set
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
2121
from pydantic_core import to_jsonable_python
2222
from typing_extensions import Self
2323

@@ -27,11 +27,25 @@ class BucketBackend(BaseModel):
2727
BucketBackend
2828
""" # noqa: E501
2929

30-
bucket_url: StrictStr = Field(alias="bucketUrl")
31-
region: StrictStr
32-
type: StrictStr
30+
bucket_url: StrictStr = Field(
31+
description="The fully qualified URL of your cloud storage bucket (for example, `https://s3.eu-central-1.amazonaws.com/my-bucket`).",
32+
alias="bucketUrl",
33+
)
34+
region: StrictStr = Field(
35+
description="The cloud provider region where your storage bucket is located (for example, `us-west-1` for AWS or `eu01` for STACKIT)."
36+
)
37+
type: StrictStr = Field(
38+
description="Defines the type of content origin. For this schema, it must be set to `bucket`."
39+
)
3340
__properties: ClassVar[List[str]] = ["bucketUrl", "region", "type"]
3441

42+
@field_validator("type")
43+
def type_validate_enum(cls, value):
44+
"""Validates the enum"""
45+
if value not in set(["bucket"]):
46+
raise ValueError("must be one of enum values ('bucket')")
47+
return value
48+
3549
model_config = ConfigDict(
3650
validate_by_name=True,
3751
validate_by_alias=True,

services/cdn/src/stackit/cdn/models/bucket_backend_create.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import pprint
1818
from typing import Any, ClassVar, Dict, List, Optional, Set
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
2121
from pydantic_core import to_jsonable_python
2222
from typing_extensions import Self
2323

@@ -29,12 +29,26 @@ class BucketBackendCreate(BaseModel):
2929
BucketBackendCreate
3030
""" # noqa: E501
3131

32-
bucket_url: StrictStr = Field(alias="bucketUrl")
32+
bucket_url: StrictStr = Field(
33+
description="The fully qualified URL of your cloud storage bucket (for example, `https://s3.eu-central-1.amazonaws.com/my-bucket`).",
34+
alias="bucketUrl",
35+
)
3336
credentials: BucketCredentials
34-
region: StrictStr
35-
type: StrictStr
37+
region: StrictStr = Field(
38+
description="The cloud provider region where your storage bucket is located (for example, `us-west-1` for AWS or `eu01` for STACKIT)."
39+
)
40+
type: StrictStr = Field(
41+
description="Defines the type of content origin. For this schema, it must be set to `bucket`."
42+
)
3643
__properties: ClassVar[List[str]] = ["bucketUrl", "credentials", "region", "type"]
3744

45+
@field_validator("type")
46+
def type_validate_enum(cls, value):
47+
"""Validates the enum"""
48+
if value not in set(["bucket"]):
49+
raise ValueError("must be one of enum values ('bucket')")
50+
return value
51+
3852
model_config = ConfigDict(
3953
validate_by_name=True,
4054
validate_by_alias=True,

services/cdn/src/stackit/cdn/models/bucket_backend_patch.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import pprint
1818
from typing import Any, ClassVar, Dict, List, Optional, Set
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
2121
from pydantic_core import to_jsonable_python
2222
from typing_extensions import Self
2323

@@ -29,12 +29,28 @@ class BucketBackendPatch(BaseModel):
2929
BucketBackendPatch
3030
""" # noqa: E501
3131

32-
bucket_url: Optional[StrictStr] = Field(default=None, alias="bucketUrl")
32+
bucket_url: Optional[StrictStr] = Field(
33+
default=None,
34+
description="The fully qualified URL of your cloud storage bucket (for example, `https://s3.eu-central-1.amazonaws.com/my-bucket`).",
35+
alias="bucketUrl",
36+
)
3337
credentials: Optional[BucketCredentials] = None
34-
region: Optional[StrictStr] = None
35-
type: StrictStr
38+
region: Optional[StrictStr] = Field(
39+
default=None,
40+
description="The cloud provider region where your storage bucket is located (for example, `us-west-1` for AWS or `eu01` for STACKIT).",
41+
)
42+
type: StrictStr = Field(
43+
description="Defines the type of content origin. For this schema, it must be set to `bucket`."
44+
)
3645
__properties: ClassVar[List[str]] = ["bucketUrl", "credentials", "region", "type"]
3746

47+
@field_validator("type")
48+
def type_validate_enum(cls, value):
49+
"""Validates the enum"""
50+
if value not in set(["bucket"]):
51+
raise ValueError("must be one of enum values ('bucket')")
52+
return value
53+
3854
model_config = ConfigDict(
3955
validate_by_name=True,
4056
validate_by_alias=True,

services/cdn/src/stackit/cdn/models/http_backend.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import pprint
1818
from typing import Any, ClassVar, Dict, List, Optional, Set
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
2121
from pydantic_core import to_jsonable_python
2222
from typing_extensions import Self
2323

@@ -38,9 +38,18 @@ class HttpBackend(BaseModel):
3838
description="The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` ",
3939
alias="originUrl",
4040
)
41-
type: StrictStr
41+
type: StrictStr = Field(
42+
description="Defines the type of content origin. For this schema, it must be set to `http`."
43+
)
4244
__properties: ClassVar[List[str]] = ["geofencing", "originRequestHeaders", "originUrl", "type"]
4345

46+
@field_validator("type")
47+
def type_validate_enum(cls, value):
48+
"""Validates the enum"""
49+
if value not in set(["http"]):
50+
raise ValueError("must be one of enum values ('http')")
51+
return value
52+
4453
model_config = ConfigDict(
4554
validate_by_name=True,
4655
validate_by_alias=True,

services/cdn/src/stackit/cdn/models/http_backend_create.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import pprint
1818
from typing import Any, ClassVar, Dict, List, Optional, Set
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
2121
from pydantic_core import to_jsonable_python
2222
from typing_extensions import Self
2323

@@ -40,9 +40,18 @@ class HttpBackendCreate(BaseModel):
4040
description="The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` ",
4141
alias="originUrl",
4242
)
43-
type: StrictStr
43+
type: StrictStr = Field(
44+
description="Defines the type of content origin. For this schema, it must be set to `http`."
45+
)
4446
__properties: ClassVar[List[str]] = ["geofencing", "originRequestHeaders", "originUrl", "type"]
4547

48+
@field_validator("type")
49+
def type_validate_enum(cls, value):
50+
"""Validates the enum"""
51+
if value not in set(["http"]):
52+
raise ValueError("must be one of enum values ('http')")
53+
return value
54+
4655
model_config = ConfigDict(
4756
validate_by_name=True,
4857
validate_by_alias=True,

services/cdn/src/stackit/cdn/models/http_backend_patch.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import pprint
1818
from typing import Any, ClassVar, Dict, List, Optional, Set
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
2121
from pydantic_core import to_jsonable_python
2222
from typing_extensions import Self
2323

@@ -36,10 +36,23 @@ class HttpBackendPatch(BaseModel):
3636
description="Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. ",
3737
alias="originRequestHeaders",
3838
)
39-
origin_url: Optional[StrictStr] = Field(default=None, alias="originUrl")
40-
type: StrictStr = Field(description="This property is required to determine the used backend type.")
39+
origin_url: Optional[StrictStr] = Field(
40+
default=None,
41+
description="The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` ",
42+
alias="originUrl",
43+
)
44+
type: StrictStr = Field(
45+
description="Defines the type of content origin. For this schema, it must be set to `http`."
46+
)
4147
__properties: ClassVar[List[str]] = ["geofencing", "originRequestHeaders", "originUrl", "type"]
4248

49+
@field_validator("type")
50+
def type_validate_enum(cls, value):
51+
"""Validates the enum"""
52+
if value not in set(["http"]):
53+
raise ValueError("must be one of enum values ('http')")
54+
return value
55+
4356
model_config = ConfigDict(
4457
validate_by_name=True,
4558
validate_by_alias=True,

services/cdn/src/stackit/cdn/models/loki_log_sink.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import pprint
1818
from typing import Any, ClassVar, Dict, List, Optional, Set
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
2121
from pydantic_core import to_jsonable_python
2222
from typing_extensions import Self
2323

@@ -27,10 +27,20 @@ class LokiLogSink(BaseModel):
2727
LokiLogSink
2828
""" # noqa: E501
2929

30-
push_url: StrictStr = Field(alias="pushUrl")
31-
type: StrictStr
30+
push_url: StrictStr = Field(
31+
description="The fully qualified URL where the CDN should push logs to your Loki instance (for example, `https://loki.example.com/loki/api/v1/push`).",
32+
alias="pushUrl",
33+
)
34+
type: StrictStr = Field(description="Defines the type of the log sink.")
3235
__properties: ClassVar[List[str]] = ["pushUrl", "type"]
3336

37+
@field_validator("type")
38+
def type_validate_enum(cls, value):
39+
"""Validates the enum"""
40+
if value not in set(["loki"]):
41+
raise ValueError("must be one of enum values ('loki')")
42+
return value
43+
3444
model_config = ConfigDict(
3545
validate_by_name=True,
3646
validate_by_alias=True,

services/cdn/src/stackit/cdn/models/loki_log_sink_create.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import pprint
1818
from typing import Any, ClassVar, Dict, List, Optional, Set
1919

20-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
2121
from pydantic_core import to_jsonable_python
2222
from typing_extensions import Self
2323

@@ -30,10 +30,22 @@ class LokiLogSinkCreate(BaseModel):
3030
""" # noqa: E501
3131

3232
credentials: LokiLogSinkCredentials
33-
push_url: StrictStr = Field(alias="pushUrl")
34-
type: StrictStr
33+
push_url: StrictStr = Field(
34+
description="The fully qualified URL where the CDN should push logs to your Loki instance (for example, `https://loki.example.com/loki/api/v1/push`).",
35+
alias="pushUrl",
36+
)
37+
type: StrictStr = Field(
38+
description="Defines the type of the log sink. For Grafana Loki, this must be set to `loki`."
39+
)
3540
__properties: ClassVar[List[str]] = ["credentials", "pushUrl", "type"]
3641

42+
@field_validator("type")
43+
def type_validate_enum(cls, value):
44+
"""Validates the enum"""
45+
if value not in set(["loki"]):
46+
raise ValueError("must be one of enum values ('loki')")
47+
return value
48+
3749
model_config = ConfigDict(
3850
validate_by_name=True,
3951
validate_by_alias=True,

services/cdn/src/stackit/cdn/models/loki_log_sink_credentials.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@
1717
import pprint
1818
from typing import Any, ClassVar, Dict, List, Optional, Set
1919

20-
from pydantic import BaseModel, ConfigDict, StrictStr
20+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
2121
from pydantic_core import to_jsonable_python
2222
from typing_extensions import Self
2323

2424

2525
class LokiLogSinkCredentials(BaseModel):
2626
"""
27-
LokiLogSinkCredentials
27+
The authentication credentials required for the CDN to push logs to your Loki instance.
2828
""" # noqa: E501
2929

30-
password: StrictStr
31-
username: StrictStr
30+
password: StrictStr = Field(description="The password corresponding to your username.")
31+
username: StrictStr = Field(description="The username used to authenticate against your Loki instance.")
3232
__properties: ClassVar[List[str]] = ["password", "username"]
3333

3434
model_config = ConfigDict(

0 commit comments

Comments
 (0)