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(*DavAccountCreate, int))
| 367 | // MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates |
| 368 | // a builder and applies setFunc on it. |
| 369 | func (c *DavAccountClient) MapCreateBulk(slice any, setFunc func(*DavAccountCreate, int)) *DavAccountCreateBulk { |
| 370 | rv := reflect.ValueOf(slice) |
| 371 | if rv.Kind() != reflect.Slice { |
| 372 | return &DavAccountCreateBulk{err: fmt.Errorf("calling to DavAccountClient.MapCreateBulk with wrong type %T, need slice", slice)} |
| 373 | } |
| 374 | builders := make([]*DavAccountCreate, rv.Len()) |
| 375 | for i := 0; i < rv.Len(); i++ { |
| 376 | builders[i] = c.Create() |
| 377 | setFunc(builders[i], i) |
| 378 | } |
| 379 | return &DavAccountCreateBulk{config: c.config, builders: builders} |
| 380 | } |
| 381 | |
| 382 | // Update returns an update builder for DavAccount. |
| 383 | func (c *DavAccountClient) Update() *DavAccountUpdate { |