func (client *StringClient) getMBCSHandleError(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)
}
getMBCSHandleError handles the GetMBCS error response.
package stringgroup
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 StringClient struct {
	con *Connection
}
func NewStringClient(con *Connection) *StringClient {
	return &StringClient{con: con}
}
func (client *StringClient) GetBase64Encoded(ctx context.Context, options *StringGetBase64EncodedOptions) (StringGetBase64EncodedResponse, error) {
	req, err := client.getBase64EncodedCreateRequest(ctx, options)
	if err != nil {
		return StringGetBase64EncodedResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return StringGetBase64EncodedResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return StringGetBase64EncodedResponse{}, client.getBase64EncodedHandleError(resp)
	}
	return client.getBase64EncodedHandleResponse(resp)
}
func (client *StringClient) getBase64EncodedCreateRequest(ctx context.Context, options *StringGetBase64EncodedOptions) (*policy.Request, error) {
	urlPath := "/string/base64Encoding"
	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 *StringClient) getBase64EncodedHandleResponse(resp *http.Response) (StringGetBase64EncodedResponse, error) {
	result := StringGetBase64EncodedResponse{RawResponse: resp}
	if err := runtime.UnmarshalAsByteArray(resp, &result.Value, runtime.Base64StdFormat); err != nil {
		return StringGetBase64EncodedResponse{}, runtime.NewResponseError(err, resp)
	}
	return result, nil
}
func (client *StringClient) getBase64EncodedHandleError(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 *StringClient) GetBase64URLEncoded(ctx context.Context, options *StringGetBase64URLEncodedOptions) (StringGetBase64URLEncodedResponse, error) {
	req, err := client.getBase64URLEncodedCreateRequest(ctx, options)
	if err != nil {
		return StringGetBase64URLEncodedResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return StringGetBase64URLEncodedResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return StringGetBase64URLEncodedResponse{}, client.getBase64URLEncodedHandleError(resp)
	}
	return client.getBase64URLEncodedHandleResponse(resp)
}
func (client *StringClient) getBase64URLEncodedCreateRequest(ctx context.Context, options *StringGetBase64URLEncodedOptions) (*policy.Request, error) {
	urlPath := "/string/base64UrlEncoding"
	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 *StringClient) getBase64URLEncodedHandleResponse(resp *http.Response) (StringGetBase64URLEncodedResponse, error) {
	result := StringGetBase64URLEncodedResponse{RawResponse: resp}
	if err := runtime.UnmarshalAsByteArray(resp, &result.Value, runtime.Base64URLFormat); err != nil {
		return StringGetBase64URLEncodedResponse{}, runtime.NewResponseError(err, resp)
	}
	return result, nil
}
func (client *StringClient) getBase64URLEncodedHandleError(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 *StringClient) GetEmpty(ctx context.Context, options *StringGetEmptyOptions) (StringGetEmptyResponse, error) {
	req, err := client.getEmptyCreateRequest(ctx, options)
	if err != nil {
		return StringGetEmptyResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return StringGetEmptyResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return StringGetEmptyResponse{}, client.getEmptyHandleError(resp)
	}
	return client.getEmptyHandleResponse(resp)
}
func (client *StringClient) getEmptyCreateRequest(ctx context.Context, options *StringGetEmptyOptions) (*policy.Request, error) {
	urlPath := "/string/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 *StringClient) getEmptyHandleResponse(resp *http.Response) (StringGetEmptyResponse, error) {
	result := StringGetEmptyResponse{RawResponse: resp}
	if err := runtime.UnmarshalAsJSON(resp, &result.Value); err != nil {
		return StringGetEmptyResponse{}, runtime.NewResponseError(err, resp)
	}
	return result, nil
}
func (client *StringClient) 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 *StringClient) GetMBCS(ctx context.Context, options *StringGetMBCSOptions) (StringGetMBCSResponse, error) {
	req, err := client.getMBCSCreateRequest(ctx, options)
	if err != nil {
		return StringGetMBCSResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return StringGetMBCSResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return StringGetMBCSResponse{}, client.getMBCSHandleError(resp)
	}
	return client.getMBCSHandleResponse(resp)
}
func (client *StringClient) getMBCSCreateRequest(ctx context.Context, options *StringGetMBCSOptions) (*policy.Request, error) {
	urlPath := "/string/mbcs"
	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 *StringClient) getMBCSHandleResponse(resp *http.Response) (StringGetMBCSResponse, error) {
	result := StringGetMBCSResponse{RawResponse: resp}
	if err := runtime.UnmarshalAsJSON(resp, &result.Value); err != nil {
		return StringGetMBCSResponse{}, runtime.NewResponseError(err, resp)
	}
	return result, nil
}