#NEWLINE# def build_property_spec( client_factory , type_ = 'VirtualMachine' , properties_to_collect = None , all_properties = False ) : #NEWLINE# #INDENT# 'Builds the property spec.\n\n    :param client_factory: factory to get API input specs\n    :param type_: type of the managed object\n    :param properties_to_collect: names of the managed object properties to be\n                                  collected while traversal filtering\n    :param all_properties: whether all properties of the managed object need\n                           to be collected\n    :returns: property spec\n    ' #NEWLINE# if ( not properties_to_collect ) : #NEWLINE# #INDENT# properties_to_collect = [ 'name' ] #NEWLINE# #UNINDENT# property_spec = client_factory . create ( 'ns0:PropertySpec' ) #NEWLINE# property_spec . all = all_properties #NEWLINE# property_spec . pathSet = properties_to_collect #NEWLINE# property_spec . type = type_ #NEWLINE# return property_spec