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(*DirectLinkCreate, int))
| 518 | // MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates |
| 519 | // a builder and applies setFunc on it. |
| 520 | func (c *DirectLinkClient) MapCreateBulk(slice any, setFunc func(*DirectLinkCreate, int)) *DirectLinkCreateBulk { |
| 521 | rv := reflect.ValueOf(slice) |
| 522 | if rv.Kind() != reflect.Slice { |
| 523 | return &DirectLinkCreateBulk{err: fmt.Errorf("calling to DirectLinkClient.MapCreateBulk with wrong type %T, need slice", slice)} |
| 524 | } |
| 525 | builders := make([]*DirectLinkCreate, rv.Len()) |
| 526 | for i := 0; i < rv.Len(); i++ { |
| 527 | builders[i] = c.Create() |
| 528 | setFunc(builders[i], i) |
| 529 | } |
| 530 | return &DirectLinkCreateBulk{config: c.config, builders: builders} |
| 531 | } |
| 532 | |
| 533 | // Update returns an update builder for DirectLink. |
| 534 | func (c *DirectLinkClient) Update() *DirectLinkUpdate { |