func NewGetTrainerAvailableHoursRequest(server string, params *GetTrainerAvailableHoursParams) (*http.Request, error) {
	var err error
	queryUrl, err := url.Parse(server)
	if err != nil {
		return nil, err
	}
	basePath := fmt.Sprintf("/trainer/calendar")
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}
	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}
	queryValues := queryUrl.Query()
	if queryFrag, err := runtime.StyleParam("form", true, "dateFrom", params.DateFrom); err != nil {
		return nil, err
	} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
		return nil, err
	} else {
		for k, v := range parsed {
			for _, v2 := range v {
				queryValues.Add(k, v2)
			}
		}
	}
	if queryFrag, err := runtime.StyleParam("form", true, "dateTo", params.DateTo); err != nil {
		return nil, err
	} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
		return nil, err
	} else {
		for k, v := range parsed {
			for _, v2 := range v {
				queryValues.Add(k, v2)
			}
		}
	}
	queryUrl.RawQuery = queryValues.Encode()
	req, err := http.NewRequest("GET", queryUrl.String(), nil)
	if err != nil {
		return nil, err
	}
	return req, nil
}
NewGetTrainerAvailableHoursRequest generates requests for GetTrainerAvailableHours
package trainer
import (
	"bytes"
	"context"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"net/url"
	"strings"
	"github.com/deepmap/oapi-codegen/pkg/runtime"
)
type RequestEditorFn func(ctx context.Context, req *http.Request) error
type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}
type Client struct {
	Server string
	Client HttpRequestDoer
	RequestEditor RequestEditorFn
}
type ClientOption func(*Client) error
func NewClient(server string, opts ...ClientOption) (*Client, error) {
	client := Client{
		Server: server,
	}
	for _, o := range opts {
		if err := o(&client); err != nil {
			return nil, err
		}
	}
	if !strings.HasSuffix(client.Server, "/") {
		client.Server += "/"
	}
	if client.Client == nil {
		client.Client = http.DefaultClient
	}
	return &client, nil
}
func WithHTTPClient(doer HttpRequestDoer) ClientOption {
	return func(c *Client) error {
		c.Client = doer
		return nil
	}
}
func WithRequestEditorFn(fn RequestEditorFn) ClientOption {
	return func(c *Client) error {
		c.RequestEditor = fn
		return nil
	}
}
type ClientInterface interface {
	GetTrainerAvailableHours(ctx context.Context, params *GetTrainerAvailableHoursParams) (*http.Response, error)
	MakeHourAvailableWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error)
	MakeHourAvailable(ctx context.Context, body MakeHourAvailableJSONRequestBody) (*http.Response, error)
	MakeHourUnavailableWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error)
	MakeHourUnavailable(ctx context.Context, body MakeHourUnavailableJSONRequestBody) (*http.Response, error)
}
func (c *Client) GetTrainerAvailableHours(ctx context.Context, params *GetTrainerAvailableHoursParams) (*http.Response, error) {
	req, err := NewGetTrainerAvailableHoursRequest(c.Server, params)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if c.RequestEditor != nil {
		err = c.RequestEditor(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	return c.Client.Do(req)
}
func (c *Client) MakeHourAvailableWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewMakeHourAvailableRequestWithBody(c.Server, contentType, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if c.RequestEditor != nil {
		err = c.RequestEditor(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	return c.Client.Do(req)
}
func (c *Client) MakeHourAvailable(ctx context.Context, body MakeHourAvailableJSONRequestBody) (*http.Response, error) {
	req, err := NewMakeHourAvailableRequest(c.Server, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if c.RequestEditor != nil {
		err = c.RequestEditor(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	return c.Client.Do(req)
}
func (c *Client) MakeHourUnavailableWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewMakeHourUnavailableRequestWithBody(c.Server, contentType, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if c.RequestEditor != nil {
		err = c.RequestEditor(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	return c.Client.Do(req)
}
func (c *Client) MakeHourUnavailable(ctx context.Context, body MakeHourUnavailableJSONRequestBody) (*http.Response, error) {
	req, err := NewMakeHourUnavailableRequest(c.Server, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if c.RequestEditor != nil {
		err = c.RequestEditor(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	return c.Client.Do(req)
}