code: def _validate_canonical(self):
      super()._validate_canonical()
      if self.storage_type == "azureStorage":
          assert self.server is None and self.path is None
      elif self.storage_type == "nfs":
          assert self.azure_account is None and self.azure_share is None
          assert (
              self.key_vault_name is None and self.key_vault_key is None
          )
      else:
          raise ValueError(
              f'Kubernetes storage_type ("{self.storage_type}") must either be "azureStorage" or "nfs"'
          )
  
file_path: nni/nni/experiment/config/training_services/k8s_storage.py
imports: from dataclasses import dataclass
  from typing import Optional
  from typing_extensions import Literal
  from ..base import ConfigBase
label_desc: Use image node_id 1 for calling the K8sStorageConfig obj's underlying member method code with example usage: obj._validate_canonical() without return types