pyvmomi icon indicating copy to clipboard operation
pyvmomi copied to clipboard

Typing: VirtualMachine optional fields

Open IvarVirusiim opened this issue 8 months ago • 0 comments

Describe the bug

Type hints for the VirtualMachine object aren't correct. The following fields should be optional (according to the documentation):

  • config
  • datastore
  • guest
  • layout
  • layoutEx
  • network
  • parentVApp
  • resourceConfig
  • resourcePool
  • rootSnapshot
  • snapshot
  • storage

Reproduction steps

Look at VirtualMachine object type hints.

vm: vim.VirtualMachine

... (logic for fetching VM)

config: vim.vm.ConfigInfo | None = vm.config (<- is not 100% correct, because vm.config type hint is just vim.vm.ConfigInfo)

Expected behavior

Type hints are shown as optional for those fields.

Additional context

Documentation

IvarVirusiim avatar May 28 '24 04:05 IvarVirusiim