Skip to content

feat(tem): add support for Autoconfig #613

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions scaleway-async/scaleway_async/tem/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ async def create_domain(
*,
domain_name: str,
accept_tos: bool,
autoconfig: bool,
region: Optional[Region] = None,
project_id: Optional[str] = None,
) -> Domain:
Expand All @@ -454,6 +455,7 @@ async def create_domain(
You must specify the `region`, `project_id` and `domain_name` to register a domain in a specific Project.
:param domain_name: Fully qualified domain dame.
:param accept_tos: Accept Scaleway's Terms of Service.
:param autoconfig: Activate auto-configuration of the domain's DNS zone.
:param region: Region to target. If none is passed will use default region from the config.
:param project_id: ID of the project to which the domain belongs.
:return: :class:`Domain <Domain>`
Expand All @@ -464,6 +466,7 @@ async def create_domain(
result = await api.create_domain(
domain_name="example",
accept_tos=False,
autoconfig=False,
)
"""

Expand All @@ -478,6 +481,7 @@ async def create_domain(
CreateDomainRequest(
domain_name=domain_name,
accept_tos=accept_tos,
autoconfig=autoconfig,
region=region,
project_id=project_id,
),
Expand Down
11 changes: 9 additions & 2 deletions scaleway-async/scaleway_async/tem/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ def unmarshal_Domain(data: Any) -> Domain:
if field is not None:
args["spf_config"] = field

field = data.get("dkim_config", None)
if field is not None:
args["dkim_config"] = field

field = data.get("created_at", None)
if field is not None:
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
Expand All @@ -303,9 +307,9 @@ def unmarshal_Domain(data: Any) -> Domain:
else:
args["last_valid_at"] = None

field = data.get("dkim_config", None)
field = data.get("autoconfig", None)
if field is not None:
args["dkim_config"] = field
args["autoconfig"] = field

field = data.get("region", None)
if field is not None:
Expand Down Expand Up @@ -730,6 +734,9 @@ def marshal_CreateDomainRequest(
if request.accept_tos is not None:
output["accept_tos"] = request.accept_tos

if request.autoconfig is not None:
output["autoconfig"] = request.autoconfig

if request.project_id is not None:
output["project_id"] = request.project_id or defaults.default_project_id

Expand Down
14 changes: 12 additions & 2 deletions scaleway-async/scaleway_async/tem/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,11 @@ class Domain:
Snippet of the SPF record to register in the DNS zone.
"""

dkim_config: str
"""
DKIM public key to record in the DNS zone.
"""

created_at: Optional[datetime]
"""
Date and time of domain creation.
Expand All @@ -448,9 +453,9 @@ class Domain:
Date and time the domain was last valid.
"""

dkim_config: str
autoconfig: bool
"""
DKIM public key to record in the DNS zone.
Status of auto-configuration for the domain's DNS zone.
"""

region: Region
Expand Down Expand Up @@ -628,6 +633,11 @@ class CreateDomainRequest:
Accept Scaleway's Terms of Service.
"""

autoconfig: bool
"""
Activate auto-configuration of the domain's DNS zone.
"""

region: Optional[Region]
"""
Region to target. If none is passed will use default region from the config.
Expand Down
4 changes: 4 additions & 0 deletions scaleway/scaleway/tem/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ def create_domain(
*,
domain_name: str,
accept_tos: bool,
autoconfig: bool,
region: Optional[Region] = None,
project_id: Optional[str] = None,
) -> Domain:
Expand All @@ -454,6 +455,7 @@ def create_domain(
You must specify the `region`, `project_id` and `domain_name` to register a domain in a specific Project.
:param domain_name: Fully qualified domain dame.
:param accept_tos: Accept Scaleway's Terms of Service.
:param autoconfig: Activate auto-configuration of the domain's DNS zone.
:param region: Region to target. If none is passed will use default region from the config.
:param project_id: ID of the project to which the domain belongs.
:return: :class:`Domain <Domain>`
Expand All @@ -464,6 +466,7 @@ def create_domain(
result = api.create_domain(
domain_name="example",
accept_tos=False,
autoconfig=False,
)
"""

Expand All @@ -478,6 +481,7 @@ def create_domain(
CreateDomainRequest(
domain_name=domain_name,
accept_tos=accept_tos,
autoconfig=autoconfig,
region=region,
project_id=project_id,
),
Expand Down
11 changes: 9 additions & 2 deletions scaleway/scaleway/tem/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ def unmarshal_Domain(data: Any) -> Domain:
if field is not None:
args["spf_config"] = field

field = data.get("dkim_config", None)
if field is not None:
args["dkim_config"] = field

field = data.get("created_at", None)
if field is not None:
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
Expand All @@ -303,9 +307,9 @@ def unmarshal_Domain(data: Any) -> Domain:
else:
args["last_valid_at"] = None

field = data.get("dkim_config", None)
field = data.get("autoconfig", None)
if field is not None:
args["dkim_config"] = field
args["autoconfig"] = field

field = data.get("region", None)
if field is not None:
Expand Down Expand Up @@ -730,6 +734,9 @@ def marshal_CreateDomainRequest(
if request.accept_tos is not None:
output["accept_tos"] = request.accept_tos

if request.autoconfig is not None:
output["autoconfig"] = request.autoconfig

if request.project_id is not None:
output["project_id"] = request.project_id or defaults.default_project_id

Expand Down
14 changes: 12 additions & 2 deletions scaleway/scaleway/tem/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,11 @@ class Domain:
Snippet of the SPF record to register in the DNS zone.
"""

dkim_config: str
"""
DKIM public key to record in the DNS zone.
"""

created_at: Optional[datetime]
"""
Date and time of domain creation.
Expand All @@ -448,9 +453,9 @@ class Domain:
Date and time the domain was last valid.
"""

dkim_config: str
autoconfig: bool
"""
DKIM public key to record in the DNS zone.
Status of auto-configuration for the domain's DNS zone.
"""

region: Region
Expand Down Expand Up @@ -628,6 +633,11 @@ class CreateDomainRequest:
Accept Scaleway's Terms of Service.
"""

autoconfig: bool
"""
Activate auto-configuration of the domain's DNS zone.
"""

region: Optional[Region]
"""
Region to target. If none is passed will use default region from the config.
Expand Down