code: func expandVirtualMachineResourceAllocation(d *schema.ResourceData, key string) *types.ResourceAllocationInfo {
  	shareLevelKey := fmt.Sprintf("%s_share_level", key)
  	shareCountKey := fmt.Sprintf("%s_share_count", key)
  	limitKey := fmt.Sprintf("%s_limit", key)
  	reservationKey := fmt.Sprintf("%s_reservation", key)
  
  	obj := &types.ResourceAllocationInfo{
  		Limit:       structure.GetInt64PtrEmptyZero(d, limitKey),
  		Reservation: structure.GetInt64PtrEmptyZero(d, reservationKey),
  	}
  	shares := &types.SharesInfo{
  		Level:  types.SharesLevel(d.Get(shareLevelKey).(string)),
  		Shares: int32(d.Get(shareCountKey).(int)),
  	}
  	obj.Shares = shares
  	return obj
  }
docs: // expandVirtualMachineResourceAllocation reads the VM resource allocation
  // resource data keys for the type supplied by key and returns an appropriate
  // types.ResourceAllocationInfo reference.