func (client *ByteClient) getNullHandleError(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)
}
getNullHandleError handles the GetNull error response.
package bytegroup
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 ByteClient struct {
	con *Connection
}
func NewByteClient(con *Connection) *ByteClient {
	return &ByteClient{con: con}
}
func (client *ByteClient) GetEmpty(ctx context.Context, options *ByteGetEmptyOptions) (ByteGetEmptyResponse, error) {
	req, err := client.getEmptyCreateRequest(ctx, options)
	if err != nil {
		return ByteGetEmptyResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return ByteGetEmptyResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return ByteGetEmptyResponse{}, client.getEmptyHandleError(resp)
	}
	return client.getEmptyHandleResponse(resp)
}
func (client *ByteClient) getEmptyCreateRequest(ctx context.Context, options *ByteGetEmptyOptions) (*policy.Request, error) {
	urlPath := "/byte/empty"
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.con.Endpoint(), urlPath))
	if err != nil {
		return nil, err
	}
	req.Raw().Header.Set("Accept", "application/json")
	return req, nil
}
func (client *ByteClient) getEmptyHandleResponse(resp *http.Response) (ByteGetEmptyResponse, error) {
	result := ByteGetEmptyResponse{RawResponse: resp}
	if err := runtime.UnmarshalAsByteArray(resp, &result.Value, runtime.Base64StdFormat); err != nil {
		return ByteGetEmptyResponse{}, runtime.NewResponseError(err, resp)
	}
	return result, nil
}
func (client *ByteClient) getEmptyHandleError(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 *ByteClient) GetInvalid(ctx context.Context, options *ByteGetInvalidOptions) (ByteGetInvalidResponse, error) {
	req, err := client.getInvalidCreateRequest(ctx, options)
	if err != nil {
		return ByteGetInvalidResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return ByteGetInvalidResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return ByteGetInvalidResponse{}, client.getInvalidHandleError(resp)
	}
	return client.getInvalidHandleResponse(resp)
}
func (client *ByteClient) getInvalidCreateRequest(ctx context.Context, options *ByteGetInvalidOptions) (*policy.Request, error) {
	urlPath := "/byte/invalid"
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.con.Endpoint(), urlPath))
	if err != nil {
		return nil, err
	}
	req.Raw().Header.Set("Accept", "application/json")
	return req, nil
}
func (client *ByteClient) getInvalidHandleResponse(resp *http.Response) (ByteGetInvalidResponse, error) {
	result := ByteGetInvalidResponse{RawResponse: resp}
	if err := runtime.UnmarshalAsByteArray(resp, &result.Value, runtime.Base64StdFormat); err != nil {
		return ByteGetInvalidResponse{}, runtime.NewResponseError(err, resp)
	}
	return result, nil
}
func (client *ByteClient) getInvalidHandleError(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 *ByteClient) GetNonASCII(ctx context.Context, options *ByteGetNonASCIIOptions) (ByteGetNonASCIIResponse, error) {
	req, err := client.getNonASCIICreateRequest(ctx, options)
	if err != nil {
		return ByteGetNonASCIIResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return ByteGetNonASCIIResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return ByteGetNonASCIIResponse{}, client.getNonASCIIHandleError(resp)
	}
	return client.getNonASCIIHandleResponse(resp)
}
func (client *ByteClient) getNonASCIICreateRequest(ctx context.Context, options *ByteGetNonASCIIOptions) (*policy.Request, error) {
	urlPath := "/byte/nonAscii"
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.con.Endpoint(), urlPath))
	if err != nil {
		return nil, err
	}
	req.Raw().Header.Set("Accept", "application/json")
	return req, nil
}
func (client *ByteClient) getNonASCIIHandleResponse(resp *http.Response) (ByteGetNonASCIIResponse, error) {
	result := ByteGetNonASCIIResponse{RawResponse: resp}
	if err := runtime.UnmarshalAsByteArray(resp, &result.Value, runtime.Base64StdFormat); err != nil {
		return ByteGetNonASCIIResponse{}, runtime.NewResponseError(err, resp)
	}
	return result, nil
}
func (client *ByteClient) getNonASCIIHandleError(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 *ByteClient) GetNull(ctx context.Context, options *ByteGetNullOptions) (ByteGetNullResponse, error) {
	req, err := client.getNullCreateRequest(ctx, options)
	if err != nil {
		return ByteGetNullResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return ByteGetNullResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return ByteGetNullResponse{}, client.getNullHandleError(resp)
	}
	return client.getNullHandleResponse(resp)
}
func (client *ByteClient) getNullCreateRequest(ctx context.Context, options *ByteGetNullOptions) (*policy.Request, error) {
	urlPath := "/byte/null"
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.con.Endpoint(), urlPath))
	if err != nil {
		return nil, err
	}
	req.Raw().Header.Set("Accept", "application/json")
	return req, nil
}
func (client *ByteClient) getNullHandleResponse(resp *http.Response) (ByteGetNullResponse, error) {
	result := ByteGetNullResponse{RawResponse: resp}
	if err := runtime.UnmarshalAsByteArray(resp, &result.Value, runtime.Base64StdFormat); err != nil {
		return ByteGetNullResponse{}, runtime.NewResponseError(err, resp)
	}
	return result, nil
}