func (client *FilesClient) getFileLargeHandleError(resp *http.Response) error {
	body, err := runtime.Payload(resp)
	if err != nil {
		return runtime.NewResponseError(err, resp)
	}
	errType := Error{raw: string(body)}
	if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
		return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
	}
	return runtime.NewResponseError(&errType, resp)
}
getFileLargeHandleError handles the GetFileLarge error response.
package filegroup
import (
	"context"
	"fmt"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
	"net/http"
)
type FilesClient struct {
	con *Connection
}
func NewFilesClient(con *Connection) *FilesClient {
	return &FilesClient{con: con}
}
func (client *FilesClient) GetEmptyFile(ctx context.Context, options *FilesGetEmptyFileOptions) (FilesGetEmptyFileResponse, error) {
	req, err := client.getEmptyFileCreateRequest(ctx, options)
	if err != nil {
		return FilesGetEmptyFileResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return FilesGetEmptyFileResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return FilesGetEmptyFileResponse{}, client.getEmptyFileHandleError(resp)
	}
	return FilesGetEmptyFileResponse{RawResponse: resp}, nil
}
func (client *FilesClient) getEmptyFileCreateRequest(ctx context.Context, options *FilesGetEmptyFileOptions) (*policy.Request, error) {
	urlPath := "/files/stream/empty"
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.con.Endpoint(), urlPath))
	if err != nil {
		return nil, err
	}
	req.SkipBodyDownload()
	req.Raw().Header.Set("Accept", "image/png, application/json")
	return req, nil
}
func (client *FilesClient) getEmptyFileHandleError(resp *http.Response) error {
	body, err := runtime.Payload(resp)
	if err != nil {
		return runtime.NewResponseError(err, resp)
	}
	errType := Error{raw: string(body)}
	if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
		return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
	}
	return runtime.NewResponseError(&errType, resp)
}
func (client *FilesClient) GetFile(ctx context.Context, options *FilesGetFileOptions) (FilesGetFileResponse, error) {
	req, err := client.getFileCreateRequest(ctx, options)
	if err != nil {
		return FilesGetFileResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return FilesGetFileResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return FilesGetFileResponse{}, client.getFileHandleError(resp)
	}
	return FilesGetFileResponse{RawResponse: resp}, nil
}
func (client *FilesClient) getFileCreateRequest(ctx context.Context, options *FilesGetFileOptions) (*policy.Request, error) {
	urlPath := "/files/stream/nonempty"
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.con.Endpoint(), urlPath))
	if err != nil {
		return nil, err
	}
	req.SkipBodyDownload()
	req.Raw().Header.Set("Accept", "image/png, application/json")
	return req, nil
}
func (client *FilesClient) getFileHandleError(resp *http.Response) error {
	body, err := runtime.Payload(resp)
	if err != nil {
		return runtime.NewResponseError(err, resp)
	}
	errType := Error{raw: string(body)}
	if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
		return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
	}
	return runtime.NewResponseError(&errType, resp)
}
func (client *FilesClient) GetFileLarge(ctx context.Context, options *FilesGetFileLargeOptions) (FilesGetFileLargeResponse, error) {
	req, err := client.getFileLargeCreateRequest(ctx, options)
	if err != nil {
		return FilesGetFileLargeResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return FilesGetFileLargeResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return FilesGetFileLargeResponse{}, client.getFileLargeHandleError(resp)
	}
	return FilesGetFileLargeResponse{RawResponse: resp}, nil
}
func (client *FilesClient) getFileLargeCreateRequest(ctx context.Context, options *FilesGetFileLargeOptions) (*policy.Request, error) {
	urlPath := "/files/stream/verylarge"
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.con.Endpoint(), urlPath))
	if err != nil {
		return nil, err
	}
	req.SkipBodyDownload()
	req.Raw().Header.Set("Accept", "image/png, application/json")
	return req, nil
}