From abb7f1db42dfa75336ac57a304cef9fd9076b3bc Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 25 Jun 2026 09:17:37 +0000 Subject: [PATCH 1/3] Configurations: 'specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration/tspconfig.yaml', API Version: 2024-11-01, SDK Release Type: stable, and CommitSHA: 'e7c377b4c801d6fe9e256ca22f6d6a79114026a7' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6481716 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../CHANGELOG.md | 4 + .../azure-mgmt-domainregistration/README.md | 2 +- .../_metadata.json | 5 +- .../azure-mgmt-domainregistration/api.md | 1500 +++++++++++++++++ .../api.metadata.yml | 3 + .../apiview-properties.json | 3 +- .../azure/mgmt/domainregistration/_client.py | 13 +- .../mgmt/domainregistration/_configuration.py | 6 +- .../domainregistration/_utils/model_base.py | 435 ++++- .../_utils/serialization.py | 138 +- .../azure/mgmt/domainregistration/_version.py | 2 +- .../mgmt/domainregistration/aio/_client.py | 13 +- .../domainregistration/aio/_configuration.py | 6 +- .../aio/operations/_operations.py | 35 +- .../operations/_operations.py | 35 +- .../pyproject.toml | 8 +- .../tsp-location.yaml | 2 +- 17 files changed, 2117 insertions(+), 93 deletions(-) create mode 100644 sdk/domainregistration/azure-mgmt-domainregistration/api.md create mode 100644 sdk/domainregistration/azure-mgmt-domainregistration/api.metadata.yml diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/CHANGELOG.md b/sdk/domainregistration/azure-mgmt-domainregistration/CHANGELOG.md index 1261b1e58b7c..be0bc4d9cb7d 100644 --- a/sdk/domainregistration/azure-mgmt-domainregistration/CHANGELOG.md +++ b/sdk/domainregistration/azure-mgmt-domainregistration/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.0.0 (2026-06-25) + +tool can't generate changelog for this release, please update manually. + ## 1.0.0b1 (2026-04-28) ### Other Changes diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/README.md b/sdk/domainregistration/azure-mgmt-domainregistration/README.md index 0054730589c8..13ae9749e5b7 100644 --- a/sdk/domainregistration/azure-mgmt-domainregistration/README.md +++ b/sdk/domainregistration/azure-mgmt-domainregistration/README.md @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. +By default, [Microsoft Entra](https://learn.microsoft.com/entra/fundamentals/what-is-entra) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/_metadata.json b/sdk/domainregistration/azure-mgmt-domainregistration/_metadata.json index af8bd672771d..aa0566b74daf 100644 --- a/sdk/domainregistration/azure-mgmt-domainregistration/_metadata.json +++ b/sdk/domainregistration/azure-mgmt-domainregistration/_metadata.json @@ -3,8 +3,9 @@ "apiVersions": { "Microsoft.DomainRegistration": "2024-11-01" }, - "commit": "0bbf3007108984bcabfdcee134f1dfc9cb3e678e", + "commit": "e7c377b4c801d6fe9e256ca22f6d6a79114026a7", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration", - "emitterVersion": "0.61.3" + "emitterVersion": "0.63.2", + "httpClientPythonVersion": "^0.33.0" } \ No newline at end of file diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/api.md b/sdk/domainregistration/azure-mgmt-domainregistration/api.md new file mode 100644 index 000000000000..68974fb79559 --- /dev/null +++ b/sdk/domainregistration/azure-mgmt-domainregistration/api.md @@ -0,0 +1,1500 @@ +```py +namespace azure.mgmt.domainregistration + + class azure.mgmt.domainregistration.DomainRegistrationMgmtClient: implements ContextManager + domain_registration_provider: DomainRegistrationProviderOperations + domains: DomainsOperations + top_level_domains: TopLevelDomainsOperations + + def __init__( + self, + credential: TokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> HttpResponse: ... + + +namespace azure.mgmt.domainregistration.aio + + class azure.mgmt.domainregistration.aio.DomainRegistrationMgmtClient: implements AsyncContextManager + domain_registration_provider: DomainRegistrationProviderOperations + domains: DomainsOperations + top_level_domains: TopLevelDomainsOperations + + def __init__( + self, + credential: AsyncTokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + async def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: ... + + +namespace azure.mgmt.domainregistration.aio.operations + + class azure.mgmt.domainregistration.aio.operations.DomainRegistrationProviderOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list_operations(self, **kwargs: Any) -> AsyncItemPaged[CsmOperationDescription]: ... + + + class azure.mgmt.domainregistration.aio.operations.DomainsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + domain_name: str, + domain: Domain, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Domain]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + domain_name: str, + domain: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Domain]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + domain_name: str, + domain: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Domain]: ... + + @overload + async def check_availability( + self, + identifier: NameIdentifier, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DomainAvailabilityCheckResult: ... + + @overload + async def check_availability( + self, + identifier: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DomainAvailabilityCheckResult: ... + + @overload + async def check_availability( + self, + identifier: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DomainAvailabilityCheckResult: ... + + @overload + async def create_or_update_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + domain_ownership_identifier: DomainOwnershipIdentifier, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DomainOwnershipIdentifier: ... + + @overload + async def create_or_update_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + domain_ownership_identifier: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DomainOwnershipIdentifier: ... + + @overload + async def create_or_update_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + domain_ownership_identifier: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DomainOwnershipIdentifier: ... + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + domain_name: str, + *, + force_hard_delete_domain: Optional[bool] = ..., + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def delete_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + domain_name: str, + **kwargs: Any + ) -> Domain: ... + + @distributed_trace_async + async def get_control_center_sso_request(self, **kwargs: Any) -> DomainControlCenterSsoRequest: ... + + @distributed_trace_async + async def get_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + **kwargs: Any + ) -> DomainOwnershipIdentifier: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Domain]: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Domain]: ... + + @distributed_trace + def list_ownership_identifiers( + self, + resource_group_name: str, + domain_name: str, + **kwargs: Any + ) -> AsyncItemPaged[DomainOwnershipIdentifier]: ... + + @overload + def list_recommendations( + self, + parameters: DomainRecommendationSearchParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncItemPaged[NameIdentifier]: ... + + @overload + def list_recommendations( + self, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncItemPaged[NameIdentifier]: ... + + @overload + def list_recommendations( + self, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncItemPaged[NameIdentifier]: ... + + @distributed_trace_async + async def renew( + self, + resource_group_name: str, + domain_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def transfer_out( + self, + resource_group_name: str, + domain_name: str, + **kwargs: Any + ) -> Domain: ... + + @overload + async def update( + self, + resource_group_name: str, + domain_name: str, + domain: DomainPatchResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Domain: ... + + @overload + async def update( + self, + resource_group_name: str, + domain_name: str, + domain: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Domain: ... + + @overload + async def update( + self, + resource_group_name: str, + domain_name: str, + domain: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Domain: ... + + @overload + async def update_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + domain_ownership_identifier: DomainOwnershipIdentifier, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DomainOwnershipIdentifier: ... + + @overload + async def update_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + domain_ownership_identifier: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DomainOwnershipIdentifier: ... + + @overload + async def update_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + domain_ownership_identifier: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DomainOwnershipIdentifier: ... + + + class azure.mgmt.domainregistration.aio.operations.TopLevelDomainsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + name: str, + **kwargs: Any + ) -> TopLevelDomain: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[TopLevelDomain]: ... + + @overload + def list_agreements( + self, + name: str, + agreement_option: TopLevelDomainAgreementOption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncItemPaged[TldLegalAgreement]: ... + + @overload + def list_agreements( + self, + name: str, + agreement_option: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncItemPaged[TldLegalAgreement]: ... + + @overload + def list_agreements( + self, + name: str, + agreement_option: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncItemPaged[TldLegalAgreement]: ... + + +namespace azure.mgmt.domainregistration.models + + class azure.mgmt.domainregistration.models.Address(_Model): + address1: str + address2: Optional[str] + city: str + country: str + postal_code: str + state: str + + @overload + def __init__( + self, + *, + address1: str, + address2: Optional[str] = ..., + city: str, + country: str, + postal_code: str, + state: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.AzureResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + TRAFFIC_MANAGER = "TrafficManager" + WEBSITE = "Website" + + + class azure.mgmt.domainregistration.models.Contact(_Model): + address_mailing: Optional[Address] + email: str + fax: Optional[str] + job_title: Optional[str] + name_first: str + name_last: str + name_middle: Optional[str] + organization: Optional[str] + phone: str + + @overload + def __init__( + self, + *, + address_mailing: Optional[Address] = ..., + email: str, + fax: Optional[str] = ..., + job_title: Optional[str] = ..., + name_first: str, + name_last: str, + name_middle: Optional[str] = ..., + organization: Optional[str] = ..., + phone: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.domainregistration.models.CsmOperationDescription(_Model): + display: Optional[CsmOperationDisplay] + is_data_action: Optional[bool] + name: Optional[str] + origin: Optional[str] + properties: Optional[CsmOperationDescriptionProperties] + + @overload + def __init__( + self, + *, + display: Optional[CsmOperationDisplay] = ..., + is_data_action: Optional[bool] = ..., + name: Optional[str] = ..., + origin: Optional[str] = ..., + properties: Optional[CsmOperationDescriptionProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.CsmOperationDescriptionProperties(_Model): + service_specification: Optional[ServiceSpecification] + + @overload + def __init__( + self, + *, + service_specification: Optional[ServiceSpecification] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.CsmOperationDisplay(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + operation: Optional[str] = ..., + provider: Optional[str] = ..., + resource: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.CustomHostNameDnsRecordType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + A = "A" + C_NAME = "CName" + + + class azure.mgmt.domainregistration.models.DefaultErrorResponse(_Model): + error: Optional[DefaultErrorResponseError] + + + class azure.mgmt.domainregistration.models.DefaultErrorResponseError(_Model): + code: Optional[str] + details: Optional[list[DefaultErrorResponseErrorDetailsItem]] + innererror: Optional[str] + message: Optional[str] + target: Optional[str] + + @overload + def __init__( + self, + *, + details: Optional[list[DefaultErrorResponseErrorDetailsItem]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.DefaultErrorResponseErrorDetailsItem(_Model): + code: Optional[str] + message: Optional[str] + target: Optional[str] + + + class azure.mgmt.domainregistration.models.Dimension(_Model): + display_name: Optional[str] + internal_name: Optional[str] + name: Optional[str] + to_be_exported_for_shoebox: Optional[bool] + + @overload + def __init__( + self, + *, + display_name: Optional[str] = ..., + internal_name: Optional[str] = ..., + name: Optional[str] = ..., + to_be_exported_for_shoebox: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.DnsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_DNS = "AzureDns" + DEFAULT_DOMAIN_REGISTRAR_DNS = "DefaultDomainRegistrarDns" + + + class azure.mgmt.domainregistration.models.Domain(TrackedResource): + id: str + kind: Optional[str] + location: str + name: str + properties: Optional[DomainProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + kind: Optional[str] = ..., + location: str, + properties: Optional[DomainProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.domainregistration.models.DomainAvailabilityCheckResult(_Model): + available: Optional[bool] + domain_type: Optional[Union[str, DomainType]] + name: Optional[str] + + @overload + def __init__( + self, + *, + available: Optional[bool] = ..., + domain_type: Optional[Union[str, DomainType]] = ..., + name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.DomainControlCenterSsoRequest(_Model): + post_parameter_key: Optional[str] + post_parameter_value: Optional[str] + url: Optional[str] + + + class azure.mgmt.domainregistration.models.DomainOwnershipIdentifier(ProxyResource): + id: str + kind: Optional[str] + name: str + properties: Optional[DomainOwnershipIdentifierProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + kind: Optional[str] = ..., + properties: Optional[DomainOwnershipIdentifierProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.domainregistration.models.DomainOwnershipIdentifierProperties(_Model): + ownership_id: Optional[str] + + @overload + def __init__( + self, + *, + ownership_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.DomainPatchResource(ProxyOnlyResource): + id: str + kind: str + name: str + properties: Optional[DomainPatchResourceProperties] + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + kind: Optional[str] = ..., + properties: Optional[DomainPatchResourceProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.domainregistration.models.DomainPatchResourceProperties(_Model): + auth_code: Optional[str] + auto_renew: Optional[bool] + consent: DomainPurchaseConsent + contact_admin: Contact + contact_billing: Contact + contact_registrant: Contact + contact_tech: Contact + created_time: Optional[datetime] + dns_type: Optional[Union[str, DnsType]] + dns_zone_id: Optional[str] + domain_not_renewable_reasons: Optional[list[Union[str, ResourceNotRenewableReason]]] + expiration_time: Optional[datetime] + last_renewed_time: Optional[datetime] + managed_host_names: Optional[list[HostName]] + name_servers: Optional[list[str]] + privacy: Optional[bool] + provisioning_state: Optional[Union[str, ProvisioningState]] + ready_for_dns_record_management: Optional[bool] + registration_status: Optional[Union[str, DomainStatus]] + target_dns_type: Optional[Union[str, DnsType]] + + @overload + def __init__( + self, + *, + auth_code: Optional[str] = ..., + auto_renew: Optional[bool] = ..., + consent: DomainPurchaseConsent, + contact_admin: Contact, + contact_billing: Contact, + contact_registrant: Contact, + contact_tech: Contact, + dns_type: Optional[Union[str, DnsType]] = ..., + dns_zone_id: Optional[str] = ..., + privacy: Optional[bool] = ..., + target_dns_type: Optional[Union[str, DnsType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.DomainProperties(_Model): + auth_code: Optional[str] + auto_renew: Optional[bool] + consent: DomainPurchaseConsent + contact_admin: Contact + contact_billing: Contact + contact_registrant: Contact + contact_tech: Contact + created_time: Optional[datetime] + dns_type: Optional[Union[str, DnsType]] + dns_zone_id: Optional[str] + domain_not_renewable_reasons: Optional[list[Union[str, ResourceNotRenewableReason]]] + expiration_time: Optional[datetime] + last_renewed_time: Optional[datetime] + managed_host_names: Optional[list[HostName]] + name_servers: Optional[list[str]] + privacy: Optional[bool] + provisioning_state: Optional[Union[str, ProvisioningState]] + ready_for_dns_record_management: Optional[bool] + registration_status: Optional[Union[str, DomainStatus]] + target_dns_type: Optional[Union[str, DnsType]] + + @overload + def __init__( + self, + *, + auth_code: Optional[str] = ..., + auto_renew: Optional[bool] = ..., + consent: DomainPurchaseConsent, + contact_admin: Contact, + contact_billing: Contact, + contact_registrant: Contact, + contact_tech: Contact, + dns_type: Optional[Union[str, DnsType]] = ..., + dns_zone_id: Optional[str] = ..., + privacy: Optional[bool] = ..., + target_dns_type: Optional[Union[str, DnsType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.DomainPurchaseConsent(_Model): + agreed_at: Optional[datetime] + agreed_by: Optional[str] + agreement_keys: Optional[list[str]] + + @overload + def __init__( + self, + *, + agreed_at: Optional[datetime] = ..., + agreed_by: Optional[str] = ..., + agreement_keys: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.DomainRecommendationSearchParameters(_Model): + keywords: Optional[str] + max_domain_recommendations: Optional[int] + + @overload + def __init__( + self, + *, + keywords: Optional[str] = ..., + max_domain_recommendations: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.DomainStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "Active" + AWAITING = "Awaiting" + CANCELLED = "Cancelled" + CONFISCATED = "Confiscated" + DISABLED = "Disabled" + EXCLUDED = "Excluded" + EXPIRED = "Expired" + FAILED = "Failed" + HELD = "Held" + JSON_CONVERTER_FAILED = "JsonConverterFailed" + LOCKED = "Locked" + PARKED = "Parked" + PENDING = "Pending" + RESERVED = "Reserved" + REVERTED = "Reverted" + SUSPENDED = "Suspended" + TRANSFERRED = "Transferred" + UNKNOWN = "Unknown" + UNLOCKED = "Unlocked" + UNPARKED = "Unparked" + UPDATED = "Updated" + + + class azure.mgmt.domainregistration.models.DomainType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + REGULAR = "Regular" + SOFT_DELETED = "SoftDeleted" + + + class azure.mgmt.domainregistration.models.HostName(_Model): + azure_resource_name: Optional[str] + azure_resource_type: Optional[Union[str, AzureResourceType]] + custom_host_name_dns_record_type: Optional[Union[str, CustomHostNameDnsRecordType]] + host_name_type: Optional[Union[str, HostNameType]] + name: Optional[str] + site_names: Optional[list[str]] + + @overload + def __init__( + self, + *, + azure_resource_name: Optional[str] = ..., + azure_resource_type: Optional[Union[str, AzureResourceType]] = ..., + custom_host_name_dns_record_type: Optional[Union[str, CustomHostNameDnsRecordType]] = ..., + host_name_type: Optional[Union[str, HostNameType]] = ..., + name: Optional[str] = ..., + site_names: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.HostNameType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MANAGED = "Managed" + VERIFIED = "Verified" + + + class azure.mgmt.domainregistration.models.LogSpecification(_Model): + blob_duration: Optional[str] + display_name: Optional[str] + log_filter_pattern: Optional[str] + name: Optional[str] + + @overload + def __init__( + self, + *, + blob_duration: Optional[str] = ..., + display_name: Optional[str] = ..., + log_filter_pattern: Optional[str] = ..., + name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.MetricAvailability(_Model): + blob_duration: Optional[str] + time_grain: Optional[str] + + @overload + def __init__( + self, + *, + blob_duration: Optional[str] = ..., + time_grain: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.MetricSpecification(_Model): + aggregation_type: Optional[str] + availabilities: Optional[list[MetricAvailability]] + category: Optional[str] + dimensions: Optional[list[Dimension]] + display_description: Optional[str] + display_name: Optional[str] + enable_regional_mdm_account: Optional[bool] + fill_gap_with_zero: Optional[bool] + is_internal: Optional[bool] + metric_filter_pattern: Optional[str] + name: Optional[str] + source_mdm_account: Optional[str] + source_mdm_namespace: Optional[str] + supported_aggregation_types: Optional[list[str]] + supported_time_grain_types: Optional[list[str]] + supports_instance_level_aggregation: Optional[bool] + unit: Optional[str] + + @overload + def __init__( + self, + *, + aggregation_type: Optional[str] = ..., + availabilities: Optional[list[MetricAvailability]] = ..., + category: Optional[str] = ..., + dimensions: Optional[list[Dimension]] = ..., + display_description: Optional[str] = ..., + display_name: Optional[str] = ..., + enable_regional_mdm_account: Optional[bool] = ..., + fill_gap_with_zero: Optional[bool] = ..., + is_internal: Optional[bool] = ..., + metric_filter_pattern: Optional[str] = ..., + name: Optional[str] = ..., + source_mdm_account: Optional[str] = ..., + source_mdm_namespace: Optional[str] = ..., + supported_aggregation_types: Optional[list[str]] = ..., + supported_time_grain_types: Optional[list[str]] = ..., + supports_instance_level_aggregation: Optional[bool] = ..., + unit: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.NameIdentifier(_Model): + name: Optional[str] + + @overload + def __init__( + self, + *, + name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + DELETING = "Deleting" + FAILED = "Failed" + IN_PROGRESS = "InProgress" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.domainregistration.models.ProxyOnlyResource(_Model): + id: Optional[str] + kind: Optional[str] + name: Optional[str] + type: Optional[str] + + @overload + def __init__( + self, + *, + kind: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.ProxyResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.domainregistration.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.domainregistration.models.ResourceNotRenewableReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EXPIRATION_NOT_IN_RENEWAL_TIME_RANGE = "ExpirationNotInRenewalTimeRange" + REGISTRATION_STATUS_NOT_SUPPORTED_FOR_RENEWAL = "RegistrationStatusNotSupportedForRenewal" + SUBSCRIPTION_NOT_ACTIVE = "SubscriptionNotActive" + + + class azure.mgmt.domainregistration.models.ServiceSpecification(_Model): + log_specifications: Optional[list[LogSpecification]] + metric_specifications: Optional[list[MetricSpecification]] + + @overload + def __init__( + self, + *, + log_specifications: Optional[list[LogSpecification]] = ..., + metric_specifications: Optional[list[MetricSpecification]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.SystemData(_Model): + created_at: Optional[datetime] + created_by: Optional[str] + created_by_type: Optional[Union[str, CreatedByType]] + last_modified_at: Optional[datetime] + last_modified_by: Optional[str] + last_modified_by_type: Optional[Union[str, CreatedByType]] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + created_by: Optional[str] = ..., + created_by_type: Optional[Union[str, CreatedByType]] = ..., + last_modified_at: Optional[datetime] = ..., + last_modified_by: Optional[str] = ..., + last_modified_by_type: Optional[Union[str, CreatedByType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.TldLegalAgreement(_Model): + agreement_key: str + content: str + title: str + url: Optional[str] + + @overload + def __init__( + self, + *, + agreement_key: str, + content: str, + title: str, + url: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.TopLevelDomain(ProxyResource): + id: str + kind: Optional[str] + name: str + properties: Optional[TopLevelDomainProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + kind: Optional[str] = ..., + properties: Optional[TopLevelDomainProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.domainregistration.models.TopLevelDomainAgreementOption(_Model): + for_transfer: Optional[bool] + include_privacy: Optional[bool] + + @overload + def __init__( + self, + *, + for_transfer: Optional[bool] = ..., + include_privacy: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.TopLevelDomainProperties(_Model): + privacy: Optional[bool] + + @overload + def __init__( + self, + *, + privacy: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.domainregistration.models.TrackedResource(Resource): + id: str + location: str + name: str + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + +namespace azure.mgmt.domainregistration.operations + + class azure.mgmt.domainregistration.operations.DomainRegistrationProviderOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list_operations(self, **kwargs: Any) -> ItemPaged[CsmOperationDescription]: ... + + + class azure.mgmt.domainregistration.operations.DomainsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + domain_name: str, + domain: Domain, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Domain]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + domain_name: str, + domain: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Domain]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + domain_name: str, + domain: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Domain]: ... + + @overload + def check_availability( + self, + identifier: NameIdentifier, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DomainAvailabilityCheckResult: ... + + @overload + def check_availability( + self, + identifier: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DomainAvailabilityCheckResult: ... + + @overload + def check_availability( + self, + identifier: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DomainAvailabilityCheckResult: ... + + @overload + def create_or_update_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + domain_ownership_identifier: DomainOwnershipIdentifier, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DomainOwnershipIdentifier: ... + + @overload + def create_or_update_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + domain_ownership_identifier: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DomainOwnershipIdentifier: ... + + @overload + def create_or_update_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + domain_ownership_identifier: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DomainOwnershipIdentifier: ... + + @distributed_trace + def delete( + self, + resource_group_name: str, + domain_name: str, + *, + force_hard_delete_domain: Optional[bool] = ..., + **kwargs: Any + ) -> None: ... + + @distributed_trace + def delete_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + domain_name: str, + **kwargs: Any + ) -> Domain: ... + + @distributed_trace + def get_control_center_sso_request(self, **kwargs: Any) -> DomainControlCenterSsoRequest: ... + + @distributed_trace + def get_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + **kwargs: Any + ) -> DomainOwnershipIdentifier: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Domain]: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[Domain]: ... + + @distributed_trace + def list_ownership_identifiers( + self, + resource_group_name: str, + domain_name: str, + **kwargs: Any + ) -> ItemPaged[DomainOwnershipIdentifier]: ... + + @overload + def list_recommendations( + self, + parameters: DomainRecommendationSearchParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged[NameIdentifier]: ... + + @overload + def list_recommendations( + self, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged[NameIdentifier]: ... + + @overload + def list_recommendations( + self, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged[NameIdentifier]: ... + + @distributed_trace + def renew( + self, + resource_group_name: str, + domain_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def transfer_out( + self, + resource_group_name: str, + domain_name: str, + **kwargs: Any + ) -> Domain: ... + + @overload + def update( + self, + resource_group_name: str, + domain_name: str, + domain: DomainPatchResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Domain: ... + + @overload + def update( + self, + resource_group_name: str, + domain_name: str, + domain: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Domain: ... + + @overload + def update( + self, + resource_group_name: str, + domain_name: str, + domain: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Domain: ... + + @overload + def update_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + domain_ownership_identifier: DomainOwnershipIdentifier, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DomainOwnershipIdentifier: ... + + @overload + def update_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + domain_ownership_identifier: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DomainOwnershipIdentifier: ... + + @overload + def update_ownership_identifier( + self, + resource_group_name: str, + domain_name: str, + name: str, + domain_ownership_identifier: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> DomainOwnershipIdentifier: ... + + + class azure.mgmt.domainregistration.operations.TopLevelDomainsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + name: str, + **kwargs: Any + ) -> TopLevelDomain: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[TopLevelDomain]: ... + + @overload + def list_agreements( + self, + name: str, + agreement_option: TopLevelDomainAgreementOption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged[TldLegalAgreement]: ... + + @overload + def list_agreements( + self, + name: str, + agreement_option: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged[TldLegalAgreement]: ... + + @overload + def list_agreements( + self, + name: str, + agreement_option: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ItemPaged[TldLegalAgreement]: ... + + +``` \ No newline at end of file diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/api.metadata.yml b/sdk/domainregistration/azure-mgmt-domainregistration/api.metadata.yml new file mode 100644 index 000000000000..a9749567d5e8 --- /dev/null +++ b/sdk/domainregistration/azure-mgmt-domainregistration/api.metadata.yml @@ -0,0 +1,3 @@ +apiMdSha256: b061f2c28a1a93f312c9c417823aad586c13130a87cf3be4414523d1dee47828 +parserVersion: 0.3.28 +pythonVersion: 3.13.13 diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/apiview-properties.json b/sdk/domainregistration/azure-mgmt-domainregistration/apiview-properties.json index 81ab08d08733..3430b73286eb 100644 --- a/sdk/domainregistration/azure-mgmt-domainregistration/apiview-properties.json +++ b/sdk/domainregistration/azure-mgmt-domainregistration/apiview-properties.json @@ -84,5 +84,6 @@ "azure.mgmt.domainregistration.aio.operations.TopLevelDomainsOperations.list_agreements": "Microsoft.DomainRegistration.TopLevelDomains.listAgreements", "azure.mgmt.domainregistration.operations.DomainRegistrationProviderOperations.list_operations": "Azure.ResourceManager.Legacy.Operations.list", "azure.mgmt.domainregistration.aio.operations.DomainRegistrationProviderOperations.list_operations": "Azure.ResourceManager.Legacy.Operations.list" - } + }, + "CrossLanguageVersion": "0b64337fa00e" } \ No newline at end of file diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_client.py b/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_client.py index b74e5cc0c494..957f089aa0a6 100644 --- a/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_client.py +++ b/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse @@ -21,6 +21,11 @@ from ._utils.serialization import Deserializer, Serializer from .operations import DomainRegistrationProviderOperations, DomainsOperations, TopLevelDomainsOperations +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials import TokenCredential @@ -45,9 +50,9 @@ class DomainRegistrationMgmtClient: :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are "2024-11-01". - Default value is "2024-11-01". Note that overriding this default value may result in - unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2024-11-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_configuration.py b/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_configuration.py index 63e0566f8871..aab1ad0b9c0c 100644 --- a/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_configuration.py +++ b/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_configuration.py @@ -33,9 +33,9 @@ class DomainRegistrationMgmtClientConfiguration: # pylint: disable=too-many-ins :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are "2024-11-01". - Default value is "2024-11-01". Note that overriding this default value may result in - unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2024-11-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_utils/model_base.py b/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_utils/model_base.py index db24930fdca9..b93f5120d517 100644 --- a/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_utils/model_base.py +++ b/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_utils/model_base.py @@ -23,14 +23,19 @@ from json import JSONEncoder import xml.etree.ElementTree as ET from collections.abc import MutableMapping -from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError from azure.core import CaseInsensitiveEnumMeta from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null + from azure.core.rest import HttpResponse +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _LOGGER = logging.getLogger(__name__) __all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] @@ -104,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: return encoded +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + def _serialize_datetime(o, format: typing.Optional[str] = None): if hasattr(o, "year") and hasattr(o, "hour"): if format == "rfc7231": @@ -296,6 +324,12 @@ def _deserialize_duration(attr): return isodate.parse_duration(attr) +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + def _deserialize_decimal(attr): if isinstance(attr, decimal.Decimal): return attr @@ -325,6 +359,10 @@ def _deserialize_int_as_str(attr): "unix-timestamp": _deserialize_datetime_unix_timestamp, "base64": _deserialize_bytes, "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), } @@ -559,7 +597,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m pass # Last, try datetime.timedelta try: - return _timedelta_as_isostr(o) + return _serialize_duration(o, format) except AttributeError: # This will be raised when it hits value.total_seconds in the method above pass @@ -585,6 +623,239 @@ def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typin return _serialize(value, rf._format) +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated @@ -595,11 +866,7 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ if len(args) > 1: raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass = { - rest_field._rest_name: rest_field._default - for rest_field in self._attr_to_rest_field.values() - if rest_field._default is not _UNSET - } + dict_to_pass: dict[str, typing.Any] = {} if args: if isinstance(args[0], ET.Element): dict_to_pass.update(self._init_from_xml(args[0])) @@ -619,9 +886,19 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if v is not None } ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) super().__init__(dict_to_pass) - def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]: + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: """Deserialize an XML element into a dict mapping rest field names to values. :param ET.Element element: The XML element to deserialize from. @@ -629,53 +906,89 @@ def _init_from_xml(self, element: ET.Element) -> dict[str, typing.Any]: :rtype: dict """ result: dict[str, typing.Any] = {} - model_meta = getattr(self, "_xml", {}) existed_attr_keys: list[str] = [] - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = _resolve_xml_ns(prop_meta, model_meta) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and element.get(xml_name) is not None: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - _items_name = prop_meta.get("itemsName") - if _items_name: - xml_name = _items_name - _items_ns = prop_meta.get("itemsNs") - if _items_ns is not None: - xml_ns = _items_ns - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = element.findall(xml_name) # pyright: ignore - if len(items) > 0: + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, items) - elif not rf._is_optional: + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: existed_attr_keys.append(xml_name) - result[rf._rest_name] = [] - continue - - # text element is primitive type - if prop_meta.get("text", False): - if element.text is not None: - result[rf._rest_name] = _deserialize(rf._type, element.text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = element.find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, item) + result[rf._rest_name] = _deserialize(rf._type, item) # rest thing is additional properties for e in element: @@ -708,6 +1021,9 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if not rf._rest_name_input: rf._rest_name_input = attr cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) @@ -1082,6 +1398,7 @@ def __init__( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ): self._type = type self._rest_name_input = name @@ -1094,6 +1411,7 @@ def __init__( self._format = format self._is_multipart_file_input = is_multipart_file_input self._xml = xml if xml is not None else {} + self._deserializer = deserializer @property def _class_type(self) -> typing.Any: @@ -1113,7 +1431,10 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class # Use _data.get() directly to avoid triggering __getitem__ which clears the cache - item = obj._data.get(self._rest_name) + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None if item is None: return item if self._is_model: @@ -1126,7 +1447,11 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # Return the value from _data directly (it's been deserialized in place) return obj._data.get(self._rest_name) - deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) # For mutable types, store the deserialized value back in _data # so mutations directly affect _data @@ -1172,6 +1497,7 @@ def rest_field( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ) -> typing.Any: return _RestField( name=name, @@ -1181,6 +1507,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + deserializer=deserializer, ) @@ -1414,6 +1741,8 @@ def _deserialize_xml( value: str, ) -> typing.Any: element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) return _deserialize(deserializer, element) diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_utils/serialization.py b/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_utils/serialization.py index 81ec1de5922b..75906e2eb77f 100644 --- a/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_utils/serialization.py +++ b/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_utils/serialization.py @@ -39,11 +39,15 @@ import xml.etree.ElementTree as ET import isodate # type: ignore -from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") JSON = MutableMapping[str, Any] @@ -516,6 +520,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -1105,6 +1113,61 @@ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. @@ -1377,6 +1440,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1389,6 +1456,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } self.dependencies: dict[str, type] = dict(classes) if classes else {} @@ -1401,7 +1472,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: # Otherwise, result are unexpected self.additional_properties_detection = True - def __call__(self, target_obj, response_data, content_type=None): + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements """Call the deserializer to process a REST response. :param str target_obj: Target data type to deserialize to. @@ -1411,6 +1482,27 @@ def __call__(self, target_obj, response_data, content_type=None): :return: Deserialized object. :rtype: object """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) @@ -1929,6 +2021,48 @@ def deserialize_duration(attr): raise DeserializationError(msg) from err return duration + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_version.py b/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_version.py index be71c81bd282..0ec13ea52bbf 100644 --- a/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_version.py +++ b/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b1" +VERSION = "1.0.0" diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/aio/_client.py b/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/aio/_client.py index 3778e7e2459c..c28e7148d05f 100644 --- a/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/aio/_client.py +++ b/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/aio/_client.py @@ -7,8 +7,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest @@ -21,6 +21,11 @@ from ._configuration import DomainRegistrationMgmtClientConfiguration from .operations import DomainRegistrationProviderOperations, DomainsOperations, TopLevelDomainsOperations +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential @@ -46,9 +51,9 @@ class DomainRegistrationMgmtClient: :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are "2024-11-01". - Default value is "2024-11-01". Note that overriding this default value may result in - unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2024-11-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/aio/_configuration.py b/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/aio/_configuration.py index 07ed8f6917f5..5c2be56f616d 100644 --- a/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/aio/_configuration.py +++ b/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/aio/_configuration.py @@ -33,9 +33,9 @@ class DomainRegistrationMgmtClientConfiguration: # pylint: disable=too-many-ins :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are "2024-11-01". - Default value is "2024-11-01". Note that overriding this default value may result in - unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2024-11-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/aio/operations/_operations.py b/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/aio/operations/_operations.py index cff15b4ef860..b4e39c0eab49 100644 --- a/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/aio/operations/_operations.py +++ b/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/aio/operations/_operations.py @@ -693,7 +693,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -785,7 +788,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1576,7 +1582,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1949,7 +1958,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2130,7 +2142,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2309,7 +2324,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2423,7 +2441,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/operations/_operations.py b/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/operations/_operations.py index 333237cbb166..6757d248d745 100644 --- a/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/operations/_operations.py +++ b/sdk/domainregistration/azure-mgmt-domainregistration/azure/mgmt/domainregistration/operations/_operations.py @@ -1223,7 +1223,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1315,7 +1318,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2108,7 +2114,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2477,7 +2486,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2657,7 +2669,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2832,7 +2847,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2946,7 +2964,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/pyproject.toml b/sdk/domainregistration/azure-mgmt-domainregistration/pyproject.toml index 7be27255f79b..366e6248abbb 100644 --- a/sdk/domainregistration/azure-mgmt-domainregistration/pyproject.toml +++ b/sdk/domainregistration/azure-mgmt-domainregistration/pyproject.toml @@ -13,17 +13,17 @@ authors = [ description = "Microsoft Azure Domainregistration Management Client Library for Python" license = "MIT" classifiers = [ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] -requires-python = ">=3.9" +requires-python = ">=3.10" keywords = [ "azure", "azure sdk", @@ -77,7 +77,7 @@ package_name = "azure-mgmt-domainregistration" package_nspkg = "azure-mgmt-nspkg" package_pprint_name = "Domainregistration Management" package_doc_id = "" -is_stable = false +is_stable = true is_arm = true need_msrestazure = false need_azuremgmtcore = true diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/tsp-location.yaml b/sdk/domainregistration/azure-mgmt-domainregistration/tsp-location.yaml index 50915d175425..ad58af7e1217 100644 --- a/sdk/domainregistration/azure-mgmt-domainregistration/tsp-location.yaml +++ b/sdk/domainregistration/azure-mgmt-domainregistration/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/domainregistration/resource-manager/Microsoft.DomainRegistration/DomainRegistration -commit: 0bbf3007108984bcabfdcee134f1dfc9cb3e678e +commit: e7c377b4c801d6fe9e256ca22f6d6a79114026a7 repo: Azure/azure-rest-api-specs additionalDirectories: From da1650396cf72ca5c797053f1cc093b1cf520ce6 Mon Sep 17 00:00:00 2001 From: "Chenxi Jiang (WICRESOFT NORTH AMERICA LTD)" Date: Thu, 25 Jun 2026 17:23:07 +0800 Subject: [PATCH 2/3] Optimize changelog for azure-mgmt-domainregistration --- .../azure-mgmt-domainregistration/CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/CHANGELOG.md b/sdk/domainregistration/azure-mgmt-domainregistration/CHANGELOG.md index be0bc4d9cb7d..31ce0e4e27c6 100644 --- a/sdk/domainregistration/azure-mgmt-domainregistration/CHANGELOG.md +++ b/sdk/domainregistration/azure-mgmt-domainregistration/CHANGELOG.md @@ -2,7 +2,9 @@ ## 1.0.0 (2026-06-25) -tool can't generate changelog for this release, please update manually. +### Other Changes + + - First GA version ## 1.0.0b1 (2026-04-28) From 7eb59a01ccb10ec119ef9eee101417ea2a644047 Mon Sep 17 00:00:00 2001 From: "Chenxi Jiang (WICRESOFT NORTH AMERICA LTD)" Date: Thu, 25 Jun 2026 17:24:12 +0800 Subject: [PATCH 3/3] Add live tests for azure-mgmt-domainregistration --- .../tests/conftest.py | 41 +++++++++++++++++++ ...stration_provider_operations_async_test.py | 28 +++++++++++++ ...n_registration_provider_operations_test.py | 27 ++++++++++++ ...tion_mgmt_domains_operations_async_test.py | 35 ++++++++++++++++ ...gistration_mgmt_domains_operations_test.py | 34 +++++++++++++++ ...top_level_domains_operations_async_test.py | 28 +++++++++++++ ..._mgmt_top_level_domains_operations_test.py | 27 ++++++++++++ 7 files changed, 220 insertions(+) create mode 100644 sdk/domainregistration/azure-mgmt-domainregistration/tests/conftest.py create mode 100644 sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_domain_registration_provider_operations_async_test.py create mode 100644 sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_domain_registration_provider_operations_test.py create mode 100644 sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_domains_operations_async_test.py create mode 100644 sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_domains_operations_test.py create mode 100644 sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_top_level_domains_operations_async_test.py create mode 100644 sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_top_level_domains_operations_test.py diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/tests/conftest.py b/sdk/domainregistration/azure-mgmt-domainregistration/tests/conftest.py new file mode 100644 index 000000000000..d4c7abddc25d --- /dev/null +++ b/sdk/domainregistration/azure-mgmt-domainregistration/tests/conftest.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# For security, please avoid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + domainregistrationmgmt_subscription_id = os.environ.get( + "AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" + ) + domainregistrationmgmt_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") + domainregistrationmgmt_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + domainregistrationmgmt_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer( + regex=domainregistrationmgmt_subscription_id, value="00000000-0000-0000-0000-000000000000" + ) + add_general_regex_sanitizer(regex=domainregistrationmgmt_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=domainregistrationmgmt_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer( + regex=domainregistrationmgmt_client_secret, value="00000000-0000-0000-0000-000000000000" + ) + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_domain_registration_provider_operations_async_test.py b/sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_domain_registration_provider_operations_async_test.py new file mode 100644 index 000000000000..6f31ccb7bc2b --- /dev/null +++ b/sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_domain_registration_provider_operations_async_test.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.domainregistration.aio import DomainRegistrationMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestDomainRegistrationMgmtDomainRegistrationProviderOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DomainRegistrationMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_domain_registration_provider_list_operations(self, resource_group): + response = self.client.domain_registration_provider.list_operations() + result = [r async for r in response] + assert len(result) >= 0 + \ No newline at end of file diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_domain_registration_provider_operations_test.py b/sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_domain_registration_provider_operations_test.py new file mode 100644 index 000000000000..bda22e4e1954 --- /dev/null +++ b/sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_domain_registration_provider_operations_test.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.domainregistration import DomainRegistrationMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestDomainRegistrationMgmtDomainRegistrationProviderOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DomainRegistrationMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_domain_registration_provider_list_operations(self, resource_group): + response = self.client.domain_registration_provider.list_operations() + result = [r for r in response] + assert len(result) >= 0 + \ No newline at end of file diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_domains_operations_async_test.py b/sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_domains_operations_async_test.py new file mode 100644 index 000000000000..145d78f8902e --- /dev/null +++ b/sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_domains_operations_async_test.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.domainregistration.aio import DomainRegistrationMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestDomainRegistrationMgmtDomainsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DomainRegistrationMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_domains_list(self, resource_group): + response = self.client.domains.list() + result = [r async for r in response] + assert len(result) >= 0 + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_domains_get_control_center_sso_request(self, resource_group): + response = await self.client.domains.get_control_center_sso_request() + + assert response is not None + \ No newline at end of file diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_domains_operations_test.py b/sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_domains_operations_test.py new file mode 100644 index 000000000000..37a422b074be --- /dev/null +++ b/sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_domains_operations_test.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.domainregistration import DomainRegistrationMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestDomainRegistrationMgmtDomainsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DomainRegistrationMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_domains_list(self, resource_group): + response = self.client.domains.list() + result = [r for r in response] + assert len(result) >= 0 + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_domains_get_control_center_sso_request(self, resource_group): + response = self.client.domains.get_control_center_sso_request() + + assert response is not None + \ No newline at end of file diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_top_level_domains_operations_async_test.py b/sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_top_level_domains_operations_async_test.py new file mode 100644 index 000000000000..c654f46f992f --- /dev/null +++ b/sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_top_level_domains_operations_async_test.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.domainregistration.aio import DomainRegistrationMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestDomainRegistrationMgmtTopLevelDomainsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DomainRegistrationMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_top_level_domains_list(self, resource_group): + response = self.client.top_level_domains.list() + result = [r async for r in response] + assert len(result) >= 0 + \ No newline at end of file diff --git a/sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_top_level_domains_operations_test.py b/sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_top_level_domains_operations_test.py new file mode 100644 index 000000000000..14deb9d1256a --- /dev/null +++ b/sdk/domainregistration/azure-mgmt-domainregistration/tests/test_domain_registration_mgmt_top_level_domains_operations_test.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.domainregistration import DomainRegistrationMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.live_test_only +class TestDomainRegistrationMgmtTopLevelDomainsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DomainRegistrationMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_top_level_domains_list(self, resource_group): + response = self.client.top_level_domains.list() + result = [r for r in response] + assert len(result) >= 0 + \ No newline at end of file