func (c refreshMany) Build() (transport.RefreshRequest, error) {
	// Not all configs built here have a context, start out with an empty
	// slice, so we do not call Refresh with a nil context.
	// See executeOne.Build().
	result := transport.RefreshRequest{
		Context: []transport.RefreshRequestContext{},
	}
	for _, config := range c.Configs {
		req, err := config.Build()
		if err != nil {
			return transport.RefreshRequest{}, errors.Trace(err)
		}
		result.Context = append(result.Context, req.Context...)
		result.Actions = append(result.Actions, req.Actions...)
		result.Fields = append(result.Fields, req.Fields...)
	}

	// Ensure that the required field list contains no duplicates
	if len(result.Fields) != 0 {
		result.Fields = set.NewStrings(result.Fields...).SortedValues()
	}

	return result, nil
}
// Build a refresh request that can be past to the API.
Build a refresh request that can be past to the API.
// Build a refresh request that can be past to the API .
func (c refreshMany) Build() (transport.RefreshRequest, error) {
	result := transport.RefreshRequest{
		Context: []transport.RefreshRequestContext{},
	}
	for _, config := range c.Configs {
		req, err := config.Build()
		if err != nil {
			return transport.RefreshRequest{}, errors.Trace(err)
		}
		result.Context = append(result.Context, req.Context...)
		result.Actions = append(result.Actions, req.Actions...)
		result.Fields = append(result.Fields, req.Fields...)
	}
	if len(result.Fields) != 0 {
		result.Fields = set.NewStrings(result.Fields...).SortedValues()
	}
	return result, nil
}
func ( c refreshMany ) Build ( ) ( transport . RefreshRequest , error ) { result := transport . RefreshRequest { Context : [ ] transport . RefreshRequestContext { } , } for _ , config := range c . Configs { req , err := config . Build ( ) if err != nil { return transport . RefreshRequest { } , errors . Trace ( err ) } result . Context = append ( result . Context , req . Context ... ) result . Actions = append ( result . Actions , req . Actions ... ) result . Fields = append ( result . Fields , req . Fields ... ) } if len ( result . Fields ) != 0 { result . Fields = set . NewStrings ( result . Fields ... ) . SortedValues ( ) } return result , nil }
Build a refresh request that can be past to the API.
Build a refresh request that can be past to the API .
// Not all configs built here have a context, start out with an empty // slice, so we do not call Refresh with a nil context. // See executeOne.Build(). // Ensure that the required field list contains no duplicates