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(*StoragePolicyCreate, int))
| 2505 | // MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates |
| 2506 | // a builder and applies setFunc on it. |
| 2507 | func (c *StoragePolicyClient) MapCreateBulk(slice any, setFunc func(*StoragePolicyCreate, int)) *StoragePolicyCreateBulk { |
| 2508 | rv := reflect.ValueOf(slice) |
| 2509 | if rv.Kind() != reflect.Slice { |
| 2510 | return &StoragePolicyCreateBulk{err: fmt.Errorf("calling to StoragePolicyClient.MapCreateBulk with wrong type %T, need slice", slice)} |
| 2511 | } |
| 2512 | builders := make([]*StoragePolicyCreate, rv.Len()) |
| 2513 | for i := 0; i < rv.Len(); i++ { |
| 2514 | builders[i] = c.Create() |
| 2515 | setFunc(builders[i], i) |
| 2516 | } |
| 2517 | return &StoragePolicyCreateBulk{config: c.config, builders: builders} |
| 2518 | } |
| 2519 | |
| 2520 | // Update returns an update builder for StoragePolicy. |
| 2521 | func (c *StoragePolicyClient) Update() *StoragePolicyUpdate { |