func (client *ReadonlypropertyClient) PutValid(ctx context.Context, complexBody ReadonlyObj, options *ReadonlypropertyPutValidOptions) (ReadonlypropertyPutValidResponse, error) {
	req, err := client.putValidCreateRequest(ctx, complexBody, options)
	if err != nil {
		return ReadonlypropertyPutValidResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return ReadonlypropertyPutValidResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return ReadonlypropertyPutValidResponse{}, client.putValidHandleError(resp)
	}
	return ReadonlypropertyPutValidResponse{RawResponse: resp}, nil
}
PutValid - Put complex types that have readonly properties
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 ReadonlypropertyClient struct {
	con *Connection
}
func NewReadonlypropertyClient(con *Connection) *ReadonlypropertyClient {
	return &ReadonlypropertyClient{con: con}
}
func (client *ReadonlypropertyClient) GetValid(ctx context.Context, options *ReadonlypropertyGetValidOptions) (ReadonlypropertyGetValidResponse, error) {
	req, err := client.getValidCreateRequest(ctx, options)
	if err != nil {
		return ReadonlypropertyGetValidResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return ReadonlypropertyGetValidResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return ReadonlypropertyGetValidResponse{}, client.getValidHandleError(resp)
	}
	return client.getValidHandleResponse(resp)
}
func (client *ReadonlypropertyClient) getValidCreateRequest(ctx context.Context, options *ReadonlypropertyGetValidOptions) (*policy.Request, error) {
	urlPath := "/complex/readonlyproperty/valid"
	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 *ReadonlypropertyClient) getValidHandleResponse(resp *http.Response) (ReadonlypropertyGetValidResponse, error) {
	result := ReadonlypropertyGetValidResponse{RawResponse: resp}
	if err := runtime.UnmarshalAsJSON(resp, &result.ReadonlyObj); err != nil {
		return ReadonlypropertyGetValidResponse{}, runtime.NewResponseError(err, resp)
	}
	return result, nil
}
func (client *ReadonlypropertyClient) getValidHandleError(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)
}