func (client *PetsClient) createCatAPTrueHandleError(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)
}
createCatAPTrueHandleError handles the CreateCatAPTrue error response.
package additionalpropsgroup
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 PetsClient struct {
	con *Connection
}
func NewPetsClient(con *Connection) *PetsClient {
	return &PetsClient{con: con}
}
func (client *PetsClient) CreateAPInProperties(ctx context.Context, createParameters PetAPInProperties, options *PetsCreateAPInPropertiesOptions) (PetsCreateAPInPropertiesResponse, error) {
	req, err := client.createAPInPropertiesCreateRequest(ctx, createParameters, options)
	if err != nil {
		return PetsCreateAPInPropertiesResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return PetsCreateAPInPropertiesResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return PetsCreateAPInPropertiesResponse{}, client.createAPInPropertiesHandleError(resp)
	}
	return client.createAPInPropertiesHandleResponse(resp)
}
func (client *PetsClient) createAPInPropertiesCreateRequest(ctx context.Context, createParameters PetAPInProperties, options *PetsCreateAPInPropertiesOptions) (*policy.Request, error) {
	urlPath := "/additionalProperties/in/properties"
	req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.con.Endpoint(), urlPath))
	if err != nil {
		return nil, err
	}
	req.Raw().Header.Set("Accept", "application/json")
	return req, runtime.MarshalAsJSON(req, createParameters)
}
func (client *PetsClient) createAPInPropertiesHandleResponse(resp *http.Response) (PetsCreateAPInPropertiesResponse, error) {
	result := PetsCreateAPInPropertiesResponse{RawResponse: resp}
	if err := runtime.UnmarshalAsJSON(resp, &result.PetAPInProperties); err != nil {
		return PetsCreateAPInPropertiesResponse{}, runtime.NewResponseError(err, resp)
	}
	return result, nil
}
func (client *PetsClient) createAPInPropertiesHandleError(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 *PetsClient) CreateAPInPropertiesWithAPString(ctx context.Context, createParameters PetAPInPropertiesWithAPString, options *PetsCreateAPInPropertiesWithAPStringOptions) (PetsCreateAPInPropertiesWithAPStringResponse, error) {
	req, err := client.createAPInPropertiesWithAPStringCreateRequest(ctx, createParameters, options)
	if err != nil {
		return PetsCreateAPInPropertiesWithAPStringResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return PetsCreateAPInPropertiesWithAPStringResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return PetsCreateAPInPropertiesWithAPStringResponse{}, client.createAPInPropertiesWithAPStringHandleError(resp)
	}
	return client.createAPInPropertiesWithAPStringHandleResponse(resp)
}
func (client *PetsClient) createAPInPropertiesWithAPStringCreateRequest(ctx context.Context, createParameters PetAPInPropertiesWithAPString, options *PetsCreateAPInPropertiesWithAPStringOptions) (*policy.Request, error) {
	urlPath := "/additionalProperties/in/properties/with/additionalProperties/string"
	req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.con.Endpoint(), urlPath))
	if err != nil {
		return nil, err
	}
	req.Raw().Header.Set("Accept", "application/json")
	return req, runtime.MarshalAsJSON(req, createParameters)
}
func (client *PetsClient) createAPInPropertiesWithAPStringHandleResponse(resp *http.Response) (PetsCreateAPInPropertiesWithAPStringResponse, error) {
	result := PetsCreateAPInPropertiesWithAPStringResponse{RawResponse: resp}
	if err := runtime.UnmarshalAsJSON(resp, &result.PetAPInPropertiesWithAPString); err != nil {
		return PetsCreateAPInPropertiesWithAPStringResponse{}, runtime.NewResponseError(err, resp)
	}
	return result, nil
}
func (client *PetsClient) createAPInPropertiesWithAPStringHandleError(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 *PetsClient) CreateAPObject(ctx context.Context, createParameters PetAPObject, options *PetsCreateAPObjectOptions) (PetsCreateAPObjectResponse, error) {
	req, err := client.createAPObjectCreateRequest(ctx, createParameters, options)
	if err != nil {
		return PetsCreateAPObjectResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return PetsCreateAPObjectResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return PetsCreateAPObjectResponse{}, client.createAPObjectHandleError(resp)
	}
	return client.createAPObjectHandleResponse(resp)
}
func (client *PetsClient) createAPObjectCreateRequest(ctx context.Context, createParameters PetAPObject, options *PetsCreateAPObjectOptions) (*policy.Request, error) {
	urlPath := "/additionalProperties/type/object"
	req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.con.Endpoint(), urlPath))
	if err != nil {
		return nil, err
	}
	req.Raw().Header.Set("Accept", "application/json")
	return req, runtime.MarshalAsJSON(req, createParameters)
}
func (client *PetsClient) createAPObjectHandleResponse(resp *http.Response) (PetsCreateAPObjectResponse, error) {
	result := PetsCreateAPObjectResponse{RawResponse: resp}
	if err := runtime.UnmarshalAsJSON(resp, &result.PetAPObject); err != nil {
		return PetsCreateAPObjectResponse{}, runtime.NewResponseError(err, resp)
	}
	return result, nil
}
func (client *PetsClient) createAPObjectHandleError(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 *PetsClient) CreateAPString(ctx context.Context, createParameters PetAPString, options *PetsCreateAPStringOptions) (PetsCreateAPStringResponse, error) {
	req, err := client.createAPStringCreateRequest(ctx, createParameters, options)
	if err != nil {
		return PetsCreateAPStringResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return PetsCreateAPStringResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return PetsCreateAPStringResponse{}, client.createAPStringHandleError(resp)
	}
	return client.createAPStringHandleResponse(resp)
}
func (client *PetsClient) createAPStringCreateRequest(ctx context.Context, createParameters PetAPString, options *PetsCreateAPStringOptions) (*policy.Request, error) {
	urlPath := "/additionalProperties/type/string"
	req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.con.Endpoint(), urlPath))
	if err != nil {
		return nil, err
	}
	req.Raw().Header.Set("Accept", "application/json")
	return req, runtime.MarshalAsJSON(req, createParameters)
}
func (client *PetsClient) createAPStringHandleResponse(resp *http.Response) (PetsCreateAPStringResponse, error) {
	result := PetsCreateAPStringResponse{RawResponse: resp}
	if err := runtime.UnmarshalAsJSON(resp, &result.PetAPString); err != nil {
		return PetsCreateAPStringResponse{}, runtime.NewResponseError(err, resp)
	}
	return result, nil
}
func (client *PetsClient) createAPStringHandleError(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 *PetsClient) CreateAPTrue(ctx context.Context, createParameters PetAPTrue, options *PetsCreateAPTrueOptions) (PetsCreateAPTrueResponse, error) {
	req, err := client.createAPTrueCreateRequest(ctx, createParameters, options)
	if err != nil {
		return PetsCreateAPTrueResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return PetsCreateAPTrueResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return PetsCreateAPTrueResponse{}, client.createAPTrueHandleError(resp)
	}
	return client.createAPTrueHandleResponse(resp)
}
func (client *PetsClient) createAPTrueCreateRequest(ctx context.Context, createParameters PetAPTrue, options *PetsCreateAPTrueOptions) (*policy.Request, error) {
	urlPath := "/additionalProperties/true"
	req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.con.Endpoint(), urlPath))
	if err != nil {
		return nil, err
	}
	req.Raw().Header.Set("Accept", "application/json")
	return req, runtime.MarshalAsJSON(req, createParameters)
}
func (client *PetsClient) createAPTrueHandleResponse(resp *http.Response) (PetsCreateAPTrueResponse, error) {
	result := PetsCreateAPTrueResponse{RawResponse: resp}
	if err := runtime.UnmarshalAsJSON(resp, &result.PetAPTrue); err != nil {
		return PetsCreateAPTrueResponse{}, runtime.NewResponseError(err, resp)
	}
	return result, nil
}
func (client *PetsClient) createAPTrueHandleError(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 *PetsClient) CreateCatAPTrue(ctx context.Context, createParameters CatAPTrue, options *PetsCreateCatAPTrueOptions) (PetsCreateCatAPTrueResponse, error) {
	req, err := client.createCatAPTrueCreateRequest(ctx, createParameters, options)
	if err != nil {
		return PetsCreateCatAPTrueResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return PetsCreateCatAPTrueResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return PetsCreateCatAPTrueResponse{}, client.createCatAPTrueHandleError(resp)
	}
	return client.createCatAPTrueHandleResponse(resp)
}
func (client *PetsClient) createCatAPTrueCreateRequest(ctx context.Context, createParameters CatAPTrue, options *PetsCreateCatAPTrueOptions) (*policy.Request, error) {
	urlPath := "/additionalProperties/true-subclass"
	req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.con.Endpoint(), urlPath))
	if err != nil {
		return nil, err
	}
	req.Raw().Header.Set("Accept", "application/json")
	return req, runtime.MarshalAsJSON(req, createParameters)
}
func (client *PetsClient) createCatAPTrueHandleResponse(resp *http.Response) (PetsCreateCatAPTrueResponse, error) {
	result := PetsCreateCatAPTrueResponse{RawResponse: resp}
	if err := runtime.UnmarshalAsJSON(resp, &result.CatAPTrue); err != nil {
		return PetsCreateCatAPTrueResponse{}, runtime.NewResponseError(err, resp)
	}
	return result, nil
}