func (client *HTTPRedirectsClient) head300CreateRequest(ctx context.Context, options *HTTPRedirectsHead300Options) (*policy.Request, error) {
	urlPath := "/http/redirect/300"
	req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.con.Endpoint(), urlPath))
	if err != nil {
		return nil, err
	}
	req.Raw().Header.Set("Accept", "application/json")
	return req, nil
}
head300CreateRequest creates the Head300 request.
package httpinfrastructuregroup
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 HTTPRedirectsClient struct {
	con *Connection
}
func NewHTTPRedirectsClient(con *Connection) *HTTPRedirectsClient {
	return &HTTPRedirectsClient{con: con}
}
func (client *HTTPRedirectsClient) Delete307(ctx context.Context, options *HTTPRedirectsDelete307Options) (HTTPRedirectsDelete307Response, error) {
	req, err := client.delete307CreateRequest(ctx, options)
	if err != nil {
		return HTTPRedirectsDelete307Response{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return HTTPRedirectsDelete307Response{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return HTTPRedirectsDelete307Response{}, client.delete307HandleError(resp)
	}
	return HTTPRedirectsDelete307Response{RawResponse: resp}, nil
}
func (client *HTTPRedirectsClient) delete307CreateRequest(ctx context.Context, options *HTTPRedirectsDelete307Options) (*policy.Request, error) {
	urlPath := "/http/redirect/307"
	req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.con.Endpoint(), urlPath))
	if err != nil {
		return nil, err
	}
	req.Raw().Header.Set("Accept", "application/json")
	return req, runtime.MarshalAsJSON(req, true)
}
func (client *HTTPRedirectsClient) delete307HandleError(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 *HTTPRedirectsClient) Get300(ctx context.Context, options *HTTPRedirectsGet300Options) (HTTPRedirectsGet300Response, error) {
	req, err := client.get300CreateRequest(ctx, options)
	if err != nil {
		return HTTPRedirectsGet300Response{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return HTTPRedirectsGet300Response{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusMultipleChoices) {
		return HTTPRedirectsGet300Response{}, client.get300HandleError(resp)
	}
	return client.get300HandleResponse(resp)
}
func (client *HTTPRedirectsClient) get300CreateRequest(ctx context.Context, options *HTTPRedirectsGet300Options) (*policy.Request, error) {
	urlPath := "/http/redirect/300"
	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 *HTTPRedirectsClient) get300HandleResponse(resp *http.Response) (HTTPRedirectsGet300Response, error) {
	result := HTTPRedirectsGet300Response{RawResponse: resp}
	if val := resp.Header.Get("Location"); val != "" {
		result.Location = &val
	}
	if err := runtime.UnmarshalAsJSON(resp, &result.StringArray); err != nil {
		return HTTPRedirectsGet300Response{}, runtime.NewResponseError(err, resp)
	}
	return result, nil
}
func (client *HTTPRedirectsClient) get300HandleError(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 *HTTPRedirectsClient) Get301(ctx context.Context, options *HTTPRedirectsGet301Options) (HTTPRedirectsGet301Response, error) {
	req, err := client.get301CreateRequest(ctx, options)
	if err != nil {
		return HTTPRedirectsGet301Response{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return HTTPRedirectsGet301Response{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return HTTPRedirectsGet301Response{}, client.get301HandleError(resp)
	}
	return HTTPRedirectsGet301Response{RawResponse: resp}, nil
}
func (client *HTTPRedirectsClient) get301CreateRequest(ctx context.Context, options *HTTPRedirectsGet301Options) (*policy.Request, error) {
	urlPath := "/http/redirect/301"
	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 *HTTPRedirectsClient) get301HandleError(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 *HTTPRedirectsClient) Get302(ctx context.Context, options *HTTPRedirectsGet302Options) (HTTPRedirectsGet302Response, error) {
	req, err := client.get302CreateRequest(ctx, options)
	if err != nil {
		return HTTPRedirectsGet302Response{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return HTTPRedirectsGet302Response{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return HTTPRedirectsGet302Response{}, client.get302HandleError(resp)
	}
	return HTTPRedirectsGet302Response{RawResponse: resp}, nil
}
func (client *HTTPRedirectsClient) get302CreateRequest(ctx context.Context, options *HTTPRedirectsGet302Options) (*policy.Request, error) {
	urlPath := "/http/redirect/302"
	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 *HTTPRedirectsClient) get302HandleError(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 *HTTPRedirectsClient) Get307(ctx context.Context, options *HTTPRedirectsGet307Options) (HTTPRedirectsGet307Response, error) {
	req, err := client.get307CreateRequest(ctx, options)
	if err != nil {
		return HTTPRedirectsGet307Response{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return HTTPRedirectsGet307Response{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return HTTPRedirectsGet307Response{}, client.get307HandleError(resp)
	}
	return HTTPRedirectsGet307Response{RawResponse: resp}, nil
}
func (client *HTTPRedirectsClient) get307CreateRequest(ctx context.Context, options *HTTPRedirectsGet307Options) (*policy.Request, error) {
	urlPath := "/http/redirect/307"
	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 *HTTPRedirectsClient) get307HandleError(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 *HTTPRedirectsClient) Head300(ctx context.Context, options *HTTPRedirectsHead300Options) (HTTPRedirectsHead300Response, error) {
	req, err := client.head300CreateRequest(ctx, options)
	if err != nil {
		return HTTPRedirectsHead300Response{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return HTTPRedirectsHead300Response{}, err
	}
	return client.head300HandleResponse(resp)
}