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(*SettingCreate, int))
| 2203 | // MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates |
| 2204 | // a builder and applies setFunc on it. |
| 2205 | func (c *SettingClient) MapCreateBulk(slice any, setFunc func(*SettingCreate, int)) *SettingCreateBulk { |
| 2206 | rv := reflect.ValueOf(slice) |
| 2207 | if rv.Kind() != reflect.Slice { |
| 2208 | return &SettingCreateBulk{err: fmt.Errorf("calling to SettingClient.MapCreateBulk with wrong type %T, need slice", slice)} |
| 2209 | } |
| 2210 | builders := make([]*SettingCreate, rv.Len()) |
| 2211 | for i := 0; i < rv.Len(); i++ { |
| 2212 | builders[i] = c.Create() |
| 2213 | setFunc(builders[i], i) |
| 2214 | } |
| 2215 | return &SettingCreateBulk{config: c.config, builders: builders} |
| 2216 | } |
| 2217 | |
| 2218 | // Update returns an update builder for Setting. |
| 2219 | func (c *SettingClient) Update() *SettingUpdate { |