func ByUnmarshallingBytes(v *[]byte) RespondDecorator {
	return func(r Responder) Responder {
		return ResponderFunc(func(resp *http.Response) error {
			err := r.Respond(resp)
			if err == nil {
				bytes, errInner := ioutil.ReadAll(resp.Body)
				if errInner != nil {
					err = fmt.Errorf("Error occurred reading http.Response#Body - Error = '%v'", errInner)
				} else {
					*v = bytes
				}
			}
			return err
		})
	}
}
ByUnmarshallingBytes returns a RespondDecorator that copies the Bytes returned in the
response Body into the value pointed to by v.
package autorest
import (
	"bytes"
	"encoding/json"
	"encoding/xml"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"strings"
)
type Responder interface {
	Respond(*http.Response) error
}
type ResponderFunc func(*http.Response) error
func (rf ResponderFunc) Respond(r *http.Response) error {
	return rf(r)
}
type RespondDecorator func(Responder) Responder
func CreateResponder(decorators ...RespondDecorator) Responder {
	return DecorateResponder(
		Responder(ResponderFunc(func(r *http.Response) error { return nil })),
		decorators...)
}
func DecorateResponder(r Responder, decorators ...RespondDecorator) Responder {
	for _, decorate := range decorators {
		r = decorate(r)
	}
	return r
}
func Respond(r *http.Response, decorators ...RespondDecorator) error {
	if r == nil {
		return nil
	}
	return CreateResponder(decorators...).Respond(r)
}
func ByIgnoring() RespondDecorator {
	return func(r Responder) Responder {
		return ResponderFunc(func(resp *http.Response) error {
			return r.Respond(resp)
		})
	}
}
func ByCopying(b *bytes.Buffer) RespondDecorator {
	return func(r Responder) Responder {
		return ResponderFunc(func(resp *http.Response) error {
			err := r.Respond(resp)
			if err == nil && resp != nil && resp.Body != nil {
				resp.Body = TeeReadCloser(resp.Body, b)
			}
			return err
		})
	}
}
func ByDiscardingBody() RespondDecorator {
	return func(r Responder) Responder {
		return ResponderFunc(func(resp *http.Response) error {
			err := r.Respond(resp)
			if err == nil && resp != nil && resp.Body != nil {
				if _, err := io.Copy(ioutil.Discard, resp.Body); err != nil {
					return fmt.Errorf("Error discarding the response body: %v", err)
				}
			}
			return err
		})
	}
}
func ByClosing() RespondDecorator {
	return func(r Responder) Responder {
		return ResponderFunc(func(resp *http.Response) error {
			err := r.Respond(resp)
			if resp != nil && resp.Body != nil {
				if err := resp.Body.Close(); err != nil {
					return fmt.Errorf("Error closing the response body: %v", err)
				}
			}
			return err
		})
	}
}
func ByClosingIfError() RespondDecorator {
	return func(r Responder) Responder {
		return ResponderFunc(func(resp *http.Response) error {
			err := r.Respond(resp)
			if err != nil && resp != nil && resp.Body != nil {
				if err := resp.Body.Close(); err != nil {
					return fmt.Errorf("Error closing the response body: %v", err)
				}
			}
			return err
		})
	}
}