From b0cc43d7565c680c67f5aad5621d8e56b10af73c Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Mon, 20 Jul 2026 06:40:53 +0000 Subject: [PATCH 1/2] Configurations: 'specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/HybridKubernetes/tspconfig.yaml', API Version: 2026-05-01, SDK Release Type: stable, and CommitSHA: 'cf49df24bee763924bb4d9abceebe4fd1916a6ad' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6585975 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../azure-mgmt-hybridkubernetes/CHANGELOG.md | 55 + .../azure-mgmt-hybridkubernetes/README.md | 2 +- .../_metadata.json | 7 +- .../azure-mgmt-hybridkubernetes/api.md | 1067 +++++++++++++++++ .../api.metadata.yml | 3 + .../apiview-properties.json | 2 +- .../azure/mgmt/hybridkubernetes/_patch.py | 1 + .../hybridkubernetes/_utils/model_base.py | 428 ++++++- .../hybridkubernetes/_utils/serialization.py | 132 +- .../azure/mgmt/hybridkubernetes/_version.py | 2 +- .../azure/mgmt/hybridkubernetes/aio/_patch.py | 1 + .../aio/operations/_operations.py | 47 +- .../hybridkubernetes/aio/operations/_patch.py | 1 + .../mgmt/hybridkubernetes/models/_patch.py | 1 + .../operations/_operations.py | 47 +- .../hybridkubernetes/operations/_patch.py | 1 + .../azure/mgmt/hybridkubernetes/types.py | 527 ++++++++ .../pyproject.toml | 5 +- .../tsp-location.yaml | 4 +- 19 files changed, 2221 insertions(+), 112 deletions(-) create mode 100644 sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/api.md create mode 100644 sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/api.metadata.yml create mode 100644 sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/types.py diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/CHANGELOG.md b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/CHANGELOG.md index 3c8b14850539..f29dfb60d07b 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/CHANGELOG.md +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/CHANGELOG.md @@ -1,5 +1,60 @@ # Release History +## 2.0.0 (2026-07-20) + +### Features Added + + - Client `ConnectedKubernetesClient` added method `send_request` + - Model `ConnectedCluster` added property `kind` + - Model `ConnectedCluster` added property `properties` + - Enum `ConnectivityStatus` added member `AGENT_NOT_INSTALLED` + - Model `HybridConnectionConfig` added property `relay_tid` + - Model `HybridConnectionConfig` added property `relay_type` + - Model `Operation` added property `action_type` + - Model `Operation` added property `is_data_action` + - Model `Operation` added property `origin` + - Model `Resource` added property `system_data` + - Model `TrackedResource` added property `system_data` + - Added model `AadProfile` + - Added enum `ActionType` + - Added model `AgentError` + - Added model `ArcAgentProfile` + - Added model `ArcAgentryConfigurations` + - Added enum `AutoUpgradeOptions` + - Added enum `AzureHybridBenefit` + - Added enum `ConnectedClusterKind` + - Added model `ConnectedClusterPatchProperties` + - Added model `ConnectedClusterProperties` + - Added model `Gateway` + - Added model `OidcIssuerProfile` + - Added enum `Origin` + - Added enum `PrivateLinkState` + - Added model `SecurityProfile` + - Added model `SecurityProfileWorkloadIdentity` + - Added model `SystemComponent` + - Model `ConnectedClusterOperations` added method `begin_create_or_replace` + - Model `ConnectedClusterOperations` added method `begin_update_async` + +### Breaking Changes + + - Model `ConnectedCluster` deleted or renamed its instance variable `agent_public_key_certificate` + - Model `ConnectedCluster` deleted or renamed its instance variable `agent_version` + - Model `ConnectedCluster` deleted or renamed its instance variable `connectivity_status` + - Model `ConnectedCluster` deleted or renamed its instance variable `distribution` + - Model `ConnectedCluster` deleted or renamed its instance variable `infrastructure` + - Model `ConnectedCluster` deleted or renamed its instance variable `kubernetes_version` + - Model `ConnectedCluster` deleted or renamed its instance variable `last_connectivity_time` + - Model `ConnectedCluster` deleted or renamed its instance variable `managed_identity_certificate_expiration_time` + - Model `ConnectedCluster` deleted or renamed its instance variable `offering` + - Model `ConnectedCluster` deleted or renamed its instance variable `provisioning_state` + - Model `ConnectedCluster` deleted or renamed its instance variable `total_core_count` + - Model `ConnectedCluster` deleted or renamed its instance variable `total_node_count` + - Deleted or renamed model `ConnectedClusterList` + - Deleted or renamed model `LastModifiedByType` + - Deleted or renamed model `OperationList` + - Deleted or renamed method `ConnectedClusterOperations.begin_create` + - Deleted or renamed method `ConnectedClusterOperations.update` + ## 2.0.0b1 (2026-05-20) ### Features Added diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/README.md b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/README.md index 31a91500fab1..7b71b4d15209 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/README.md +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/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/hybridkubernetes/azure-mgmt-hybridkubernetes/_metadata.json b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/_metadata.json index 21ff00c07d07..994eb67857ea 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/_metadata.json +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/_metadata.json @@ -3,8 +3,9 @@ "apiVersions": { "Microsoft.Kubernetes": "2026-05-01" }, - "commit": "b26c3c253cff26dd05361e882dbcf1b324f27dfd", + "commit": "cf49df24bee763924bb4d9abceebe4fd1916a6ad", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "typespec_src": "specification/hybridkubernetes/HybridKubernetes.Management", - "emitterVersion": "0.62.1" + "typespec_src": "specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/HybridKubernetes", + "emitterVersion": "0.63.3", + "httpClientPythonVersion": "^0.34.2" } \ No newline at end of file diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/api.md b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/api.md new file mode 100644 index 000000000000..3a286346f466 --- /dev/null +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/api.md @@ -0,0 +1,1067 @@ +```py +namespace azure.mgmt.hybridkubernetes + + class azure.mgmt.hybridkubernetes.ConnectedKubernetesClient: implements ContextManager + connected_cluster: ConnectedClusterOperations + operations: Operations + + 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.hybridkubernetes.aio + + class azure.mgmt.hybridkubernetes.aio.ConnectedKubernetesClient: implements AsyncContextManager + connected_cluster: ConnectedClusterOperations + operations: Operations + + 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.hybridkubernetes.aio.operations + + class azure.mgmt.hybridkubernetes.aio.operations.ConnectedClusterOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + connected_cluster: ConnectedCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ConnectedCluster]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + connected_cluster: ConnectedCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ConnectedCluster]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + connected_cluster: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ConnectedCluster]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update_async( + self, + resource_group_name: str, + cluster_name: str, + connected_cluster_patch: ConnectedClusterPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ConnectedCluster]: ... + + @overload + async def begin_update_async( + self, + resource_group_name: str, + cluster_name: str, + connected_cluster_patch: ConnectedClusterPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ConnectedCluster]: ... + + @overload + async def begin_update_async( + self, + resource_group_name: str, + cluster_name: str, + connected_cluster_patch: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[ConnectedCluster]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> ConnectedCluster: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[ConnectedCluster]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[ConnectedCluster]: ... + + @overload + async def list_cluster_user_credential( + self, + resource_group_name: str, + cluster_name: str, + properties: ListClusterUserCredentialProperties, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CredentialResults: ... + + @overload + async def list_cluster_user_credential( + self, + resource_group_name: str, + cluster_name: str, + properties: ListClusterUserCredentialProperties, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CredentialResults: ... + + @overload + async def list_cluster_user_credential( + self, + resource_group_name: str, + cluster_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CredentialResults: ... + + + class azure.mgmt.hybridkubernetes.aio.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... + + +namespace azure.mgmt.hybridkubernetes.models + + class azure.mgmt.hybridkubernetes.models.AadProfile(_Model): + admin_group_object_i_ds: Optional[list[str]] + enable_azure_rbac: Optional[bool] + tenant_id: Optional[str] + + @overload + def __init__( + self, + *, + admin_group_object_i_ds: Optional[list[str]] = ..., + enable_azure_rbac: Optional[bool] = ..., + tenant_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridkubernetes.models.ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERNAL = "Internal" + + + class azure.mgmt.hybridkubernetes.models.AgentError(_Model): + component: Optional[str] + message: Optional[str] + severity: Optional[str] + time: Optional[datetime] + + + class azure.mgmt.hybridkubernetes.models.ArcAgentProfile(_Model): + agent_auto_upgrade: Optional[Union[str, AutoUpgradeOptions]] + agent_errors: Optional[list[AgentError]] + agent_state: Optional[str] + desired_agent_version: Optional[str] + system_components: Optional[list[SystemComponent]] + + @overload + def __init__( + self, + *, + agent_auto_upgrade: Optional[Union[str, AutoUpgradeOptions]] = ..., + agent_errors: Optional[list[AgentError]] = ..., + desired_agent_version: Optional[str] = ..., + system_components: Optional[list[SystemComponent]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridkubernetes.models.ArcAgentryConfigurations(_Model): + feature: Optional[str] + protected_settings: Optional[dict[str, str]] + settings: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + feature: Optional[str] = ..., + protected_settings: Optional[dict[str, str]] = ..., + settings: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridkubernetes.models.AuthenticationMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AAD = "AAD" + TOKEN = "Token" + + + class azure.mgmt.hybridkubernetes.models.AutoUpgradeOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.hybridkubernetes.models.AzureHybridBenefit(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FALSE = "False" + NOT_APPLICABLE = "NotApplicable" + TRUE = "True" + + + class azure.mgmt.hybridkubernetes.models.ConnectedCluster(TrackedResource): + id: str + identity: ConnectedClusterIdentity + kind: Optional[Union[str, ConnectedClusterKind]] + location: str + name: str + properties: ConnectedClusterProperties + system_data: SystemData + tags: dict[str, str] + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + identity: ConnectedClusterIdentity, + kind: Optional[Union[str, ConnectedClusterKind]] = ..., + location: str, + properties: ConnectedClusterProperties, + 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.hybridkubernetes.models.ConnectedClusterIdentity(_Model): + principal_id: Optional[str] + tenant_id: Optional[str] + type: Union[str, ResourceIdentityType] + + @overload + def __init__( + self, + *, + type: Union[str, ResourceIdentityType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridkubernetes.models.ConnectedClusterKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PROVISIONED_CLUSTER = "ProvisionedCluster" + + + class azure.mgmt.hybridkubernetes.models.ConnectedClusterPatch(_Model): + properties: Optional[ConnectedClusterPatchProperties] + tags: Optional[dict[str, str]] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[ConnectedClusterPatchProperties] = ..., + 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.hybridkubernetes.models.ConnectedClusterPatchProperties(_Model): + azure_hybrid_benefit: Optional[Union[str, AzureHybridBenefit]] + distribution: Optional[str] + distribution_version: Optional[str] + gateway: Optional[Gateway] + + @overload + def __init__( + self, + *, + azure_hybrid_benefit: Optional[Union[str, AzureHybridBenefit]] = ..., + distribution: Optional[str] = ..., + distribution_version: Optional[str] = ..., + gateway: Optional[Gateway] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridkubernetes.models.ConnectedClusterProperties(_Model): + aad_profile: Optional[AadProfile] + agent_public_key_certificate: str + agent_version: Optional[str] + arc_agent_profile: Optional[ArcAgentProfile] + arc_agentry_configurations: Optional[list[ArcAgentryConfigurations]] + azure_hybrid_benefit: Optional[Union[str, AzureHybridBenefit]] + connectivity_status: Optional[Union[str, ConnectivityStatus]] + distribution: Optional[str] + distribution_version: Optional[str] + gateway: Optional[Gateway] + infrastructure: Optional[str] + kubernetes_version: Optional[str] + last_connectivity_time: Optional[datetime] + managed_identity_certificate_expiration_time: Optional[datetime] + miscellaneous_properties: Optional[dict[str, str]] + offering: Optional[str] + oidc_issuer_profile: Optional[OidcIssuerProfile] + private_link_scope_resource_id: Optional[str] + private_link_state: Optional[Union[str, PrivateLinkState]] + provisioning_state: Optional[Union[str, ProvisioningState]] + security_profile: Optional[SecurityProfile] + total_core_count: Optional[int] + total_node_count: Optional[int] + + @overload + def __init__( + self, + *, + aad_profile: Optional[AadProfile] = ..., + agent_public_key_certificate: str, + arc_agent_profile: Optional[ArcAgentProfile] = ..., + arc_agentry_configurations: Optional[list[ArcAgentryConfigurations]] = ..., + azure_hybrid_benefit: Optional[Union[str, AzureHybridBenefit]] = ..., + distribution: Optional[str] = ..., + distribution_version: Optional[str] = ..., + gateway: Optional[Gateway] = ..., + infrastructure: Optional[str] = ..., + oidc_issuer_profile: Optional[OidcIssuerProfile] = ..., + private_link_scope_resource_id: Optional[str] = ..., + private_link_state: Optional[Union[str, PrivateLinkState]] = ..., + provisioning_state: Optional[Union[str, ProvisioningState]] = ..., + security_profile: Optional[SecurityProfile] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridkubernetes.models.ConnectivityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AGENT_NOT_INSTALLED = "AgentNotInstalled" + CONNECTED = "Connected" + CONNECTING = "Connecting" + EXPIRED = "Expired" + OFFLINE = "Offline" + + + class azure.mgmt.hybridkubernetes.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.hybridkubernetes.models.CredentialResult(_Model): + name: Optional[str] + value: Optional[bytes] + + + class azure.mgmt.hybridkubernetes.models.CredentialResults(_Model): + hybrid_connection_config: Optional[HybridConnectionConfig] + kubeconfigs: Optional[list[CredentialResult]] + + + class azure.mgmt.hybridkubernetes.models.ErrorAdditionalInfo(_Model): + info: Optional[Any] + type: Optional[str] + + + class azure.mgmt.hybridkubernetes.models.ErrorDetail(_Model): + additional_info: Optional[list[ErrorAdditionalInfo]] + code: Optional[str] + details: Optional[list[ErrorDetail]] + message: Optional[str] + target: Optional[str] + + + class azure.mgmt.hybridkubernetes.models.ErrorResponse(_Model): + error: Optional[ErrorDetail] + + @overload + def __init__( + self, + *, + error: Optional[ErrorDetail] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridkubernetes.models.Gateway(_Model): + enabled: Optional[bool] + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridkubernetes.models.HybridConnectionConfig(_Model): + expiration_time: Optional[int] + hybrid_connection_name: Optional[str] + relay: Optional[str] + relay_tid: Optional[str] + relay_type: Optional[str] + token: Optional[str] + + + class azure.mgmt.hybridkubernetes.models.ListClusterUserCredentialProperties(_Model): + authentication_method: Union[str, AuthenticationMethod] + client_proxy: bool + + @overload + def __init__( + self, + *, + authentication_method: Union[str, AuthenticationMethod], + client_proxy: bool + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridkubernetes.models.OidcIssuerProfile(_Model): + enabled: Optional[bool] + issuer_url: Optional[str] + self_hosted_issuer_url: Optional[str] + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = ..., + self_hosted_issuer_url: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridkubernetes.models.Operation(_Model): + action_type: Optional[Union[str, ActionType]] + display: Optional[OperationDisplay] + is_data_action: Optional[bool] + name: Optional[str] + origin: Optional[Union[str, Origin]] + + @overload + def __init__( + self, + *, + display: Optional[OperationDisplay] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridkubernetes.models.OperationDisplay(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] + + + class azure.mgmt.hybridkubernetes.models.Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM = "system" + USER = "user" + USER_SYSTEM = "user,system" + + + class azure.mgmt.hybridkubernetes.models.PrivateLinkState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.hybridkubernetes.models.ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACCEPTED = "Accepted" + CANCELED = "Canceled" + DELETING = "Deleting" + FAILED = "Failed" + PROVISIONING = "Provisioning" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + + class azure.mgmt.hybridkubernetes.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.hybridkubernetes.models.ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + + + class azure.mgmt.hybridkubernetes.models.SecurityProfile(_Model): + workload_identity: Optional[SecurityProfileWorkloadIdentity] + + @overload + def __init__( + self, + *, + workload_identity: Optional[SecurityProfileWorkloadIdentity] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridkubernetes.models.SecurityProfileWorkloadIdentity(_Model): + enabled: Optional[bool] + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridkubernetes.models.SystemComponent(_Model): + current_version: Optional[str] + major_version: Optional[int] + type: Optional[str] + user_specified_version: Optional[str] + + @overload + def __init__( + self, + *, + major_version: Optional[int] = ..., + type: Optional[str] = ..., + user_specified_version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridkubernetes.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.hybridkubernetes.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.hybridkubernetes.operations + + class azure.mgmt.hybridkubernetes.operations.ConnectedClusterOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + connected_cluster: ConnectedCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ConnectedCluster]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + connected_cluster: ConnectedCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ConnectedCluster]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + cluster_name: str, + connected_cluster: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ConnectedCluster]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update_async( + self, + resource_group_name: str, + cluster_name: str, + connected_cluster_patch: ConnectedClusterPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ConnectedCluster]: ... + + @overload + def begin_update_async( + self, + resource_group_name: str, + cluster_name: str, + connected_cluster_patch: ConnectedClusterPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ConnectedCluster]: ... + + @overload + def begin_update_async( + self, + resource_group_name: str, + cluster_name: str, + connected_cluster_patch: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[ConnectedCluster]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + **kwargs: Any + ) -> ConnectedCluster: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[ConnectedCluster]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[ConnectedCluster]: ... + + @overload + def list_cluster_user_credential( + self, + resource_group_name: str, + cluster_name: str, + properties: ListClusterUserCredentialProperties, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CredentialResults: ... + + @overload + def list_cluster_user_credential( + self, + resource_group_name: str, + cluster_name: str, + properties: ListClusterUserCredentialProperties, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CredentialResults: ... + + @overload + def list_cluster_user_credential( + self, + resource_group_name: str, + cluster_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> CredentialResults: ... + + + class azure.mgmt.hybridkubernetes.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get(self, **kwargs: Any) -> ItemPaged[Operation]: ... + + +namespace azure.mgmt.hybridkubernetes.types + + class azure.mgmt.hybridkubernetes.types.AadProfile(TypedDict, total=False): + key "enableAzureRBAC": bool + key "tenantID": str + adminGroupObjectIDs: list[str] + admin_group_object_i_ds: list[str] + enable_azure_rbac: bool + tenant_id: str + + + class azure.mgmt.hybridkubernetes.types.AgentError(TypedDict, total=False): + key "component": str + key "message": str + key "severity": str + key "time": str + component: str + message: str + severity: str + time: str + + + class azure.mgmt.hybridkubernetes.types.ArcAgentProfile(TypedDict, total=False): + key "agentAutoUpgrade": Union[str, AutoUpgradeOptions] + key "agentState": str + key "desiredAgentVersion": str + agentErrors: list[AgentError] + agent_auto_upgrade: Union[str, AutoUpgradeOptions] + agent_errors: list[AgentError] + agent_state: str + desired_agent_version: str + systemComponents: list[SystemComponent] + system_components: list[SystemComponent] + + + class azure.mgmt.hybridkubernetes.types.ArcAgentryConfigurations(TypedDict, total=False): + key "feature": str + key "protectedSettings": Optional[dict[str, str]] + key "settings": Optional[dict[str, str]] + feature: str + protected_settings: dict[str, str] + settings: dict[str, str] + + + class azure.mgmt.hybridkubernetes.types.ConnectedCluster(TrackedResource): + key "id": str + key "identity": Required[ConnectedClusterIdentity] + key "kind": Union[str, ConnectedClusterKind] + key "location": Required[str] + key "name": str + key "properties": Required[ConnectedClusterProperties] + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + identity: ConnectedClusterIdentity + kind: Union[str, ConnectedClusterKind] + location: str + name: str + properties: ConnectedClusterProperties + system_data: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.hybridkubernetes.types.ConnectedClusterIdentity(TypedDict, total=False): + key "principalId": str + key "tenantId": str + key "type": Required[Union[str, ResourceIdentityType]] + principal_id: str + tenant_id: str + type: Union[str, ResourceIdentityType] + + + class azure.mgmt.hybridkubernetes.types.ConnectedClusterPatch(TypedDict, total=False): + key "properties": ForwardRef('ConnectedClusterPatchProperties', module='types') + properties: ConnectedClusterPatchProperties + tags: dict[str, str] + + + class azure.mgmt.hybridkubernetes.types.ConnectedClusterPatchProperties(TypedDict, total=False): + key "azureHybridBenefit": Union[str, AzureHybridBenefit] + key "distribution": str + key "distributionVersion": str + key "gateway": ForwardRef('Gateway', module='types') + azure_hybrid_benefit: Union[str, AzureHybridBenefit] + distribution: str + distribution_version: str + gateway: Gateway + + + class azure.mgmt.hybridkubernetes.types.ConnectedClusterProperties(TypedDict, total=False): + key "aadProfile": ForwardRef('AadProfile', module='types') + key "agentPublicKeyCertificate": Required[str] + key "agentVersion": str + key "arcAgentProfile": ForwardRef('ArcAgentProfile', module='types') + key "arcAgentryConfigurations": Optional[list[ArcAgentryConfigurations]] + key "azureHybridBenefit": Union[str, AzureHybridBenefit] + key "connectivityStatus": Union[str, ConnectivityStatus] + key "distribution": str + key "distributionVersion": str + key "gateway": Optional[Gateway] + key "infrastructure": str + key "kubernetesVersion": str + key "lastConnectivityTime": str + key "managedIdentityCertificateExpirationTime": str + key "offering": str + key "oidcIssuerProfile": ForwardRef('OidcIssuerProfile', module='types') + key "privateLinkScopeResourceId": str + key "privateLinkState": Union[str, PrivateLinkState] + key "provisioningState": Union[str, ProvisioningState] + key "securityProfile": ForwardRef('SecurityProfile', module='types') + key "totalCoreCount": int + key "totalNodeCount": int + aad_profile: AadProfile + agent_public_key_certificate: str + agent_version: str + arc_agent_profile: ArcAgentProfile + arc_agentry_configurations: list[ArcAgentryConfigurations] + azure_hybrid_benefit: Union[str, AzureHybridBenefit] + connectivity_status: Union[str, ConnectivityStatus] + distribution: str + distribution_version: str + gateway: Gateway + infrastructure: str + kubernetes_version: str + last_connectivity_time: str + managed_identity_certificate_expiration_time: str + miscellaneousProperties: dict[str, str] + miscellaneous_properties: dict[str, str] + offering: str + oidc_issuer_profile: OidcIssuerProfile + private_link_scope_resource_id: str + private_link_state: Union[str, PrivateLinkState] + provisioning_state: Union[str, ProvisioningState] + security_profile: SecurityProfile + total_core_count: int + total_node_count: int + + + class azure.mgmt.hybridkubernetes.types.Gateway(TypedDict, total=False): + key "enabled": bool + enabled: bool + + + class azure.mgmt.hybridkubernetes.types.ListClusterUserCredentialProperties(TypedDict, total=False): + key "authenticationMethod": Required[Union[str, AuthenticationMethod]] + key "clientProxy": Required[bool] + authentication_method: Union[str, AuthenticationMethod] + client_proxy: bool + + + class azure.mgmt.hybridkubernetes.types.OidcIssuerProfile(TypedDict, total=False): + key "enabled": bool + key "issuerUrl": str + key "selfHostedIssuerUrl": str + enabled: bool + issuer_url: str + self_hosted_issuer_url: str + + + class azure.mgmt.hybridkubernetes.types.Resource(TypedDict, total=False): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.hybridkubernetes.types.SecurityProfile(TypedDict, total=False): + key "workloadIdentity": ForwardRef('SecurityProfileWorkloadIdentity', module='types') + workload_identity: SecurityProfileWorkloadIdentity + + + class azure.mgmt.hybridkubernetes.types.SecurityProfileWorkloadIdentity(TypedDict, total=False): + key "enabled": bool + enabled: bool + + + class azure.mgmt.hybridkubernetes.types.SystemComponent(TypedDict, total=False): + key "currentVersion": str + key "majorVersion": int + key "type": str + key "userSpecifiedVersion": str + current_version: str + major_version: int + type: str + user_specified_version: str + + + class azure.mgmt.hybridkubernetes.types.SystemData(TypedDict, total=False): + key "createdAt": str + key "createdBy": str + key "createdByType": Union[str, CreatedByType] + key "lastModifiedAt": str + key "lastModifiedBy": str + key "lastModifiedByType": Union[str, CreatedByType] + created_at: str + created_by: str + created_by_type: Union[str, CreatedByType] + last_modified_at: str + last_modified_by: str + last_modified_by_type: Union[str, CreatedByType] + + + class azure.mgmt.hybridkubernetes.types.TrackedResource(Resource): + key "id": str + key "location": Required[str] + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + system_data: SystemData + tags: dict[str, str] + type: str + + +``` \ No newline at end of file diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/api.metadata.yml b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/api.metadata.yml new file mode 100644 index 000000000000..2b72849c18a7 --- /dev/null +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/api.metadata.yml @@ -0,0 +1,3 @@ +apiMdSha256: 2cf5b4292c96fe5f50bb7e57def806ffeeec8b02e46009c2dc58ab8698792c2b +parserVersion: 0.3.28 +pythonVersion: 3.13.14 diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/apiview-properties.json b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/apiview-properties.json index 82f86751b918..0346f672d2d4 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/apiview-properties.json +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/apiview-properties.json @@ -55,5 +55,5 @@ "azure.mgmt.hybridkubernetes.operations.ConnectedClusterOperations.list_cluster_user_credential": "Microsoft.Kubernetes.ConnectedClusters.listClusterUserCredential", "azure.mgmt.hybridkubernetes.aio.operations.ConnectedClusterOperations.list_cluster_user_credential": "Microsoft.Kubernetes.ConnectedClusters.listClusterUserCredential" }, - "CrossLanguageVersion": "14ab4c210f36" + "CrossLanguageVersion": "d21de7bd0fe1" } \ No newline at end of file diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_patch.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_patch.py index ea765788358a..87676c65a8f0 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_patch.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_patch.py @@ -8,6 +8,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_utils/model_base.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_utils/model_base.py index 4102784f9a85..0f2c5bdfe70f 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_utils/model_base.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_utils/model_base.py @@ -109,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": @@ -301,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 @@ -330,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"), } @@ -425,21 +458,21 @@ def __ne__(self, other: typing.Any) -> bool: def keys(self) -> typing.KeysView[str]: """ - :returns: a set-like object providing a view on D's keys + :returns: a set-like object providing a view on the mapping's keys :rtype: ~typing.KeysView """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: """ - :returns: an object providing a view on D's values + :returns: an object providing a view on the mapping's values :rtype: ~typing.ValuesView """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: """ - :returns: set-like object providing a view on D's items + :returns: a set-like object providing a view on the mapping's items :rtype: ~typing.ItemsView """ return self._data.items() @@ -449,7 +482,7 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ try: @@ -484,19 +517,19 @@ def popitem(self) -> tuple[str, typing.Any]: Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple - :raises KeyError: if D is empty. + :raises KeyError: if the dictionary is empty. """ return self._data.popitem() def clear(self) -> None: """ - Remove all items from D. + Remove all items from the dictionary. """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ - Updates D from mapping/iterable E and F. + Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs. """ self._data.update(*args, **kwargs) @@ -509,10 +542,11 @@ def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ - Same as calling D.get(k, d), and setting D[k]=d if k not found + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ if default is _UNSET: @@ -564,7 +598,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 @@ -590,6 +624,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 @@ -630,7 +897,9 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: 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. @@ -638,53 +907,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: @@ -717,6 +1022,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) @@ -1091,6 +1399,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 @@ -1103,6 +1412,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: @@ -1138,7 +1448,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 @@ -1184,6 +1498,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, @@ -1193,6 +1508,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + deserializer=deserializer, ) @@ -1426,6 +1742,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/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_utils/serialization.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_utils/serialization.py index 954bf7ebffa7..75906e2eb77f 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_utils/serialization.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_utils/serialization.py @@ -520,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, @@ -1109,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. @@ -1381,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, @@ -1393,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 {} @@ -1405,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. @@ -1415,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) @@ -1933,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/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_version.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_version.py index 0e00a6283246..8f2350dd3b0c 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_version.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0b1" +VERSION = "2.0.0" diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/_patch.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/_patch.py index ea765788358a..87676c65a8f0 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/_patch.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/_patch.py @@ -8,6 +8,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/operations/_operations.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/operations/_operations.py index 5f50461f6f03..1fc066a2cc0c 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/operations/_operations.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/operations/_operations.py @@ -33,7 +33,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models as _models +from ... import models as _models, types as _types from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer from ..._validation import api_version_validation @@ -51,7 +51,6 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] class Operations: @@ -258,7 +257,7 @@ async def _create_or_replace_initial( self, resource_group_name: str, cluster_name: str, - connected_cluster: Union[_models.ConnectedCluster, JSON, IO[bytes]], + connected_cluster: Union[_models.ConnectedCluster, _types.ConnectedCluster, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -368,7 +367,7 @@ async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - connected_cluster: JSON, + connected_cluster: _types.ConnectedCluster, *, content_type: str = "application/json", **kwargs: Any @@ -384,7 +383,7 @@ async def begin_create_or_replace( :param cluster_name: The name of the Kubernetes cluster on which get is called. Required. :type cluster_name: str :param connected_cluster: Parameters supplied to Create a Connected Cluster. Required. - :type connected_cluster: JSON + :type connected_cluster: ~azure.mgmt.hybridkubernetes.types.ConnectedCluster :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -432,7 +431,7 @@ async def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - connected_cluster: Union[_models.ConnectedCluster, JSON, IO[bytes]], + connected_cluster: Union[_models.ConnectedCluster, _types.ConnectedCluster, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConnectedCluster]: """Register a new Kubernetes cluster with Azure Resource Manager. @@ -445,10 +444,10 @@ async def begin_create_or_replace( :type resource_group_name: str :param cluster_name: The name of the Kubernetes cluster on which get is called. Required. :type cluster_name: str - :param connected_cluster: Parameters supplied to Create a Connected Cluster. Is one of the - following types: ConnectedCluster, JSON, IO[bytes] Required. - :type connected_cluster: ~azure.mgmt.hybridkubernetes.models.ConnectedCluster or JSON or - IO[bytes] + :param connected_cluster: Parameters supplied to Create a Connected Cluster. Is either a + ConnectedCluster type or a IO[bytes] type. Required. + :type connected_cluster: ~azure.mgmt.hybridkubernetes.models.ConnectedCluster or + ~azure.mgmt.hybridkubernetes.types.ConnectedCluster or IO[bytes] :return: An instance of AsyncLROPoller that returns ConnectedCluster. The ConnectedCluster is compatible with MutableMapping :rtype: @@ -525,7 +524,7 @@ async def _update_async_initial( self, resource_group_name: str, cluster_name: str, - connected_cluster_patch: Union[_models.ConnectedClusterPatch, JSON, IO[bytes]], + connected_cluster_patch: Union[_models.ConnectedClusterPatch, _types.ConnectedClusterPatch, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -632,7 +631,7 @@ async def begin_update_async( self, resource_group_name: str, cluster_name: str, - connected_cluster_patch: JSON, + connected_cluster_patch: _types.ConnectedClusterPatch, *, content_type: str = "application/json", **kwargs: Any @@ -647,7 +646,7 @@ async def begin_update_async( :param cluster_name: The name of the Kubernetes cluster on which get is called. Required. :type cluster_name: str :param connected_cluster_patch: Parameters supplied to update Connected Cluster. Required. - :type connected_cluster_patch: JSON + :type connected_cluster_patch: ~azure.mgmt.hybridkubernetes.types.ConnectedClusterPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -708,7 +707,7 @@ async def begin_update_async( self, resource_group_name: str, cluster_name: str, - connected_cluster_patch: Union[_models.ConnectedClusterPatch, JSON, IO[bytes]], + connected_cluster_patch: Union[_models.ConnectedClusterPatch, _types.ConnectedClusterPatch, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ConnectedCluster]: """Updates a connected cluster. @@ -720,10 +719,10 @@ async def begin_update_async( :type resource_group_name: str :param cluster_name: The name of the Kubernetes cluster on which get is called. Required. :type cluster_name: str - :param connected_cluster_patch: Parameters supplied to update Connected Cluster. Is one of the - following types: ConnectedClusterPatch, JSON, IO[bytes] Required. + :param connected_cluster_patch: Parameters supplied to update Connected Cluster. Is either a + ConnectedClusterPatch type or a IO[bytes] type. Required. :type connected_cluster_patch: ~azure.mgmt.hybridkubernetes.models.ConnectedClusterPatch or - JSON or IO[bytes] + ~azure.mgmt.hybridkubernetes.types.ConnectedClusterPatch or IO[bytes] :return: An instance of AsyncLROPoller that returns ConnectedCluster. The ConnectedCluster is compatible with MutableMapping :rtype: @@ -1133,7 +1132,7 @@ async def list_cluster_user_credential( self, resource_group_name: str, cluster_name: str, - properties: JSON, + properties: _types.ListClusterUserCredentialProperties, *, content_type: str = "application/json", **kwargs: Any @@ -1149,7 +1148,7 @@ async def list_cluster_user_credential( :param cluster_name: The name of the Kubernetes cluster on which get is called. Required. :type cluster_name: str :param properties: ListClusterUserCredential properties. Required. - :type properties: JSON + :type properties: ~azure.mgmt.hybridkubernetes.types.ListClusterUserCredentialProperties :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1193,7 +1192,9 @@ async def list_cluster_user_credential( self, resource_group_name: str, cluster_name: str, - properties: Union[_models.ListClusterUserCredentialProperties, JSON, IO[bytes]], + properties: Union[ + _models.ListClusterUserCredentialProperties, _types.ListClusterUserCredentialProperties, IO[bytes] + ], **kwargs: Any ) -> _models.CredentialResults: """Gets cluster user credentials of a connected cluster. @@ -1206,10 +1207,10 @@ async def list_cluster_user_credential( :type resource_group_name: str :param cluster_name: The name of the Kubernetes cluster on which get is called. Required. :type cluster_name: str - :param properties: ListClusterUserCredential properties. Is one of the following types: - ListClusterUserCredentialProperties, JSON, IO[bytes] Required. + :param properties: ListClusterUserCredential properties. Is either a + ListClusterUserCredentialProperties type or a IO[bytes] type. Required. :type properties: ~azure.mgmt.hybridkubernetes.models.ListClusterUserCredentialProperties or - JSON or IO[bytes] + ~azure.mgmt.hybridkubernetes.types.ListClusterUserCredentialProperties or IO[bytes] :return: CredentialResults. The CredentialResults is compatible with MutableMapping :rtype: ~azure.mgmt.hybridkubernetes.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/operations/_patch.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/operations/_patch.py index ea765788358a..87676c65a8f0 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/operations/_patch.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/operations/_patch.py @@ -8,6 +8,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/_patch.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/_patch.py index ea765788358a..87676c65a8f0 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/_patch.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/_patch.py @@ -8,6 +8,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/operations/_operations.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/operations/_operations.py index 5066fa3c4322..35cd4783401d 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/operations/_operations.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/operations/_operations.py @@ -32,7 +32,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models as _models +from .. import models as _models, types as _types from .._configuration import ConnectedKubernetesClientConfiguration from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer @@ -40,7 +40,6 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -465,7 +464,7 @@ def _create_or_replace_initial( self, resource_group_name: str, cluster_name: str, - connected_cluster: Union[_models.ConnectedCluster, JSON, IO[bytes]], + connected_cluster: Union[_models.ConnectedCluster, _types.ConnectedCluster, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -574,7 +573,7 @@ def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - connected_cluster: JSON, + connected_cluster: _types.ConnectedCluster, *, content_type: str = "application/json", **kwargs: Any @@ -590,7 +589,7 @@ def begin_create_or_replace( :param cluster_name: The name of the Kubernetes cluster on which get is called. Required. :type cluster_name: str :param connected_cluster: Parameters supplied to Create a Connected Cluster. Required. - :type connected_cluster: JSON + :type connected_cluster: ~azure.mgmt.hybridkubernetes.types.ConnectedCluster :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -636,7 +635,7 @@ def begin_create_or_replace( self, resource_group_name: str, cluster_name: str, - connected_cluster: Union[_models.ConnectedCluster, JSON, IO[bytes]], + connected_cluster: Union[_models.ConnectedCluster, _types.ConnectedCluster, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConnectedCluster]: """Register a new Kubernetes cluster with Azure Resource Manager. @@ -649,10 +648,10 @@ def begin_create_or_replace( :type resource_group_name: str :param cluster_name: The name of the Kubernetes cluster on which get is called. Required. :type cluster_name: str - :param connected_cluster: Parameters supplied to Create a Connected Cluster. Is one of the - following types: ConnectedCluster, JSON, IO[bytes] Required. - :type connected_cluster: ~azure.mgmt.hybridkubernetes.models.ConnectedCluster or JSON or - IO[bytes] + :param connected_cluster: Parameters supplied to Create a Connected Cluster. Is either a + ConnectedCluster type or a IO[bytes] type. Required. + :type connected_cluster: ~azure.mgmt.hybridkubernetes.models.ConnectedCluster or + ~azure.mgmt.hybridkubernetes.types.ConnectedCluster or IO[bytes] :return: An instance of LROPoller that returns ConnectedCluster. The ConnectedCluster is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridkubernetes.models.ConnectedCluster] @@ -728,7 +727,7 @@ def _update_async_initial( self, resource_group_name: str, cluster_name: str, - connected_cluster_patch: Union[_models.ConnectedClusterPatch, JSON, IO[bytes]], + connected_cluster_patch: Union[_models.ConnectedClusterPatch, _types.ConnectedClusterPatch, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -834,7 +833,7 @@ def begin_update_async( self, resource_group_name: str, cluster_name: str, - connected_cluster_patch: JSON, + connected_cluster_patch: _types.ConnectedClusterPatch, *, content_type: str = "application/json", **kwargs: Any @@ -849,7 +848,7 @@ def begin_update_async( :param cluster_name: The name of the Kubernetes cluster on which get is called. Required. :type cluster_name: str :param connected_cluster_patch: Parameters supplied to update Connected Cluster. Required. - :type connected_cluster_patch: JSON + :type connected_cluster_patch: ~azure.mgmt.hybridkubernetes.types.ConnectedClusterPatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -908,7 +907,7 @@ def begin_update_async( self, resource_group_name: str, cluster_name: str, - connected_cluster_patch: Union[_models.ConnectedClusterPatch, JSON, IO[bytes]], + connected_cluster_patch: Union[_models.ConnectedClusterPatch, _types.ConnectedClusterPatch, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ConnectedCluster]: """Updates a connected cluster. @@ -920,10 +919,10 @@ def begin_update_async( :type resource_group_name: str :param cluster_name: The name of the Kubernetes cluster on which get is called. Required. :type cluster_name: str - :param connected_cluster_patch: Parameters supplied to update Connected Cluster. Is one of the - following types: ConnectedClusterPatch, JSON, IO[bytes] Required. + :param connected_cluster_patch: Parameters supplied to update Connected Cluster. Is either a + ConnectedClusterPatch type or a IO[bytes] type. Required. :type connected_cluster_patch: ~azure.mgmt.hybridkubernetes.models.ConnectedClusterPatch or - JSON or IO[bytes] + ~azure.mgmt.hybridkubernetes.types.ConnectedClusterPatch or IO[bytes] :return: An instance of LROPoller that returns ConnectedCluster. The ConnectedCluster is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridkubernetes.models.ConnectedCluster] @@ -1328,7 +1327,7 @@ def list_cluster_user_credential( self, resource_group_name: str, cluster_name: str, - properties: JSON, + properties: _types.ListClusterUserCredentialProperties, *, content_type: str = "application/json", **kwargs: Any @@ -1344,7 +1343,7 @@ def list_cluster_user_credential( :param cluster_name: The name of the Kubernetes cluster on which get is called. Required. :type cluster_name: str :param properties: ListClusterUserCredential properties. Required. - :type properties: JSON + :type properties: ~azure.mgmt.hybridkubernetes.types.ListClusterUserCredentialProperties :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1388,7 +1387,9 @@ def list_cluster_user_credential( self, resource_group_name: str, cluster_name: str, - properties: Union[_models.ListClusterUserCredentialProperties, JSON, IO[bytes]], + properties: Union[ + _models.ListClusterUserCredentialProperties, _types.ListClusterUserCredentialProperties, IO[bytes] + ], **kwargs: Any ) -> _models.CredentialResults: """Gets cluster user credentials of a connected cluster. @@ -1401,10 +1402,10 @@ def list_cluster_user_credential( :type resource_group_name: str :param cluster_name: The name of the Kubernetes cluster on which get is called. Required. :type cluster_name: str - :param properties: ListClusterUserCredential properties. Is one of the following types: - ListClusterUserCredentialProperties, JSON, IO[bytes] Required. + :param properties: ListClusterUserCredential properties. Is either a + ListClusterUserCredentialProperties type or a IO[bytes] type. Required. :type properties: ~azure.mgmt.hybridkubernetes.models.ListClusterUserCredentialProperties or - JSON or IO[bytes] + ~azure.mgmt.hybridkubernetes.types.ListClusterUserCredentialProperties or IO[bytes] :return: CredentialResults. The CredentialResults is compatible with MutableMapping :rtype: ~azure.mgmt.hybridkubernetes.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/operations/_patch.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/operations/_patch.py index ea765788358a..87676c65a8f0 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/operations/_patch.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/operations/_patch.py @@ -8,6 +8,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ + __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/types.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/types.py new file mode 100644 index 000000000000..5a813d99b82a --- /dev/null +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/types.py @@ -0,0 +1,527 @@ +# pylint: disable=line-too-long,useless-suppression +# 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. +# -------------------------------------------------------------------------- + +from typing import Any, Optional, TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +if TYPE_CHECKING: + from .models import ( + AuthenticationMethod, + AutoUpgradeOptions, + AzureHybridBenefit, + ConnectedClusterKind, + ConnectivityStatus, + CreatedByType, + PrivateLinkState, + ProvisioningState, + ResourceIdentityType, + ) + + +class AadProfile(TypedDict, total=False): + """AAD Profile specifies attributes for Azure Active Directory integration. + + :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :vartype enable_azure_rbac: bool + :ivar admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :vartype admin_group_object_i_ds: list[str] + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :vartype tenant_id: str + """ + + enableAzureRBAC: bool + """Whether to enable Azure RBAC for Kubernetes authorization.""" + adminGroupObjectIDs: list[str] + """The list of AAD group object IDs that will have admin role of the cluster.""" + tenantID: str + """The AAD tenant ID to use for authentication. If not specified, will use the tenant of the + deployment subscription.""" + + +class AgentError(TypedDict, total=False): + """Agent Errors if any during agent or system component upgrade. + + :ivar message: Agent error message. + :vartype message: str + :ivar severity: Severity of the error message. + :vartype severity: str + :ivar component: Agent component where error message occured. + :vartype component: str + :ivar time: The timestamp of error occured (UTC). + :vartype time: str + """ + + message: str + """Agent error message.""" + severity: str + """Severity of the error message.""" + component: str + """Agent component where error message occured.""" + time: str + """The timestamp of error occured (UTC).""" + + +class ArcAgentProfile(TypedDict, total=False): + """Defines the Arc Agent properties for the clusters. + + :ivar desired_agent_version: Version of the Arc agents to be installed on the cluster resource. + :vartype desired_agent_version: str + :ivar agent_auto_upgrade: Indicates whether the Arc agents on the be upgraded automatically to + the latest version. Defaults to Enabled. Known values are: "Enabled" and "Disabled". + :vartype agent_auto_upgrade: Union[str, "AutoUpgradeOptions"] + :ivar system_components: List of system extensions that are installed on the cluster resource. + :vartype system_components: list["SystemComponent"] + :ivar agent_errors: List of arc agentry and system components errors on the cluster resource. + :vartype agent_errors: list["AgentError"] + :ivar agent_state: Represents the current state of the Arc agentry and its dependent + components. + :vartype agent_state: str + """ + + desiredAgentVersion: str + """Version of the Arc agents to be installed on the cluster resource.""" + agentAutoUpgrade: Union[str, "AutoUpgradeOptions"] + """Indicates whether the Arc agents on the be upgraded automatically to the latest version. + Defaults to Enabled. Known values are: \"Enabled\" and \"Disabled\".""" + systemComponents: list["SystemComponent"] + """List of system extensions that are installed on the cluster resource.""" + agentErrors: list["AgentError"] + """List of arc agentry and system components errors on the cluster resource.""" + agentState: str + """Represents the current state of the Arc agentry and its dependent components.""" + + +class ArcAgentryConfigurations(TypedDict, total=False): + """ArcAgentryConfigurations. + + :ivar feature: Specifies the name of the feature for the configuration setting. + :vartype feature: str + :ivar settings: The configuration settings for the feature that do not contain any sensitive or + secret information. + :vartype settings: dict[str, str] + :ivar protected_settings: The configuration settings for the feature that contain any sensitive + or secret information. + :vartype protected_settings: dict[str, str] + """ + + feature: str + """Specifies the name of the feature for the configuration setting.""" + settings: Optional[dict[str, str]] + """The configuration settings for the feature that do not contain any sensitive or secret + information.""" + protectedSettings: Optional[dict[str, str]] + """The configuration settings for the feature that contain any sensitive or secret information.""" + + +class Resource(TypedDict, total=False): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + """ + + id: str + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: str + """The name of the resource.""" + type: str + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + systemData: "SystemData" + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class TrackedResource(Resource): + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: dict[str, str] + """Resource tags.""" + location: Required[str] + """The geo-location where the resource lives. Required.""" + + +class ConnectedCluster(TrackedResource): + """Represents a connected cluster. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Describes the connected cluster resource properties. Required. + :vartype properties: "ConnectedClusterProperties" + :ivar identity: The identity of the connected cluster. Required. + :vartype identity: "ConnectedClusterIdentity" + :ivar kind: The kind of connected cluster. "ProvisionedCluster" + :vartype kind: Union[str, "ConnectedClusterKind"] + """ + + properties: Required["ConnectedClusterProperties"] + """Describes the connected cluster resource properties. Required.""" + identity: Required["ConnectedClusterIdentity"] + """The identity of the connected cluster. Required.""" + kind: Union[str, "ConnectedClusterKind"] + """The kind of connected cluster. \"ProvisionedCluster\"""" + + +class ConnectedClusterIdentity(TypedDict, total=False): + """Identity for the connected cluster. + + :ivar principal_id: The principal id of connected cluster identity. This property will only be + provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant id associated with the connected cluster. This property will only + be provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: The type of identity used for the connected cluster. The type 'SystemAssigned, + includes a system created identity. The type 'None' means no identity is assigned to the + connected cluster. Required. Known values are: "None" and "SystemAssigned". + :vartype type: Union[str, "ResourceIdentityType"] + """ + + principalId: str + """The principal id of connected cluster identity. This property will only be provided for a + system assigned identity.""" + tenantId: str + """The tenant id associated with the connected cluster. This property will only be provided for a + system assigned identity.""" + type: Required[Union[str, "ResourceIdentityType"]] + """The type of identity used for the connected cluster. The type 'SystemAssigned, includes a + system created identity. The type 'None' means no identity is assigned to the connected + cluster. Required. Known values are: \"None\" and \"SystemAssigned\".""" + + +class ConnectedClusterPatch(TypedDict, total=False): + """Object containing updates for patch operations. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: Describes the connected cluster resource properties that can be updated + during PATCH operation. + :vartype properties: "ConnectedClusterPatchProperties" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "ConnectedClusterPatchProperties" + """Describes the connected cluster resource properties that can be updated during PATCH operation.""" + + +class ConnectedClusterPatchProperties(TypedDict, total=False): + """Properties which can be patched on the connected cluster resource. + + :ivar distribution: Represents the distribution of the connected cluster. + :vartype distribution: str + :ivar distribution_version: Represents the Kubernetes distribution version on this connected + cluster. + :vartype distribution_version: str + :ivar azure_hybrid_benefit: Indicates whether Azure Hybrid Benefit is opted in. Known values + are: "True", "False", and "NotApplicable". + :vartype azure_hybrid_benefit: Union[str, "AzureHybridBenefit"] + :ivar gateway: Indicates whether Gateway is enabled for the connected cluster resource. + :vartype gateway: "Gateway" + """ + + distribution: str + """Represents the distribution of the connected cluster.""" + distributionVersion: str + """Represents the Kubernetes distribution version on this connected cluster.""" + azureHybridBenefit: Union[str, "AzureHybridBenefit"] + """Indicates whether Azure Hybrid Benefit is opted in. Known values are: \"True\", \"False\", and + \"NotApplicable\".""" + gateway: "Gateway" + """Indicates whether Gateway is enabled for the connected cluster resource.""" + + +class ConnectedClusterProperties(TypedDict, total=False): + """Properties of the connected cluster. + + :ivar agent_public_key_certificate: Base64 encoded public certificate used by the agent to do + the initial handshake to the backend services in Azure. Required. + :vartype agent_public_key_certificate: str + :ivar kubernetes_version: The Kubernetes version of the connected cluster resource. + :vartype kubernetes_version: str + :ivar total_node_count: Number of nodes present in the connected cluster resource. + :vartype total_node_count: int + :ivar total_core_count: Number of CPU cores present in the connected cluster resource. + :vartype total_core_count: int + :ivar agent_version: Version of the agent running on the connected cluster resource. + :vartype agent_version: str + :ivar provisioning_state: Provisioning state of the connected cluster resource. Known values + are: "Succeeded", "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioning_state: Union[str, "ProvisioningState"] + :ivar distribution: The Kubernetes distribution running on this connected cluster. + :vartype distribution: str + :ivar distribution_version: The Kubernetes distribution version on this connected cluster. + :vartype distribution_version: str + :ivar infrastructure: The infrastructure on which the Kubernetes cluster represented by this + connected cluster is running on. + :vartype infrastructure: str + :ivar offering: Connected cluster offering. + :vartype offering: str + :ivar managed_identity_certificate_expiration_time: Expiration time of the managed identity + certificate. + :vartype managed_identity_certificate_expiration_time: str + :ivar last_connectivity_time: Time representing the last instance when heart beat was received + from the cluster. + :vartype last_connectivity_time: str + :ivar connectivity_status: Represents the connectivity status of the connected cluster. Known + values are: "Connecting", "Connected", "Offline", "Expired", and "AgentNotInstalled". + :vartype connectivity_status: Union[str, "ConnectivityStatus"] + :ivar private_link_state: Property which describes the state of private link on a connected + cluster resource. Known values are: "Enabled" and "Disabled". + :vartype private_link_state: Union[str, "PrivateLinkState"] + :ivar private_link_scope_resource_id: This is populated only if privateLinkState is enabled. + The resource id of the private link scope this connected cluster is assigned to, if any. + :vartype private_link_scope_resource_id: str + :ivar azure_hybrid_benefit: Indicates whether Azure Hybrid Benefit is opted in. Known values + are: "True", "False", and "NotApplicable". + :vartype azure_hybrid_benefit: Union[str, "AzureHybridBenefit"] + :ivar aad_profile: AAD profile for the connected cluster. + :vartype aad_profile: "AadProfile" + :ivar arc_agent_profile: Arc agentry configuration for the provisioned cluster. + :vartype arc_agent_profile: "ArcAgentProfile" + :ivar security_profile: Security profile for the connected cluster. + :vartype security_profile: "SecurityProfile" + :ivar oidc_issuer_profile: Open ID Connect (OIDC) Issuer Profile for the connected cluster. + :vartype oidc_issuer_profile: "OidcIssuerProfile" + :ivar gateway: Details of the gateway used by the Arc router for connectivity. + :vartype gateway: "Gateway" + :ivar arc_agentry_configurations: Configuration settings for customizing the behavior of the + connected cluster. + :vartype arc_agentry_configurations: list["ArcAgentryConfigurations"] + :ivar miscellaneous_properties: More properties related to the Connected Cluster. + :vartype miscellaneous_properties: dict[str, str] + """ + + agentPublicKeyCertificate: Required[str] + """Base64 encoded public certificate used by the agent to do the initial handshake to the backend + services in Azure. Required.""" + kubernetesVersion: str + """The Kubernetes version of the connected cluster resource.""" + totalNodeCount: int + """Number of nodes present in the connected cluster resource.""" + totalCoreCount: int + """Number of CPU cores present in the connected cluster resource.""" + agentVersion: str + """Version of the agent running on the connected cluster resource.""" + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state of the connected cluster resource. Known values are: \"Succeeded\", + \"Failed\", \"Canceled\", \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + distribution: str + """The Kubernetes distribution running on this connected cluster.""" + distributionVersion: str + """The Kubernetes distribution version on this connected cluster.""" + infrastructure: str + """The infrastructure on which the Kubernetes cluster represented by this connected cluster is + running on.""" + offering: str + """Connected cluster offering.""" + managedIdentityCertificateExpirationTime: str + """Expiration time of the managed identity certificate.""" + lastConnectivityTime: str + """Time representing the last instance when heart beat was received from the cluster.""" + connectivityStatus: Union[str, "ConnectivityStatus"] + """Represents the connectivity status of the connected cluster. Known values are: \"Connecting\", + \"Connected\", \"Offline\", \"Expired\", and \"AgentNotInstalled\".""" + privateLinkState: Union[str, "PrivateLinkState"] + """Property which describes the state of private link on a connected cluster resource. Known + values are: \"Enabled\" and \"Disabled\".""" + privateLinkScopeResourceId: str + """This is populated only if privateLinkState is enabled. The resource id of the private link + scope this connected cluster is assigned to, if any.""" + azureHybridBenefit: Union[str, "AzureHybridBenefit"] + """Indicates whether Azure Hybrid Benefit is opted in. Known values are: \"True\", \"False\", and + \"NotApplicable\".""" + aadProfile: "AadProfile" + """AAD profile for the connected cluster.""" + arcAgentProfile: "ArcAgentProfile" + """Arc agentry configuration for the provisioned cluster.""" + securityProfile: "SecurityProfile" + """Security profile for the connected cluster.""" + oidcIssuerProfile: "OidcIssuerProfile" + """Open ID Connect (OIDC) Issuer Profile for the connected cluster.""" + gateway: Optional["Gateway"] + """Details of the gateway used by the Arc router for connectivity.""" + arcAgentryConfigurations: Optional[list["ArcAgentryConfigurations"]] + """Configuration settings for customizing the behavior of the connected cluster.""" + miscellaneousProperties: dict[str, str] + """More properties related to the Connected Cluster.""" + + +class Gateway(TypedDict, total=False): + """Gateway. + + :ivar enabled: Indicates whether the gateway for arc router connectivity is enabled. + :vartype enabled: bool + """ + + enabled: bool + """Indicates whether the gateway for arc router connectivity is enabled.""" + + +class ListClusterUserCredentialProperties(TypedDict, total=False): + """ListClusterUserCredentialProperties. + + :ivar authentication_method: The mode of client authentication. Required. Known values are: + "Token" and "AAD". + :vartype authentication_method: Union[str, "AuthenticationMethod"] + :ivar client_proxy: Boolean value to indicate whether the request is for client side proxy or + not. Required. + :vartype client_proxy: bool + """ + + authenticationMethod: Required[Union[str, "AuthenticationMethod"]] + """The mode of client authentication. Required. Known values are: \"Token\" and \"AAD\".""" + clientProxy: Required[bool] + """Boolean value to indicate whether the request is for client side proxy or not. Required.""" + + +class OidcIssuerProfile(TypedDict, total=False): + """OIDC Issuer Profile specifies attributes for workload identity integration. + + :ivar enabled: Whether to enable oidc issuer for workload identity integration. + :vartype enabled: bool + :ivar issuer_url: The issuer url for hybrid clusters connected to Arc used for the workload + identity feature. + :vartype issuer_url: str + :ivar self_hosted_issuer_url: The issuer url for public cloud clusters - AKS, EKS, GKE - used + for the workload identity feature. + :vartype self_hosted_issuer_url: str + """ + + enabled: bool + """Whether to enable oidc issuer for workload identity integration.""" + issuerUrl: str + """The issuer url for hybrid clusters connected to Arc used for the workload identity feature.""" + selfHostedIssuerUrl: str + """The issuer url for public cloud clusters - AKS, EKS, GKE - used for the workload identity + feature.""" + + +class SecurityProfile(TypedDict, total=False): + """Security Profile specifies attributes for cluster security features. + + :ivar workload_identity: The workload identity feature webhook. + :vartype workload_identity: "SecurityProfileWorkloadIdentity" + """ + + workloadIdentity: "SecurityProfileWorkloadIdentity" + """The workload identity feature webhook.""" + + +class SecurityProfileWorkloadIdentity(TypedDict, total=False): + """The workload identity feature webhook. + + :ivar enabled: Whether to enable or disable the workload identity Webhook. + :vartype enabled: bool + """ + + enabled: bool + """Whether to enable or disable the workload identity Webhook.""" + + +class SystemComponent(TypedDict, total=False): + """System extensions and its current versions installed on the cluster resource. + + :ivar type: Type of the system extension. + :vartype type: str + :ivar user_specified_version: Version of the system extension to be installed on the cluster + resource. + :vartype user_specified_version: str + :ivar major_version: Major Version of the system extension that is currently installed on the + cluster resource. + :vartype major_version: int + :ivar current_version: Version of the system extension that is currently installed on the + cluster resource. + :vartype current_version: str + """ + + type: str + """Type of the system extension.""" + userSpecifiedVersion: str + """Version of the system extension to be installed on the cluster resource.""" + majorVersion: int + """Major Version of the system extension that is currently installed on the cluster resource.""" + currentVersion: str + """Version of the system extension that is currently installed on the cluster resource.""" + + +class SystemData(TypedDict, total=False): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: Union[str, "CreatedByType"] + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: str + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: Union[str, "CreatedByType"] + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: str + """ + + createdBy: str + """The identity that created the resource.""" + createdByType: Union[str, "CreatedByType"] + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + createdAt: str + """The timestamp of resource creation (UTC).""" + lastModifiedBy: str + """The identity that last modified the resource.""" + lastModifiedByType: Union[str, "CreatedByType"] + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + lastModifiedAt: str + """The timestamp of resource last modification (UTC).""" diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/pyproject.toml b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/pyproject.toml index b895838b3240..172fc97a51f5 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/pyproject.toml +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/pyproject.toml @@ -13,7 +13,7 @@ authors = [ description = "Microsoft Azure Hybridkubernetes 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", @@ -21,6 +21,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] requires-python = ">=3.10" keywords = [ @@ -78,7 +79,7 @@ package_name = "azure-mgmt-hybridkubernetes" package_nspkg = "azure-mgmt-nspkg" package_pprint_name = "Hybrid Kubernetes Management" package_doc_id = "" -is_stable = false +is_stable = true is_arm = true title = "ConnectedKubernetesClient" need_msrestazure = false diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/tsp-location.yaml b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/tsp-location.yaml index 492af7650f44..684bb94ea0dd 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/tsp-location.yaml +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/tsp-location.yaml @@ -1,4 +1,4 @@ -directory: specification/hybridkubernetes/HybridKubernetes.Management -commit: b26c3c253cff26dd05361e882dbcf1b324f27dfd +directory: specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/HybridKubernetes +commit: cf49df24bee763924bb4d9abceebe4fd1916a6ad repo: Azure/azure-rest-api-specs additionalDirectories: From 6da759a3b5809aca73008a14e18fa6a46e348bcb Mon Sep 17 00:00:00 2001 From: "Chenxi Jiang (WICRESOFT NORTH AMERICA LTD)" Date: Mon, 20 Jul 2026 14:46:41 +0800 Subject: [PATCH 2/2] Optimize changelog for azure-mgmt-hybridkubernetes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../azure-mgmt-hybridkubernetes/CHANGELOG.md | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/CHANGELOG.md b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/CHANGELOG.md index f29dfb60d07b..be4343452459 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/CHANGELOG.md +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/CHANGELOG.md @@ -6,7 +6,6 @@ - Client `ConnectedKubernetesClient` added method `send_request` - Model `ConnectedCluster` added property `kind` - - Model `ConnectedCluster` added property `properties` - Enum `ConnectivityStatus` added member `AGENT_NOT_INSTALLED` - Model `HybridConnectionConfig` added property `relay_tid` - Model `HybridConnectionConfig` added property `relay_type` @@ -24,7 +23,6 @@ - Added enum `AzureHybridBenefit` - Added enum `ConnectedClusterKind` - Added model `ConnectedClusterPatchProperties` - - Added model `ConnectedClusterProperties` - Added model `Gateway` - Added model `OidcIssuerProfile` - Added enum `Origin` @@ -32,28 +30,18 @@ - Added model `SecurityProfile` - Added model `SecurityProfileWorkloadIdentity` - Added model `SystemComponent` - - Model `ConnectedClusterOperations` added method `begin_create_or_replace` - - Model `ConnectedClusterOperations` added method `begin_update_async` ### Breaking Changes - - Model `ConnectedCluster` deleted or renamed its instance variable `agent_public_key_certificate` - - Model `ConnectedCluster` deleted or renamed its instance variable `agent_version` - - Model `ConnectedCluster` deleted or renamed its instance variable `connectivity_status` - - Model `ConnectedCluster` deleted or renamed its instance variable `distribution` - - Model `ConnectedCluster` deleted or renamed its instance variable `infrastructure` - - Model `ConnectedCluster` deleted or renamed its instance variable `kubernetes_version` - - Model `ConnectedCluster` deleted or renamed its instance variable `last_connectivity_time` - - Model `ConnectedCluster` deleted or renamed its instance variable `managed_identity_certificate_expiration_time` - - Model `ConnectedCluster` deleted or renamed its instance variable `offering` - - Model `ConnectedCluster` deleted or renamed its instance variable `provisioning_state` - - Model `ConnectedCluster` deleted or renamed its instance variable `total_core_count` - - Model `ConnectedCluster` deleted or renamed its instance variable `total_node_count` - - Deleted or renamed model `ConnectedClusterList` - - Deleted or renamed model `LastModifiedByType` - - Deleted or renamed model `OperationList` - - Deleted or renamed method `ConnectedClusterOperations.begin_create` - - Deleted or renamed method `ConnectedClusterOperations.update` + - This version introduces new hybrid models which have dual dictionary and model nature. Please follow https://aka.ms/azsdk/python/migrate/hybrid-models for migration. + - Model `ConnectedCluster` moved instance variable `agent_public_key_certificate`, `agent_version`, `connectivity_status`, `distribution`, `infrastructure`, `kubernetes_version`, `last_connectivity_time`, `managed_identity_certificate_expiration_time`, `offering`, `provisioning_state`, `total_core_count` and `total_node_count` under property `properties` whose type is `ConnectedClusterProperties` + - Model `SystemData` renamed type of property `last_modified_by_type` from `LastModifiedByType` to `CreatedByType` + - Operation group `ConnectedClusterOperations` renamed method `begin_create` to `begin_create_or_replace` + - Operation group `ConnectedClusterOperations` renamed method `update` to `begin_update_async` + +### Other Changes + + - Deleted model `ConnectedClusterList`/`OperationList` which actually were not used by SDK users ## 2.0.0b1 (2026-05-20)