Skip to content

Commit 14b6eae

Browse files
feat(tem): add support for Autoconfig (#613)
Co-authored-by: Laure-di <[email protected]>
1 parent b823b0c commit 14b6eae

File tree

6 files changed

+50
-8
lines changed

6 files changed

+50
-8
lines changed

scaleway-async/scaleway_async/tem/v1alpha1/api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ async def create_domain(
446446
*,
447447
domain_name: str,
448448
accept_tos: bool,
449+
autoconfig: bool,
449450
region: Optional[Region] = None,
450451
project_id: Optional[str] = None,
451452
) -> Domain:
@@ -454,6 +455,7 @@ async def create_domain(
454455
You must specify the `region`, `project_id` and `domain_name` to register a domain in a specific Project.
455456
:param domain_name: Fully qualified domain dame.
456457
:param accept_tos: Accept Scaleway's Terms of Service.
458+
:param autoconfig: Activate auto-configuration of the domain's DNS zone.
457459
:param region: Region to target. If none is passed will use default region from the config.
458460
:param project_id: ID of the project to which the domain belongs.
459461
:return: :class:`Domain <Domain>`
@@ -464,6 +466,7 @@ async def create_domain(
464466
result = await api.create_domain(
465467
domain_name="example",
466468
accept_tos=False,
469+
autoconfig=False,
467470
)
468471
"""
469472

@@ -478,6 +481,7 @@ async def create_domain(
478481
CreateDomainRequest(
479482
domain_name=domain_name,
480483
accept_tos=accept_tos,
484+
autoconfig=autoconfig,
481485
region=region,
482486
project_id=project_id,
483487
),

scaleway-async/scaleway_async/tem/v1alpha1/marshalling.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ def unmarshal_Domain(data: Any) -> Domain:
281281
if field is not None:
282282
args["spf_config"] = field
283283

284+
field = data.get("dkim_config", None)
285+
if field is not None:
286+
args["dkim_config"] = field
287+
284288
field = data.get("created_at", None)
285289
if field is not None:
286290
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
@@ -303,9 +307,9 @@ def unmarshal_Domain(data: Any) -> Domain:
303307
else:
304308
args["last_valid_at"] = None
305309

306-
field = data.get("dkim_config", None)
310+
field = data.get("autoconfig", None)
307311
if field is not None:
308-
args["dkim_config"] = field
312+
args["autoconfig"] = field
309313

310314
field = data.get("region", None)
311315
if field is not None:
@@ -730,6 +734,9 @@ def marshal_CreateDomainRequest(
730734
if request.accept_tos is not None:
731735
output["accept_tos"] = request.accept_tos
732736

737+
if request.autoconfig is not None:
738+
output["autoconfig"] = request.autoconfig
739+
733740
if request.project_id is not None:
734741
output["project_id"] = request.project_id or defaults.default_project_id
735742

scaleway-async/scaleway_async/tem/v1alpha1/types.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,11 @@ class Domain:
433433
Snippet of the SPF record to register in the DNS zone.
434434
"""
435435

436+
dkim_config: str
437+
"""
438+
DKIM public key to record in the DNS zone.
439+
"""
440+
436441
created_at: Optional[datetime]
437442
"""
438443
Date and time of domain creation.
@@ -448,9 +453,9 @@ class Domain:
448453
Date and time the domain was last valid.
449454
"""
450455

451-
dkim_config: str
456+
autoconfig: bool
452457
"""
453-
DKIM public key to record in the DNS zone.
458+
Status of auto-configuration for the domain's DNS zone.
454459
"""
455460

456461
region: Region
@@ -628,6 +633,11 @@ class CreateDomainRequest:
628633
Accept Scaleway's Terms of Service.
629634
"""
630635

636+
autoconfig: bool
637+
"""
638+
Activate auto-configuration of the domain's DNS zone.
639+
"""
640+
631641
region: Optional[Region]
632642
"""
633643
Region to target. If none is passed will use default region from the config.

scaleway/scaleway/tem/v1alpha1/api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ def create_domain(
446446
*,
447447
domain_name: str,
448448
accept_tos: bool,
449+
autoconfig: bool,
449450
region: Optional[Region] = None,
450451
project_id: Optional[str] = None,
451452
) -> Domain:
@@ -454,6 +455,7 @@ def create_domain(
454455
You must specify the `region`, `project_id` and `domain_name` to register a domain in a specific Project.
455456
:param domain_name: Fully qualified domain dame.
456457
:param accept_tos: Accept Scaleway's Terms of Service.
458+
:param autoconfig: Activate auto-configuration of the domain's DNS zone.
457459
:param region: Region to target. If none is passed will use default region from the config.
458460
:param project_id: ID of the project to which the domain belongs.
459461
:return: :class:`Domain <Domain>`
@@ -464,6 +466,7 @@ def create_domain(
464466
result = api.create_domain(
465467
domain_name="example",
466468
accept_tos=False,
469+
autoconfig=False,
467470
)
468471
"""
469472

@@ -478,6 +481,7 @@ def create_domain(
478481
CreateDomainRequest(
479482
domain_name=domain_name,
480483
accept_tos=accept_tos,
484+
autoconfig=autoconfig,
481485
region=region,
482486
project_id=project_id,
483487
),

scaleway/scaleway/tem/v1alpha1/marshalling.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ def unmarshal_Domain(data: Any) -> Domain:
281281
if field is not None:
282282
args["spf_config"] = field
283283

284+
field = data.get("dkim_config", None)
285+
if field is not None:
286+
args["dkim_config"] = field
287+
284288
field = data.get("created_at", None)
285289
if field is not None:
286290
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
@@ -303,9 +307,9 @@ def unmarshal_Domain(data: Any) -> Domain:
303307
else:
304308
args["last_valid_at"] = None
305309

306-
field = data.get("dkim_config", None)
310+
field = data.get("autoconfig", None)
307311
if field is not None:
308-
args["dkim_config"] = field
312+
args["autoconfig"] = field
309313

310314
field = data.get("region", None)
311315
if field is not None:
@@ -730,6 +734,9 @@ def marshal_CreateDomainRequest(
730734
if request.accept_tos is not None:
731735
output["accept_tos"] = request.accept_tos
732736

737+
if request.autoconfig is not None:
738+
output["autoconfig"] = request.autoconfig
739+
733740
if request.project_id is not None:
734741
output["project_id"] = request.project_id or defaults.default_project_id
735742

scaleway/scaleway/tem/v1alpha1/types.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,11 @@ class Domain:
433433
Snippet of the SPF record to register in the DNS zone.
434434
"""
435435

436+
dkim_config: str
437+
"""
438+
DKIM public key to record in the DNS zone.
439+
"""
440+
436441
created_at: Optional[datetime]
437442
"""
438443
Date and time of domain creation.
@@ -448,9 +453,9 @@ class Domain:
448453
Date and time the domain was last valid.
449454
"""
450455

451-
dkim_config: str
456+
autoconfig: bool
452457
"""
453-
DKIM public key to record in the DNS zone.
458+
Status of auto-configuration for the domain's DNS zone.
454459
"""
455460

456461
region: Region
@@ -628,6 +633,11 @@ class CreateDomainRequest:
628633
Accept Scaleway's Terms of Service.
629634
"""
630635

636+
autoconfig: bool
637+
"""
638+
Activate auto-configuration of the domain's DNS zone.
639+
"""
640+
631641
region: Optional[Region]
632642
"""
633643
Region to target. If none is passed will use default region from the config.

0 commit comments

Comments
 (0)