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(*GroupCreate, int))
| 1265 | // MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates |
| 1266 | // a builder and applies setFunc on it. |
| 1267 | func (c *GroupClient) MapCreateBulk(slice any, setFunc func(*GroupCreate, int)) *GroupCreateBulk { |
| 1268 | rv := reflect.ValueOf(slice) |
| 1269 | if rv.Kind() != reflect.Slice { |
| 1270 | return &GroupCreateBulk{err: fmt.Errorf("calling to GroupClient.MapCreateBulk with wrong type %T, need slice", slice)} |
| 1271 | } |
| 1272 | builders := make([]*GroupCreate, rv.Len()) |
| 1273 | for i := 0; i < rv.Len(); i++ { |
| 1274 | builders[i] = c.Create() |
| 1275 | setFunc(builders[i], i) |
| 1276 | } |
| 1277 | return &GroupCreateBulk{config: c.config, builders: builders} |
| 1278 | } |
| 1279 | |
| 1280 | // Update returns an update builder for Group. |
| 1281 | func (c *GroupClient) Update() *GroupUpdate { |