// DoneWithContext queries the service to see if the operation has completed.
16991
func (f *Future) DoneWithContext(ctx context.Context, sender autorest.Sender) (done bool, err error) {
	ctx = tracing.StartSpan(ctx, "github.com/Azure/go-autorest/autorest/azure/async.DoneWithContext")
	defer func() {
		sc := -1
		resp := f.Response()
		if resp != nil {
			sc = resp.StatusCode
		}
		tracing.EndSpan(ctx, sc, err)
	}()

	if f.pt == nil {
		return false, autorest.NewError("Future", "Done", "future is not initialized")
	}
	if f.pt.hasTerminated() {
		return true, f.pt.pollingError()
	}
	if err := f.pt.pollForStatus(ctx, sender); err != nil {
		return false, err
	}
	if err := f.pt.checkForErrors(); err != nil {
		return f.pt.hasTerminated(), err
	}
	if err := f.pt.updatePollingState(f.pt.provisioningStateApplicable()); err != nil {
		return false, err
	}
	if err := f.pt.initPollingMethod(); err != nil {
		return false, err
	}
	if err := f.pt.updatePollingMethod(); err != nil {
		return false, err
	}
	return f.pt.hasTerminated(), f.pt.pollingError()
}
676388
func (db *DB) WithContext(ctx context.Context) *DB {
	return newDB(ctx, db.baseDB)
}
496468
func (h *Handler) WithContext(ctx context.Context) {
	go func() {
		<-ctx.Done()
		h.terminating = true
	}()
}
1246702
func (o *OrderDeleteParams) WithContext(ctx context.Context) *OrderDeleteParams {
	o.SetContext(ctx)
	return o
}
451694
func (call *DownloadRichMenuImageCall) WithContext(ctx context.Context) *DownloadRichMenuImageCall {
	call.ctx = ctx
	return call
}
30865
func (b *Batch) WithContext(ctx context.Context) *Batch {
	b2 := *b
	b2.context = ctx
	return &b2
}
213974
func (call *DeleteLIFFCall) WithContext(ctx context.Context) *DeleteLIFFCall {
	call.ctx = ctx
	return call
}
973424
func (o *GetPolicyResolveParams) WithContext(ctx context.Context) *GetPolicyResolveParams {
	o.SetContext(ctx)
	return o
}
591463
func (o *GetServiceIDParams) WithContext(ctx context.Context) *GetServiceIDParams {
	o.SetContext(ctx)
	return o
}
1109129
func (process *TeleportProcess) WaitWithContext(ctx context.Context) {
	local, cancel := context.WithCancel(ctx)
	go func() {
		defer cancel()
		process.Supervisor.Wait()
	}()
	select {
	case <-local.Done():
		return
	}
}
867480
func (o *Oauth2TokenParams) WithContext(ctx context.Context) *Oauth2TokenParams {
	o.SetContext(ctx)
	return o
}
947501
func (o *CreateParams) WithContext(ctx context.Context) *CreateParams {
	o.SetContext(ctx)
	return o
}
50147
func (o *DeleteServiceIDParams) WithContext(ctx context.Context) *DeleteServiceIDParams {
	o.SetContext(ctx)
	return o
}
1218401
func (call *GetRoomMemberIDsCall) WithContext(ctx context.Context) *GetRoomMemberIDsCall {
	call.ctx = ctx
	return call
}
621407
func (o *AddOneParams) WithContext(ctx context.Context) *AddOneParams {
	o.SetContext(ctx)
	return o
}
926880
func (o *ListTasksParams) WithContext(ctx context.Context) *ListTasksParams {
	o.SetContext(ctx)
	return o
}
50733
func (client *Client) DeleteWithContext(ctx context.Context, g Deletable) error {
	return g.Delete(ctx, client)
}