func (t *BasicAuthTransport) RoundTrip(req *http.Request) (*http.Response, error) {
	req = cloneRequest(req)  
	req.SetBasicAuth(t.Username, t.Password)
	return t.transport().RoundTrip(req)
}
RoundTrip implements the RoundTripper interface.
package velobike
import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"net/url"
)
type Client struct {
	client *http.Client
	BaseURL *url.URL
	Parkings      *ParkingsService
	Authorization *AuthorizeService
	Profile       *ProfileService
	History       *HistoryService
	SessionID *string
}
func NewClient(opts ...ClientOption) *Client {
	o := &ClientOptions{}
	for _, opt := range opts {
		opt(o)
	}
	if o.client == nil {
		o.client = http.DefaultClient
	}
	if o.baseURL == "" {
		o.baseURL = defaultURL
	}
	baseURL, _ := url.Parse(o.baseURL)
	c := &Client{client: o.client, BaseURL: baseURL}
	c.Parkings = &ParkingsService{client: c}
	c.Authorization = &AuthorizeService{client: c}
	c.Profile = &ProfileService{client: c}
	c.History = &HistoryService{client: c}
	return c
}
func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error) {
	rel, err := url.Parse(urlStr)
	if err != nil {
		return nil, err
	}
	u := c.BaseURL.ResolveReference(rel)
	var buf io.ReadWriter
	if body != nil {
		buf = new(bytes.Buffer)
		err := json.NewEncoder(buf).Encode(body)
		if err != nil {
			return nil, err
		}
	}
	req, err := http.NewRequest(method, u.String(), buf)
	if err != nil {
		return nil, err
	}
	req.Header.Add("App-Version", "1.3")
	if c.SessionID != nil {
		req.Header.Add("SessionID", *c.SessionID)
	}
	return req, nil
}
type Response struct {
	*http.Response
}
func newResponse(r *http.Response) *Response {
	response := &Response{Response: r}
	return response
}
func (c *Client) Do(req *http.Request, v interface{}) (*Response, error) {
	resp, err := c.client.Do(req)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	response := newResponse(resp)
	var buf bytes.Buffer
	body := io.TeeReader(resp.Body, &buf)
	err = CheckResponse(resp, body)
	if err != nil {
		return response, err
	}
	if v != nil {
		if w, ok := v.(io.Writer); ok {
			_, err = io.Copy(w, &buf)
			if err != nil {
				return response, err
			}
		} else {
			err = json.NewDecoder(&buf).Decode(v)
			if err == io.EOF {
				err = nil  
			}
		}
	}
	return response, err
}
type BasicAuthTransport struct {
	Username string  
	Password string  
	Transport http.RoundTripper
}
func (t *BasicAuthTransport) Client() *http.Client {
	return &http.Client{Transport: t}
}
func (t *BasicAuthTransport) transport() http.RoundTripper {
	if t.Transport != nil {
		return t.Transport
	}
	return http.DefaultTransport
}