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(*FileCreate, int))
| 852 | // MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates |
| 853 | // a builder and applies setFunc on it. |
| 854 | func (c *FileClient) MapCreateBulk(slice any, setFunc func(*FileCreate, int)) *FileCreateBulk { |
| 855 | rv := reflect.ValueOf(slice) |
| 856 | if rv.Kind() != reflect.Slice { |
| 857 | return &FileCreateBulk{err: fmt.Errorf("calling to FileClient.MapCreateBulk with wrong type %T, need slice", slice)} |
| 858 | } |
| 859 | builders := make([]*FileCreate, rv.Len()) |
| 860 | for i := 0; i < rv.Len(); i++ { |
| 861 | builders[i] = c.Create() |
| 862 | setFunc(builders[i], i) |
| 863 | } |
| 864 | return &FileCreateBulk{config: c.config, builders: builders} |
| 865 | } |
| 866 | |
| 867 | // Update returns an update builder for File. |
| 868 | func (c *FileClient) Update() *FileUpdate { |