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(*MetadataCreate, int))
| 1432 | // MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates |
| 1433 | // a builder and applies setFunc on it. |
| 1434 | func (c *MetadataClient) MapCreateBulk(slice any, setFunc func(*MetadataCreate, int)) *MetadataCreateBulk { |
| 1435 | rv := reflect.ValueOf(slice) |
| 1436 | if rv.Kind() != reflect.Slice { |
| 1437 | return &MetadataCreateBulk{err: fmt.Errorf("calling to MetadataClient.MapCreateBulk with wrong type %T, need slice", slice)} |
| 1438 | } |
| 1439 | builders := make([]*MetadataCreate, rv.Len()) |
| 1440 | for i := 0; i < rv.Len(); i++ { |
| 1441 | builders[i] = c.Create() |
| 1442 | setFunc(builders[i], i) |
| 1443 | } |
| 1444 | return &MetadataCreateBulk{config: c.config, builders: builders} |
| 1445 | } |
| 1446 | |
| 1447 | // Update returns an update builder for Metadata. |
| 1448 | func (c *MetadataClient) Update() *MetadataUpdate { |