func (client *PolymorphismClient) GetComposedWithoutDiscriminator(ctx context.Context, options *PolymorphismGetComposedWithoutDiscriminatorOptions) (PolymorphismGetComposedWithoutDiscriminatorResponse, error) {
	req, err := client.getComposedWithoutDiscriminatorCreateRequest(ctx, options)
	if err != nil {
		return PolymorphismGetComposedWithoutDiscriminatorResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return PolymorphismGetComposedWithoutDiscriminatorResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return PolymorphismGetComposedWithoutDiscriminatorResponse{}, client.getComposedWithoutDiscriminatorHandleError(resp)
	}
	return client.getComposedWithoutDiscriminatorHandleResponse(resp)
}
GetComposedWithoutDiscriminator - Get complex object composing a polymorphic scalar property and array property with polymorphic element type, without
discriminator specified on wire. Deserialization must NOT fail and use the explicit
type of the property.
If the operation fails it returns the *Error error type.
package complexgroup
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 PolymorphismClient struct {
	con *Connection
}
func NewPolymorphismClient(con *Connection) *PolymorphismClient {
	return &PolymorphismClient{con: con}
}
func (client *PolymorphismClient) GetComplicated(ctx context.Context, options *PolymorphismGetComplicatedOptions) (PolymorphismGetComplicatedResponse, error) {
	req, err := client.getComplicatedCreateRequest(ctx, options)
	if err != nil {
		return PolymorphismGetComplicatedResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return PolymorphismGetComplicatedResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return PolymorphismGetComplicatedResponse{}, client.getComplicatedHandleError(resp)
	}
	return client.getComplicatedHandleResponse(resp)
}
func (client *PolymorphismClient) getComplicatedCreateRequest(ctx context.Context, options *PolymorphismGetComplicatedOptions) (*policy.Request, error) {
	urlPath := "/complex/polymorphism/complicated"
	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 *PolymorphismClient) getComplicatedHandleResponse(resp *http.Response) (PolymorphismGetComplicatedResponse, error) {
	result := PolymorphismGetComplicatedResponse{RawResponse: resp}
	if err := runtime.UnmarshalAsJSON(resp, &result); err != nil {
		return PolymorphismGetComplicatedResponse{}, runtime.NewResponseError(err, resp)
	}
	return result, nil
}
func (client *PolymorphismClient) getComplicatedHandleError(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 *PolymorphismClient) GetComposedWithDiscriminator(ctx context.Context, options *PolymorphismGetComposedWithDiscriminatorOptions) (PolymorphismGetComposedWithDiscriminatorResponse, error) {
	req, err := client.getComposedWithDiscriminatorCreateRequest(ctx, options)
	if err != nil {
		return PolymorphismGetComposedWithDiscriminatorResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return PolymorphismGetComposedWithDiscriminatorResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return PolymorphismGetComposedWithDiscriminatorResponse{}, client.getComposedWithDiscriminatorHandleError(resp)
	}
	return client.getComposedWithDiscriminatorHandleResponse(resp)
}
func (client *PolymorphismClient) getComposedWithDiscriminatorCreateRequest(ctx context.Context, options *PolymorphismGetComposedWithDiscriminatorOptions) (*policy.Request, error) {
	urlPath := "/complex/polymorphism/composedWithDiscriminator"
	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 *PolymorphismClient) getComposedWithDiscriminatorHandleResponse(resp *http.Response) (PolymorphismGetComposedWithDiscriminatorResponse, error) {
	result := PolymorphismGetComposedWithDiscriminatorResponse{RawResponse: resp}
	if err := runtime.UnmarshalAsJSON(resp, &result.DotFishMarket); err != nil {
		return PolymorphismGetComposedWithDiscriminatorResponse{}, runtime.NewResponseError(err, resp)
	}
	return result, nil
}
func (client *PolymorphismClient) getComposedWithDiscriminatorHandleError(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)
}