vsphere/resource_vsphere_compute_cluster_vm_affinity_rule.go
func resourceVSphereComputeClusterVMAffinityRuleObjects(
	d *schema.ResourceData,
	meta interface{},
) (*object.ClusterComputeResource, int32, error) {
	if d.Id() != "" {
		return resourceVSphereComputeClusterVMAffinityRuleObjectsFromID(d, meta)
	}
	return resourceVSphereComputeClusterVMAffinityRuleObjectsFromAttributes(d, meta)
}
func resourceVSphereComputeClusterVMAffinityRuleObjects(
	d *schema.ResourceData,
	meta interface{},
) (*object.ClusterComputeResource, int32, error) {
	if d.Id() != "" {
		return resourceVSphereComputeClusterVMAffinityRuleObjectsFromID(d, meta)
	}
	return resourceVSphereComputeClusterVMAffinityRuleObjectsFromAttributes(d, meta)
}
// resourceVSphereComputeClusterVMAffinityRuleObjects handles the fetching of the
// cluster and rule key depending on what attributes are available:
// * If the resource ID is available, the data is derived from the ID.
// * If not, only the cluster is retrieved from compute_cluster_id. -1 is
// returned for the key.