func (c executeOneByRevision) Build() (transport.RefreshRequest, error) {
	var name, id *string
	if c.Name != "" {
		name = &c.Name
	}
	if c.ID != "" {
		id = &c.ID
	}

	req := transport.RefreshRequest{
		// Context is required here, even if it looks optional.
		Context: []transport.RefreshRequestContext{},
		Actions: []transport.RefreshRequestAction{{
			Action:            string(c.action),
			InstanceKey:       c.instanceKey,
			Name:              name,
			ID:                id,
			Revision:          c.Revision,
			ResourceRevisions: c.resourceRevisions,
		}},
		Fields: []string{"bases", "download", "id", "revision", "version", "resources", "type"},
	}

	if len(c.fields) != 0 {
		fieldSet := set.NewStrings(req.Fields...)
		for _, field := range c.fields {
			fieldSet.Add(field)
		}
		req.Fields = fieldSet.SortedValues()
	}

	return req, nil
}
// Build a refresh request for sending to the API.
Build a refresh request for sending to the API.
// Build a refresh request for sending to the API .
func (c executeOneByRevision) Build() (transport.RefreshRequest, error) {
	var name, id *string
	if c.Name != "" {
		name = &c.Name
	}
	if c.ID != "" {
		id = &c.ID
	}
	req := transport.RefreshRequest{
		Context: []transport.RefreshRequestContext{},
		Actions: []transport.RefreshRequestAction{{
			Action:            string(c.action),
			InstanceKey:       c.instanceKey,
			Name:              name,
			ID:                id,
			Revision:          c.Revision,
			ResourceRevisions: c.resourceRevisions,
		}},
		Fields: []string{"bases", "download", "id", "revision", "version", "resources", "type"},
	}
	if len(c.fields) != 0 {
		fieldSet := set.NewStrings(req.Fields...)
		for _, field := range c.fields {
			fieldSet.Add(field)
		}
		req.Fields = fieldSet.SortedValues()
	}
	return req, nil
}
func ( c executeOneByRevision ) Build ( ) ( transport . RefreshRequest , error ) { var name , id * string if c . Name != " " { name = & c . Name } if c . ID != " " { id = & c . ID } req := transport . RefreshRequest { Context : [ ] transport . RefreshRequestContext { } , Actions : [ ] transport . RefreshRequestAction { { Action : string ( c . action ) , InstanceKey : c . instanceKey , Name : name , ID : id , Revision : c . Revision , ResourceRevisions : c . resourceRevisions , } } , Fields : [ ] string { " " , " " , " " , " " , " " , " " , " " } , } if len ( c . fields ) != 0 { fieldSet := set . NewStrings ( req . Fields ... ) for _ , field := range c . fields { fieldSet . Add ( field ) } req . Fields = fieldSet . SortedValues ( ) } return req , nil }
Build a refresh request for sending to the API.
Build a refresh request for sending to the API .
// Context is required here, even if it looks optional.