Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf7c5637

Browse files
Generate cdn
1 parente4796df commitf7c5637

File tree

12 files changed

+844
-118
lines changed

12 files changed

+844
-118
lines changed

‎services/cdn/src/stackit/cdn/__init__.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
fromstackit.cdn.models.delete_custom_domain_responseimportDeleteCustomDomainResponse
4444
fromstackit.cdn.models.delete_distribution_responseimportDeleteDistributionResponse
4545
fromstackit.cdn.models.distributionimportDistribution
46+
fromstackit.cdn.models.distribution_logs_recordimportDistributionLogsRecord
4647
fromstackit.cdn.models.distribution_statistics_recordimport (
4748
DistributionStatisticsRecord,
4849
)
@@ -54,20 +55,19 @@
5455
)
5556
fromstackit.cdn.models.domainimportDomain
5657
fromstackit.cdn.models.domain_statusimportDomainStatus
58+
fromstackit.cdn.models.error_detailsimportErrorDetails
5759
fromstackit.cdn.models.find_cache_paths_responseimportFindCachePathsResponse
5860
fromstackit.cdn.models.find_cache_paths_response_entryimport (
5961
FindCachePathsResponseEntry,
6062
)
6163
fromstackit.cdn.models.generic_json_responseimportGenericJSONResponse
62-
fromstackit.cdn.models.generic_json_response_details_innerimport (
63-
GenericJSONResponseDetailsInner,
64-
)
6564
fromstackit.cdn.models.get_cache_info_responseimportGetCacheInfoResponse
6665
fromstackit.cdn.models.get_cache_info_response_history_entryimport (
6766
GetCacheInfoResponseHistoryEntry,
6867
)
6968
fromstackit.cdn.models.get_custom_domain_responseimportGetCustomDomainResponse
7069
fromstackit.cdn.models.get_distribution_responseimportGetDistributionResponse
70+
fromstackit.cdn.models.get_logs_responseimportGetLogsResponse
7171
fromstackit.cdn.models.get_statistics_responseimportGetStatisticsResponse
7272
fromstackit.cdn.models.http_backendimportHttpBackend
7373
fromstackit.cdn.models.http_backend_patchimportHttpBackendPatch

‎services/cdn/src/stackit/cdn/api/default_api.py‎

Lines changed: 507 additions & 87 deletions
Large diffs are not rendered by default.

‎services/cdn/src/stackit/cdn/models/__init__.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
fromstackit.cdn.models.delete_custom_domain_responseimportDeleteCustomDomainResponse
2525
fromstackit.cdn.models.delete_distribution_responseimportDeleteDistributionResponse
2626
fromstackit.cdn.models.distributionimportDistribution
27+
fromstackit.cdn.models.distribution_logs_recordimportDistributionLogsRecord
2728
fromstackit.cdn.models.distribution_statistics_recordimport (
2829
DistributionStatisticsRecord,
2930
)
@@ -35,20 +36,19 @@
3536
)
3637
fromstackit.cdn.models.domainimportDomain
3738
fromstackit.cdn.models.domain_statusimportDomainStatus
39+
fromstackit.cdn.models.error_detailsimportErrorDetails
3840
fromstackit.cdn.models.find_cache_paths_responseimportFindCachePathsResponse
3941
fromstackit.cdn.models.find_cache_paths_response_entryimport (
4042
FindCachePathsResponseEntry,
4143
)
4244
fromstackit.cdn.models.generic_json_responseimportGenericJSONResponse
43-
fromstackit.cdn.models.generic_json_response_details_innerimport (
44-
GenericJSONResponseDetailsInner,
45-
)
4645
fromstackit.cdn.models.get_cache_info_responseimportGetCacheInfoResponse
4746
fromstackit.cdn.models.get_cache_info_response_history_entryimport (
4847
GetCacheInfoResponseHistoryEntry,
4948
)
5049
fromstackit.cdn.models.get_custom_domain_responseimportGetCustomDomainResponse
5150
fromstackit.cdn.models.get_distribution_responseimportGetDistributionResponse
51+
fromstackit.cdn.models.get_logs_responseimportGetLogsResponse
5252
fromstackit.cdn.models.get_statistics_responseimportGetStatisticsResponse
5353
fromstackit.cdn.models.http_backendimportHttpBackend
5454
fromstackit.cdn.models.http_backend_patchimportHttpBackendPatch

‎services/cdn/src/stackit/cdn/models/config.py‎

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
importpprint
1818
fromtypingimportAny,ClassVar,Dict,List,Optional,Set
1919

20-
frompydanticimportBaseModel,ConfigDict,Field
20+
frompydanticimportBaseModel,ConfigDict,Field,StrictStr
2121
fromtyping_extensionsimportAnnotated,Self
2222

2323
fromstackit.cdn.models.config_backendimportConfigBackend
@@ -30,8 +30,21 @@ class Config(BaseModel):
3030
"""
3131

3232
backend:ConfigBackend
33+
blocked_countries:List[StrictStr]=Field(
34+
description="Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. ",
35+
alias="blockedCountries",
36+
)
37+
blocked_ips:List[StrictStr]=Field(
38+
description="Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. ",
39+
alias="blockedIPs",
40+
)
41+
monthly_limit_bytes:Optional[Annotated[int,Field(strict=True,ge=0)]]=Field(
42+
default=None,
43+
description="Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. ",
44+
alias="monthlyLimitBytes",
45+
)
3346
regions:Annotated[List[Region],Field(min_length=1)]
34-
__properties:ClassVar[List[str]]= ["backend","regions"]
47+
__properties:ClassVar[List[str]]= ["backend","blockedCountries","blockedIPs","monthlyLimitBytes","regions"]
3548

3649
model_config=ConfigDict(
3750
populate_by_name=True,
@@ -73,6 +86,11 @@ def to_dict(self) -> Dict[str, Any]:
7386
# override the default output from pydantic by calling `to_dict()` of backend
7487
ifself.backend:
7588
_dict["backend"]=self.backend.to_dict()
89+
# set to None if monthly_limit_bytes (nullable) is None
90+
# and model_fields_set contains the field
91+
ifself.monthly_limit_bytesisNoneand"monthly_limit_bytes"inself.model_fields_set:
92+
_dict["monthlyLimitBytes"]=None
93+
7694
return_dict
7795

7896
@classmethod
@@ -87,6 +105,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87105
_obj=cls.model_validate(
88106
{
89107
"backend":ConfigBackend.from_dict(obj["backend"])ifobj.get("backend")isnotNoneelseNone,
108+
"blockedCountries":obj.get("blockedCountries"),
109+
"blockedIPs":obj.get("blockedIPs"),
110+
"monthlyLimitBytes":obj.get("monthlyLimitBytes"),
90111
"regions":obj.get("regions"),
91112
}
92113
)

‎services/cdn/src/stackit/cdn/models/config_patch.py‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
importpprint
1818
fromtypingimportAny,ClassVar,Dict,List,Optional,Set
1919

20-
frompydanticimportBaseModel,ConfigDict,Field
20+
frompydanticimportBaseModel,ConfigDict,Field,StrictStr
2121
fromtyping_extensionsimportAnnotated,Self
2222

2323
fromstackit.cdn.models.config_patch_backendimportConfigPatchBackend
@@ -30,8 +30,23 @@ class ConfigPatch(BaseModel):
3030
"""
3131

3232
backend:Optional[ConfigPatchBackend]=None
33+
blocked_countries:Optional[List[StrictStr]]=Field(
34+
default=None,
35+
description="Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. ",
36+
alias="blockedCountries",
37+
)
38+
blocked_ips:Optional[List[StrictStr]]=Field(
39+
default=None,
40+
description="Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. ",
41+
alias="blockedIPs",
42+
)
43+
monthly_limit_bytes:Optional[Annotated[int,Field(strict=True,ge=0)]]=Field(
44+
default=None,
45+
description="Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. ",
46+
alias="monthlyLimitBytes",
47+
)
3348
regions:Optional[Annotated[List[Region],Field(min_length=1)]]=None
34-
__properties:ClassVar[List[str]]= ["backend","regions"]
49+
__properties:ClassVar[List[str]]= ["backend","blockedCountries","blockedIPs","monthlyLimitBytes","regions"]
3550

3651
model_config=ConfigDict(
3752
populate_by_name=True,
@@ -73,6 +88,11 @@ def to_dict(self) -> Dict[str, Any]:
7388
# override the default output from pydantic by calling `to_dict()` of backend
7489
ifself.backend:
7590
_dict["backend"]=self.backend.to_dict()
91+
# set to None if monthly_limit_bytes (nullable) is None
92+
# and model_fields_set contains the field
93+
ifself.monthly_limit_bytesisNoneand"monthly_limit_bytes"inself.model_fields_set:
94+
_dict["monthlyLimitBytes"]=None
95+
7696
return_dict
7797

7898
@classmethod
@@ -87,6 +107,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87107
_obj=cls.model_validate(
88108
{
89109
"backend":ConfigPatchBackend.from_dict(obj["backend"])ifobj.get("backend")isnotNoneelseNone,
110+
"blockedCountries":obj.get("blockedCountries"),
111+
"blockedIPs":obj.get("blockedIPs"),
112+
"monthlyLimitBytes":obj.get("monthlyLimitBytes"),
90113
"regions":obj.get("regions"),
91114
}
92115
)

‎services/cdn/src/stackit/cdn/models/create_distribution_payload.py‎

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,26 @@ class CreateDistributionPayload(BaseModel):
2828
CreateDistributionPayload
2929
"""
3030

31+
blocked_countries:Optional[List[StrictStr]]=Field(
32+
default=None,
33+
description="Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. ",
34+
alias="blockedCountries",
35+
)
36+
blocked_ips:Optional[List[StrictStr]]=Field(
37+
default=None,
38+
description="Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. ",
39+
alias="blockedIPs",
40+
)
3141
intent_id:Optional[StrictStr]=Field(
3242
default=None,
3343
description="While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple POST-Requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. ",
3444
alias="intentId",
3545
)
46+
monthly_limit_bytes:Optional[Annotated[int,Field(strict=True,ge=0)]]=Field(
47+
default=None,
48+
description="Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. ",
49+
alias="monthlyLimitBytes",
50+
)
3651
origin_request_headers:Optional[Dict[str,StrictStr]]=Field(
3752
default=None,
3853
description="Headers that will be sent with every request to the configured origin. WARNING: Do not store sensitive values in the headers. The data is stores as plain text. ",
@@ -45,7 +60,15 @@ class CreateDistributionPayload(BaseModel):
4560
regions:Annotated[List[Region],Field(min_length=1)]=Field(
4661
description="Define in which regions you would like your content to be cached. "
4762
)
48-
__properties:ClassVar[List[str]]= ["intentId","originRequestHeaders","originUrl","regions"]
63+
__properties:ClassVar[List[str]]= [
64+
"blockedCountries",
65+
"blockedIPs",
66+
"intentId",
67+
"monthlyLimitBytes",
68+
"originRequestHeaders",
69+
"originUrl",
70+
"regions",
71+
]
4972

5073
model_config=ConfigDict(
5174
populate_by_name=True,
@@ -97,7 +120,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
97120

98121
_obj=cls.model_validate(
99122
{
123+
"blockedCountries":obj.get("blockedCountries"),
124+
"blockedIPs":obj.get("blockedIPs"),
100125
"intentId":obj.get("intentId"),
126+
"monthlyLimitBytes":obj.get("monthlyLimitBytes"),
101127
"originRequestHeaders":obj.get("originRequestHeaders"),
102128
"originUrl":obj.get("originUrl"),
103129
"regions":obj.get("regions"),

‎services/cdn/src/stackit/cdn/models/distribution.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Distribution(BaseModel):
4646
description="- `CREATING`: The distribution was just created. All the relevant resources are created in the background. Once fully reconciled, this switches to `ACTIVE`. If there are any issues, the status changes to `ERROR`. You can look at the `errors` array to get more infos. - `ACTIVE`: The usual state. The desired configuration is synced, there are no errors - `UPDATING`: The state when there is a discrepancy between the desired and actual configuration state. This occurs right after an update. Will switch to `ACTIVE` or `ERROR`, depending on if synchronizing succeeds or not. - `DELETING`: The state right after a delete request was received. The distribution will stay in this status until all resources have been successfully removed, or until we encounter an `ERROR` state. **NOTE:** You can keep fetching the distribution while it is deleting. After successful deletion, trying to get a distribution will return a 404 Not Found response - `ERROR`: The error state. Look at the `errors` array for more info. "
4747
)
4848
updated_at:datetime=Field(
49-
description="RFC3339 string which returns the last time the distribution's configuration was modified. ",
49+
description="RFC3339 string which returns the last time the distribution configuration was modified. ",
5050
alias="updatedAt",
5151
)
5252
__properties:ClassVar[List[str]]= [
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# coding: utf-8
2+
3+
"""
4+
CDN API
5+
6+
API used to create and manage your CDN distributions.
7+
8+
The version of the OpenAPI document: 1beta.0.0
9+
Generated by OpenAPI Generator (https://openapi-generator.tech)
10+
11+
Do not edit the class manually.
12+
"""# noqa: E501 docstring might be too long
13+
14+
from __future__importannotations
15+
16+
importjson
17+
importpprint
18+
fromdatetimeimportdatetime
19+
fromtypingimportAny,ClassVar,Dict,List,Optional,Set
20+
21+
frompydanticimportBaseModel,ConfigDict,Field,StrictBool,StrictInt,StrictStr
22+
fromtyping_extensionsimportAnnotated,Self
23+
24+
25+
classDistributionLogsRecord(BaseModel):
26+
"""
27+
DistributionLogsRecord
28+
"""
29+
30+
cache_hit:StrictBool=Field(alias="cacheHit")
31+
data_center_region:StrictStr=Field(alias="dataCenterRegion")
32+
distribution_id:StrictStr=Field(alias="distributionID")
33+
host:StrictStr
34+
path:StrictStr
35+
request_country_code:Annotated[str,Field(min_length=2,strict=True,max_length=2)]=Field(
36+
description="ISO 3166-1 A2 compliant country code",alias="requestCountryCode"
37+
)
38+
size:Annotated[int,Field(strict=True,ge=0)]
39+
status_code:StrictInt=Field(alias="statusCode")
40+
timestamp:datetime
41+
__properties:ClassVar[List[str]]= [
42+
"cacheHit",
43+
"dataCenterRegion",
44+
"distributionID",
45+
"host",
46+
"path",
47+
"requestCountryCode",
48+
"size",
49+
"statusCode",
50+
"timestamp",
51+
]
52+
53+
model_config=ConfigDict(
54+
populate_by_name=True,
55+
validate_assignment=True,
56+
protected_namespaces=(),
57+
)
58+
59+
defto_str(self)->str:
60+
"""Returns the string representation of the model using alias"""
61+
returnpprint.pformat(self.model_dump(by_alias=True))
62+
63+
defto_json(self)->str:
64+
"""Returns the JSON representation of the model using alias"""
65+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
66+
returnjson.dumps(self.to_dict())
67+
68+
@classmethod
69+
deffrom_json(cls,json_str:str)->Optional[Self]:
70+
"""Create an instance of DistributionLogsRecord from a JSON string"""
71+
returncls.from_dict(json.loads(json_str))
72+
73+
defto_dict(self)->Dict[str,Any]:
74+
"""Return the dictionary representation of the model using alias.
75+
76+
This has the following differences from calling pydantic's
77+
`self.model_dump(by_alias=True)`:
78+
79+
* `None` is only added to the output dict for nullable fields that
80+
were set at model initialization. Other fields with value `None`
81+
are ignored.
82+
"""
83+
excluded_fields:Set[str]=set([])
84+
85+
_dict=self.model_dump(
86+
by_alias=True,
87+
exclude=excluded_fields,
88+
exclude_none=True,
89+
)
90+
return_dict
91+
92+
@classmethod
93+
deffrom_dict(cls,obj:Optional[Dict[str,Any]])->Optional[Self]:
94+
"""Create an instance of DistributionLogsRecord from a dict"""
95+
ifobjisNone:
96+
returnNone
97+
98+
ifnotisinstance(obj,dict):
99+
returncls.model_validate(obj)
100+
101+
_obj=cls.model_validate(
102+
{
103+
"cacheHit":obj.get("cacheHit"),
104+
"dataCenterRegion":obj.get("dataCenterRegion"),
105+
"distributionID":obj.get("distributionID"),
106+
"host":obj.get("host"),
107+
"path":obj.get("path"),
108+
"requestCountryCode":obj.get("requestCountryCode"),
109+
"size":obj.get("size"),
110+
"statusCode":obj.get("statusCode"),
111+
"timestamp":obj.get("timestamp"),
112+
}
113+
)
114+
return_obj

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp