22
33from __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
88from ..._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
1322class 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
88205class 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