func (f *Future) Done(sender autorest.Sender) (bool, error) {
	if f.ps.hasTerminated() {
		return true, f.errorInfo()
	}
	resp, err := sender.Do(f.req)
	f.resp = resp
	if err != nil || !autorest.ResponseHasStatusCode(resp, pollingCodes[:]...) {
		return false, err
	}
	err = updatePollingState(resp, &f.ps)
	if err != nil {
		return false, err
	}
	if f.ps.hasTerminated() {
		return true, f.errorInfo()
	}
	f.req, err = newPollingRequest(f.ps)
	return false, err
}
Done queries the service to see if the operation has completed.
package azure
import (
	"bytes"
	"context"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"strings"
	"time"
	"github.com/Azure/go-autorest/autorest"
	"github.com/Azure/go-autorest/autorest/date"
)
const (
	headerAsyncOperation = "Azure-AsyncOperation"
)
const (
	operationInProgress string = "InProgress"
	operationCanceled   string = "Canceled"
	operationFailed     string = "Failed"
	operationSucceeded  string = "Succeeded"
)
var pollingCodes = [...]int{http.StatusAccepted, http.StatusCreated, http.StatusOK}
type Future struct {
	req  *http.Request
	resp *http.Response
	ps   pollingState
}
func NewFuture(req *http.Request) Future {
	return Future{req: req}
}
func (f Future) Response() *http.Response {
	return f.resp
}
func (f Future) Status() string {
	if f.ps.State == "" {
		return "Unknown"
	}
	return f.ps.State
}
func (f Future) PollingMethod() PollingMethodType {
	return f.ps.PollingMethod
}