func NewGetServiceJobByServiceJobIdRequest(endpoint string, serviceJobId string) (*http.Request, error) {
	var err error
	var pathParam0 string
	pathParam0, err = runtime.StyleParam("simple", false, "serviceJobId", serviceJobId)
	if err != nil {
		return nil, err
	}
	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}
	basePath := fmt.Sprintf("/service/v1/serviceJobs/%s", pathParam0)
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}
	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}
	req, err := http.NewRequest("GET", queryUrl.String(), nil)
	if err != nil {
		return nil, err
	}
	return req, nil
}
NewGetServiceJobByServiceJobIdRequest generates requests for GetServiceJobByServiceJobId
package service
import (
	"bytes"
	"context"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"net/url"
	runt "runtime"
	"strings"
	"gopkg.me/selling-partner-api-sdk/pkg/runtime"
)
type RequestBeforeFn func(ctx context.Context, req *http.Request) error
type ResponseAfterFn func(ctx context.Context, rsp *http.Response) error
type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}
type Client struct {
	Endpoint string
	Client HttpRequestDoer
	RequestBefore RequestBeforeFn
	ResponseAfter ResponseAfterFn
	UserAgent string
}
type ClientOption func(*Client) error
func NewClient(endpoint string, opts ...ClientOption) (*Client, error) {
	client := Client{
		Endpoint: endpoint,
	}
	for _, o := range opts {
		if err := o(&client); err != nil {
			return nil, err
		}
	}
	if !strings.HasSuffix(client.Endpoint, "/") {
		client.Endpoint += "/"
	}
	if client.Client == nil {
		client.Client = http.DefaultClient
	}
	if client.UserAgent == "" {
		client.UserAgent = fmt.Sprintf("selling-partner-api-sdk/v1.0 (Language=%s; Platform=%s-%s)", strings.Replace(runt.Version(), "go", "go/", -1), runt.GOOS, runt.GOARCH)
	}
	return &client, nil
}
func WithHTTPClient(doer HttpRequestDoer) ClientOption {
	return func(c *Client) error {
		c.Client = doer
		return nil
	}
}
func WithUserAgent(userAgent string) ClientOption {
	return func(c *Client) error {
		c.UserAgent = userAgent
		return nil
	}
}
func WithRequestBefore(fn RequestBeforeFn) ClientOption {
	return func(c *Client) error {
		c.RequestBefore = fn
		return nil
	}
}
func WithResponseAfter(fn ResponseAfterFn) ClientOption {
	return func(c *Client) error {
		c.ResponseAfter = fn
		return nil
	}
}
type ClientInterface interface {
	GetServiceJobs(ctx context.Context, params *GetServiceJobsParams) (*http.Response, error)
	GetServiceJobByServiceJobId(ctx context.Context, serviceJobId string) (*http.Response, error)
	AddAppointmentForServiceJobByServiceJobIdWithBody(ctx context.Context, serviceJobId string, contentType string, body io.Reader) (*http.Response, error)
	AddAppointmentForServiceJobByServiceJobId(ctx context.Context, serviceJobId string, body AddAppointmentForServiceJobByServiceJobIdJSONRequestBody) (*http.Response, error)
	RescheduleAppointmentForServiceJobByServiceJobIdWithBody(ctx context.Context, serviceJobId string, appointmentId string, contentType string, body io.Reader) (*http.Response, error)
	RescheduleAppointmentForServiceJobByServiceJobId(ctx context.Context, serviceJobId string, appointmentId string, body RescheduleAppointmentForServiceJobByServiceJobIdJSONRequestBody) (*http.Response, error)
	CancelServiceJobByServiceJobId(ctx context.Context, serviceJobId string, params *CancelServiceJobByServiceJobIdParams) (*http.Response, error)
	CompleteServiceJobByServiceJobId(ctx context.Context, serviceJobId string) (*http.Response, error)
}
func (c *Client) GetServiceJobs(ctx context.Context, params *GetServiceJobsParams) (*http.Response, error) {
	req, err := NewGetServiceJobsRequest(c.Endpoint, params)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	req.Header.Set("User-Agent", c.UserAgent)
	if c.RequestBefore != nil {
		err = c.RequestBefore(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	rsp, err := c.Client.Do(req)
	if err != nil {
		return nil, err
	}
	if c.ResponseAfter != nil {
		err = c.ResponseAfter(ctx, rsp)
		if err != nil {
			return nil, err
		}
	}
	return rsp, nil
}
func (c *Client) GetServiceJobByServiceJobId(ctx context.Context, serviceJobId string) (*http.Response, error) {
	req, err := NewGetServiceJobByServiceJobIdRequest(c.Endpoint, serviceJobId)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	req.Header.Set("User-Agent", c.UserAgent)
	if c.RequestBefore != nil {
		err = c.RequestBefore(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	rsp, err := c.Client.Do(req)
	if err != nil {
		return nil, err
	}
	if c.ResponseAfter != nil {
		err = c.ResponseAfter(ctx, rsp)
		if err != nil {
			return nil, err
		}
	}
	return rsp, nil
}
func (c *Client) AddAppointmentForServiceJobByServiceJobIdWithBody(ctx context.Context, serviceJobId string, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewAddAppointmentForServiceJobByServiceJobIdRequestWithBody(c.Endpoint, serviceJobId, contentType, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	req.Header.Set("User-Agent", c.UserAgent)
	if c.RequestBefore != nil {
		err = c.RequestBefore(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	rsp, err := c.Client.Do(req)
	if err != nil {
		return nil, err
	}
	if c.ResponseAfter != nil {
		err = c.ResponseAfter(ctx, rsp)
		if err != nil {
			return nil, err
		}
	}
	return rsp, nil
}
func (c *Client) AddAppointmentForServiceJobByServiceJobId(ctx context.Context, serviceJobId string, body AddAppointmentForServiceJobByServiceJobIdJSONRequestBody) (*http.Response, error) {
	req, err := NewAddAppointmentForServiceJobByServiceJobIdRequest(c.Endpoint, serviceJobId, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if c.RequestBefore != nil {
		err = c.RequestBefore(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	return c.Client.Do(req)
}
func (c *Client) RescheduleAppointmentForServiceJobByServiceJobIdWithBody(ctx context.Context, serviceJobId string, appointmentId string, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewRescheduleAppointmentForServiceJobByServiceJobIdRequestWithBody(c.Endpoint, serviceJobId, appointmentId, contentType, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	req.Header.Set("User-Agent", c.UserAgent)
	if c.RequestBefore != nil {
		err = c.RequestBefore(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	rsp, err := c.Client.Do(req)
	if err != nil {
		return nil, err
	}
	if c.ResponseAfter != nil {
		err = c.ResponseAfter(ctx, rsp)
		if err != nil {
			return nil, err
		}
	}
	return rsp, nil
}
func (c *Client) RescheduleAppointmentForServiceJobByServiceJobId(ctx context.Context, serviceJobId string, appointmentId string, body RescheduleAppointmentForServiceJobByServiceJobIdJSONRequestBody) (*http.Response, error) {
	req, err := NewRescheduleAppointmentForServiceJobByServiceJobIdRequest(c.Endpoint, serviceJobId, appointmentId, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if c.RequestBefore != nil {
		err = c.RequestBefore(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	return c.Client.Do(req)
}
func (c *Client) CancelServiceJobByServiceJobId(ctx context.Context, serviceJobId string, params *CancelServiceJobByServiceJobIdParams) (*http.Response, error) {
	req, err := NewCancelServiceJobByServiceJobIdRequest(c.Endpoint, serviceJobId, params)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	req.Header.Set("User-Agent", c.UserAgent)
	if c.RequestBefore != nil {
		err = c.RequestBefore(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	rsp, err := c.Client.Do(req)
	if err != nil {
		return nil, err
	}
	if c.ResponseAfter != nil {
		err = c.ResponseAfter(ctx, rsp)
		if err != nil {
			return nil, err
		}
	}
	return rsp, nil
}
func (c *Client) CompleteServiceJobByServiceJobId(ctx context.Context, serviceJobId string) (*http.Response, error) {
	req, err := NewCompleteServiceJobByServiceJobIdRequest(c.Endpoint, serviceJobId)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	req.Header.Set("User-Agent", c.UserAgent)
	if c.RequestBefore != nil {
		err = c.RequestBefore(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	rsp, err := c.Client.Do(req)
	if err != nil {
		return nil, err
	}
	if c.ResponseAfter != nil {
		err = c.ResponseAfter(ctx, rsp)
		if err != nil {
			return nil, err
		}
	}
	return rsp, nil
}
func NewGetServiceJobsRequest(endpoint string, params *GetServiceJobsParams) (*http.Request, error) {
	var err error
	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}
	basePath := fmt.Sprintf("/service/v1/serviceJobs")
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}
	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}
	queryValues := queryUrl.Query()
	if params.ServiceOrderIds != nil {
		if queryFrag, err := runtime.StyleParam("form", true, "serviceOrderIds", *params.ServiceOrderIds); 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 params.ServiceJobStatus != nil {
		if queryFrag, err := runtime.StyleParam("form", true, "serviceJobStatus", *params.ServiceJobStatus); 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 params.PageToken != nil {
		if queryFrag, err := runtime.StyleParam("form", true, "pageToken", *params.PageToken); 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 params.PageSize != nil {
		if queryFrag, err := runtime.StyleParam("form", true, "pageSize", *params.PageSize); 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 params.SortField != nil {
		if queryFrag, err := runtime.StyleParam("form", true, "sortField", *params.SortField); 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 params.SortOrder != nil {
		if queryFrag, err := runtime.StyleParam("form", true, "sortOrder", *params.SortOrder); 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 params.CreatedAfter != nil {
		if queryFrag, err := runtime.StyleParam("form", true, "createdAfter", *params.CreatedAfter); 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 params.CreatedBefore != nil {
		if queryFrag, err := runtime.StyleParam("form", true, "createdBefore", *params.CreatedBefore); 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 params.LastUpdatedAfter != nil {
		if queryFrag, err := runtime.StyleParam("form", true, "lastUpdatedAfter", *params.LastUpdatedAfter); 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 params.LastUpdatedBefore != nil {
		if queryFrag, err := runtime.StyleParam("form", true, "lastUpdatedBefore", *params.LastUpdatedBefore); 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 params.ScheduleStartDate != nil {
		if queryFrag, err := runtime.StyleParam("form", true, "scheduleStartDate", *params.ScheduleStartDate); 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 params.ScheduleEndDate != nil {
		if queryFrag, err := runtime.StyleParam("form", true, "scheduleEndDate", *params.ScheduleEndDate); 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, "marketplaceIds", params.MarketplaceIds); 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
}