func NewDecoder(encodedAs EncodedAs, r io.Reader) Decoder {
	if encodedAs == EncodedAsJSON {
		return json.NewDecoder(r)
	} else if encodedAs == EncodedAsXML {
		return xml.NewDecoder(r)
	}
	return nil
}
NewDecoder creates a new decoder appropriate to the passed encoding.
encodedAs specifies the type of encoding and r supplies the io.Reader containing the
encoded data.
package autorest
import (
	"bytes"
	"encoding/json"
	"encoding/xml"
	"fmt"
	"io"
	"net"
	"net/http"
	"net/url"
	"reflect"
	"strings"
	"github.com/Azure/go-autorest/autorest/adal"
)
type EncodedAs string
const (
	EncodedAsJSON EncodedAs = "JSON"
	EncodedAsXML EncodedAs = "XML"
)
type Decoder interface {
	Decode(v interface{}) error
}