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(*ShareCreate, int))
| 2338 | // MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates |
| 2339 | // a builder and applies setFunc on it. |
| 2340 | func (c *ShareClient) MapCreateBulk(slice any, setFunc func(*ShareCreate, int)) *ShareCreateBulk { |
| 2341 | rv := reflect.ValueOf(slice) |
| 2342 | if rv.Kind() != reflect.Slice { |
| 2343 | return &ShareCreateBulk{err: fmt.Errorf("calling to ShareClient.MapCreateBulk with wrong type %T, need slice", slice)} |
| 2344 | } |
| 2345 | builders := make([]*ShareCreate, rv.Len()) |
| 2346 | for i := 0; i < rv.Len(); i++ { |
| 2347 | builders[i] = c.Create() |
| 2348 | setFunc(builders[i], i) |
| 2349 | } |
| 2350 | return &ShareCreateBulk{config: c.config, builders: builders} |
| 2351 | } |
| 2352 | |
| 2353 | // Update returns an update builder for Share. |
| 2354 | func (c *ShareClient) Update() *ShareUpdate { |