MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
(slice any, setFunc func(*TaskCreate, int))
| 2704 | // MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates |
| 2705 | // a builder and applies setFunc on it. |
| 2706 | func (c *TaskClient) MapCreateBulk(slice any, setFunc func(*TaskCreate, int)) *TaskCreateBulk { |
| 2707 | rv := reflect.ValueOf(slice) |
| 2708 | if rv.Kind() != reflect.Slice { |
| 2709 | return &TaskCreateBulk{err: fmt.Errorf("calling to TaskClient.MapCreateBulk with wrong type %T, need slice", slice)} |
| 2710 | } |
| 2711 | builders := make([]*TaskCreate, rv.Len()) |
| 2712 | for i := 0; i < rv.Len(); i++ { |
| 2713 | builders[i] = c.Create() |
| 2714 | setFunc(builders[i], i) |
| 2715 | } |
| 2716 | return &TaskCreateBulk{config: c.config, builders: builders} |
| 2717 | } |
| 2718 | |
| 2719 | // Update returns an update builder for Task. |
| 2720 | func (c *TaskClient) Update() *TaskUpdate { |