Skip to content

Commit d40d2c7

Browse files
feat(api): aggregated API specs update
1 parent 7f62464 commit d40d2c7

7 files changed

Lines changed: 549 additions & 95 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 658
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-a85f1ff828a65fc5ad6c6e7710470b25a8de1db3ffbc8c87b33d302a0eaf2f71.yml
3-
openapi_spec_hash: 272cd5e00b5231a7ba0a3d85f483ac18
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-5de0011052b0f3a84a9279f70f14b30788717ed6d73b8fc03f48862f16392b3c.yml
3+
openapi_spec_hash: 4bcc35042d39a7bd7a653a35dcf0f791
44
config_hash: ab6b5443d52ca04e4e0e12def131f8e6

src/gcore/resources/cdn/origin_groups.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ def create(
7676
Args:
7777
name: Origin group name.
7878
79-
sources: List of origin sources in the origin group.
80-
8179
auth_type: Origin authentication type.
8280
8381
Possible values:
@@ -274,8 +272,6 @@ def update(
274272
- **`http_503`** - a origin returned a response with the code 503
275273
- **`http_504`** - a origin returned a response with the code 504
276274
277-
sources: List of origin sources in the origin group.
278-
279275
use_next: Defines whether to use the next origin from the origin group if origin responds
280276
with the cases specified in `proxy_next_upstream`. If you enable it, you must
281277
specify cases in `proxy_next_upstream`.
@@ -558,8 +554,6 @@ def replace(
558554
559555
path: Parameter is **deprecated**.
560556
561-
sources: List of origin sources in the origin group.
562-
563557
use_next: Defines whether to use the next origin from the origin group if origin responds
564558
with the cases specified in `proxy_next_upstream`. If you enable it, you must
565559
specify cases in `proxy_next_upstream`.
@@ -755,8 +749,6 @@ async def create(
755749
Args:
756750
name: Origin group name.
757751
758-
sources: List of origin sources in the origin group.
759-
760752
auth_type: Origin authentication type.
761753
762754
Possible values:
@@ -953,8 +945,6 @@ async def update(
953945
- **`http_503`** - a origin returned a response with the code 503
954946
- **`http_504`** - a origin returned a response with the code 504
955947
956-
sources: List of origin sources in the origin group.
957-
958948
use_next: Defines whether to use the next origin from the origin group if origin responds
959949
with the cases specified in `proxy_next_upstream`. If you enable it, you must
960950
specify cases in `proxy_next_upstream`.
@@ -1237,8 +1227,6 @@ async def replace(
12371227
12381228
path: Parameter is **deprecated**.
12391229
1240-
sources: List of origin sources in the origin group.
1241-
12421230
use_next: Defines whether to use the next origin from the origin group if origin responds
12431231
with the cases specified in `proxy_next_upstream`. If you enable it, you must
12441232
specify cases in `proxy_next_upstream`.

src/gcore/types/cdn/origin_group_create_params.py

Lines changed: 125 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,28 @@
22

33
from __future__ import annotations
44

5-
from typing import Union, Iterable
6-
from typing_extensions import Required, TypeAlias, TypedDict
5+
from typing import Union, Iterable, Optional
6+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

88
from ..._types import SequenceNotStr
99

10-
__all__ = ["OriginGroupCreateParams", "NoneAuth", "NoneAuthSource", "AwsSignatureV4", "AwsSignatureV4Auth"]
10+
__all__ = [
11+
"OriginGroupCreateParams",
12+
"NoneAuth",
13+
"NoneAuthSource",
14+
"NoneAuthSourceChangeHostSource",
15+
"NoneAuthSourceChangeS3Source",
16+
"NoneAuthSourceChangeS3SourceConfig",
17+
"AwsSignatureV4",
18+
"AwsSignatureV4Auth",
19+
]
1120

1221

1322
class NoneAuth(TypedDict, total=False):
1423
name: Required[str]
1524
"""Origin group name."""
1625

1726
sources: Required[Iterable[NoneAuthSource]]
18-
"""List of origin sources in the origin group."""
1927

2028
auth_type: str
2129
"""Origin authentication type.
@@ -58,7 +66,10 @@ class NoneAuth(TypedDict, total=False):
5866
"""
5967

6068

61-
class NoneAuthSource(TypedDict, total=False):
69+
class NoneAuthSourceChangeHostSource(TypedDict, total=False):
70+
source: Required[str]
71+
"""IP address or domain name of the origin and the port, if custom port is used."""
72+
6273
backup: bool
6374
"""
6475
Defines whether the origin is a backup, meaning that it will not be used until
@@ -81,8 +92,114 @@ class NoneAuthSource(TypedDict, total=False):
8192
Origin group must contain at least one enabled origin.
8293
"""
8394

84-
source: str
85-
"""IP address or domain name of the origin and the port, if custom port is used."""
95+
host_header_override: Optional[str]
96+
"""Per-origin Host header override.
97+
98+
When set, the CDN sends this value as the Host header when requesting content
99+
from this origin instead of the default.
100+
"""
101+
102+
tag: str
103+
"""Tag for the origin source."""
104+
105+
106+
class NoneAuthSourceChangeS3SourceConfig(TypedDict, total=False):
107+
"""S3 storage configuration. Required when `origin_type` is `s3`."""
108+
109+
s3_access_key_id: Required[str]
110+
"""Access key ID for the S3 account. Masked as `SECRET_VALUE` in responses.
111+
112+
Restrictions:
113+
114+
- Latin letters (A-Z, a-z), numbers (0-9), colon, dash, and underscore.
115+
- From 4 to 255 characters.
116+
"""
117+
118+
s3_bucket_name: Required[str]
119+
"""S3 bucket name."""
120+
121+
s3_secret_access_key: Required[str]
122+
"""Secret access key for the S3 account. Masked as `SECRET_VALUE` in responses.
123+
124+
Restrictions:
125+
126+
- Latin letters (A-Z, a-z), numbers (0-9), pluses, slashes, dashes, colons and
127+
underscores.
128+
- From 16 to 255 characters.
129+
"""
130+
131+
s3_type: Required[Literal["amazon", "other"]]
132+
"""Storage type compatible with S3.
133+
134+
Possible values:
135+
136+
- **amazon** - AWS S3 storage.
137+
- **other** - Other (not AWS) S3 compatible storage.
138+
"""
139+
140+
s3_auth_type: str
141+
"""S3 authentication type."""
142+
143+
s3_region: Optional[str]
144+
"""S3 storage region.
145+
146+
The parameter is required if `s3_type` is `amazon`.
147+
"""
148+
149+
s3_storage_hostname: Optional[str]
150+
"""S3 storage hostname.
151+
152+
The parameter is required if `s3_type` is `other`.
153+
"""
154+
155+
156+
class NoneAuthSourceChangeS3Source(TypedDict, total=False):
157+
config: Required[NoneAuthSourceChangeS3SourceConfig]
158+
"""S3 storage configuration. Required when `origin_type` is `s3`."""
159+
160+
backup: bool
161+
"""
162+
Defines whether the origin is a backup, meaning that it will not be used until
163+
one of active origins become unavailable.
164+
165+
Possible values:
166+
167+
- **true** - Origin is a backup.
168+
- **false** - Origin is not a backup.
169+
"""
170+
171+
enabled: bool
172+
"""Enables or disables an origin source in the origin group.
173+
174+
Possible values:
175+
176+
- **true** - Origin is enabled and the CDN uses it to pull content.
177+
- **false** - Origin is disabled and the CDN does not use it to pull content.
178+
179+
Origin group must contain at least one enabled origin.
180+
"""
181+
182+
host_header_override: Optional[str]
183+
"""Per-origin Host header override.
184+
185+
When set, the CDN sends this value as the Host header when requesting content
186+
from this origin instead of the default.
187+
"""
188+
189+
origin_type: Literal["host", "s3"]
190+
"""Origin type. Present in responses only for S3 sources.
191+
192+
Possible values:
193+
194+
- **host** - A source server or endpoint from which content is fetched.
195+
- **s3** - S3 storage with either AWS v4 authentication or public access.
196+
"""
197+
198+
tag: str
199+
"""Tag for the origin source."""
200+
201+
202+
NoneAuthSource: TypeAlias = Union[NoneAuthSourceChangeHostSource, NoneAuthSourceChangeS3Source]
86203

87204

88205
class AwsSignatureV4(TypedDict, total=False):
@@ -143,12 +260,7 @@ class AwsSignatureV4Auth(TypedDict, total=False):
143260
"""
144261

145262
s3_bucket_name: Required[str]
146-
"""S3 bucket name.
147-
148-
Restrictions:
149-
150-
- Maximum 128 characters.
151-
"""
263+
"""S3 bucket name."""
152264

153265
s3_secret_access_key: Required[str]
154266
"""Secret access key for the S3 account.

0 commit comments

Comments
 (0)