func (c refreshOne) Build() (transport.RefreshRequest, error) {
	base, err := constructRefreshBase(c.Base)
	if err != nil {
		return transport.RefreshRequest{}, errors.Trace(err)
	}

	return transport.RefreshRequest{
		Context: []transport.RefreshRequestContext{{
			InstanceKey:     c.instanceKey,
			ID:              c.ID,
			Revision:        c.Revision,
			Base:            base,
			TrackingChannel: c.Channel,
			Metrics:         c.metrics,
			// TODO (stickupkid): We need to model the refreshed date. It's
			// currently optional, but will be required at some point. This
			// is the installed date of the charm on the system.
		}},
		Actions: []transport.RefreshRequestAction{{
			Action:      string(RefreshAction),
			InstanceKey: c.instanceKey,
			ID:          &c.ID,
		}},
		Fields: c.fields,
	}, 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 refreshOne) Build() (transport.RefreshRequest, error) {
	base, err := constructRefreshBase(c.Base)
	if err != nil {
		return transport.RefreshRequest{}, errors.Trace(err)
	}
	return transport.RefreshRequest{
		Context: []transport.RefreshRequestContext{{
			InstanceKey:     c.instanceKey,
			ID:              c.ID,
			Revision:        c.Revision,
			Base:            base,
			TrackingChannel: c.Channel,
			Metrics:         c.metrics,
		}},
		Actions: []transport.RefreshRequestAction{{
			Action:      string(RefreshAction),
			InstanceKey: c.instanceKey,
			ID:          &c.ID,
		}},
		Fields: c.fields,
	}, nil
}
func ( c refreshOne ) Build ( ) ( transport . RefreshRequest , error ) { base , err := constructRefreshBase ( c . Base ) if err != nil { return transport . RefreshRequest { } , errors . Trace ( err ) } return transport . RefreshRequest { Context : [ ] transport . RefreshRequestContext { { InstanceKey : c . instanceKey , ID : c . ID , Revision : c . Revision , Base : base , TrackingChannel : c . Channel , Metrics : c . metrics , } } , Actions : [ ] transport . RefreshRequestAction { { Action : string ( RefreshAction ) , InstanceKey : c . instanceKey , ID : & c . ID , } } , Fields : c . fields , } , nil }
Build a refresh request that can be past to the API.
Build a refresh request that can be past to the API .
// TODO (stickupkid): We need to model the refreshed date. It's // currently optional, but will be required at some point. This // is the installed date of the charm on the system.