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))
| 1078 | // MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates |
| 1079 | // a builder and applies setFunc on it. |
| 1080 | func (c *GroupClient) MapCreateBulk(slice any, setFunc func(*GroupCreate, int)) *GroupCreateBulk { |
| 1081 | rv := reflect.ValueOf(slice) |
| 1082 | if rv.Kind() != reflect.Slice { |
| 1083 | return &GroupCreateBulk{err: fmt.Errorf("calling to GroupClient.MapCreateBulk with wrong type %T, need slice", slice)} |
| 1084 | } |
| 1085 | builders := make([]*GroupCreate, rv.Len()) |
| 1086 | for i := 0; i < rv.Len(); i++ { |
| 1087 | builders[i] = c.Create() |
| 1088 | setFunc(builders[i], i) |
| 1089 | } |
| 1090 | return &GroupCreateBulk{config: c.config, builders: builders} |
| 1091 | } |
| 1092 | |
| 1093 | // Update returns an update builder for Group. |
| 1094 | func (c *GroupClient) Update() *GroupUpdate { |