Merged in feature/e2etest (pull request #74)
Feature/e2etest * e2etest * testcleanups
This commit is contained in:
@@ -63,6 +63,18 @@ type ClientUpdate struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
// Document defines model for Document.
|
||||
type Document struct {
|
||||
// Bucket The bucket containing the document
|
||||
Bucket string `json:"bucket"`
|
||||
|
||||
// Id The document id
|
||||
Id openapi_types.UUID `json:"id"`
|
||||
|
||||
// Key The path to the document
|
||||
Key string `json:"key"`
|
||||
}
|
||||
|
||||
// ExportDetails Payload for export trigger response.
|
||||
type ExportDetails struct {
|
||||
// JobId The job id relative to the export.
|
||||
@@ -204,6 +216,9 @@ type JobUpdate struct {
|
||||
CanSync *bool `json:"can_sync,omitempty"`
|
||||
}
|
||||
|
||||
// ListDocuments The documents in the job.
|
||||
type ListDocuments = []Document
|
||||
|
||||
// ListQueries defines model for ListQueries.
|
||||
type ListQueries struct {
|
||||
// Queries List of queries.
|
||||
@@ -412,6 +427,9 @@ type ClientInterface interface {
|
||||
|
||||
UpdateJobCollectorByJobId(ctx context.Context, id openapi_types.UUID, body UpdateJobCollectorByJobIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
// ListDocumentsByJobId request
|
||||
ListDocumentsByJobId(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
// ExportState request
|
||||
ExportState(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
@@ -617,6 +635,18 @@ func (c *Client) UpdateJobCollectorByJobId(ctx context.Context, id openapi_types
|
||||
return c.Client.Do(req)
|
||||
}
|
||||
|
||||
func (c *Client) ListDocumentsByJobId(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewListDocumentsByJobIdRequest(c.Server, id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req = req.WithContext(ctx)
|
||||
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return c.Client.Do(req)
|
||||
}
|
||||
|
||||
func (c *Client) ExportState(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewExportStateRequest(c.Server, id)
|
||||
if err != nil {
|
||||
@@ -1088,6 +1118,40 @@ func NewUpdateJobCollectorByJobIdRequestWithBody(server string, id openapi_types
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// NewListDocumentsByJobIdRequest generates requests for ListDocumentsByJobId
|
||||
func NewListDocumentsByJobIdRequest(server string, id openapi_types.UUID) (*http.Request, error) {
|
||||
var err error
|
||||
|
||||
var pathParam0 string
|
||||
|
||||
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
serverURL, err := url.Parse(server)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
operationPath := fmt.Sprintf("/job/%s/documents", pathParam0)
|
||||
if operationPath[0] == '/' {
|
||||
operationPath = "." + operationPath
|
||||
}
|
||||
|
||||
queryURL, err := serverURL.Parse(operationPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// NewExportStateRequest generates requests for ExportState
|
||||
func NewExportStateRequest(server string, id openapi_types.UUID) (*http.Request, error) {
|
||||
var err error
|
||||
@@ -1399,6 +1463,9 @@ type ClientWithResponsesInterface interface {
|
||||
|
||||
UpdateJobCollectorByJobIdWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateJobCollectorByJobIdJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateJobCollectorByJobIdResponse, error)
|
||||
|
||||
// ListDocumentsByJobIdWithResponse request
|
||||
ListDocumentsByJobIdWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*ListDocumentsByJobIdResponse, error)
|
||||
|
||||
// ExportStateWithResponse request
|
||||
ExportStateWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*ExportStateResponse, error)
|
||||
|
||||
@@ -1619,6 +1686,28 @@ func (r UpdateJobCollectorByJobIdResponse) StatusCode() int {
|
||||
return 0
|
||||
}
|
||||
|
||||
type ListDocumentsByJobIdResponse struct {
|
||||
Body []byte
|
||||
HTTPResponse *http.Response
|
||||
JSON200 *ListDocuments
|
||||
}
|
||||
|
||||
// Status returns HTTPResponse.Status
|
||||
func (r ListDocumentsByJobIdResponse) Status() string {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.Status
|
||||
}
|
||||
return http.StatusText(0)
|
||||
}
|
||||
|
||||
// StatusCode returns HTTPResponse.StatusCode
|
||||
func (r ListDocumentsByJobIdResponse) StatusCode() int {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.StatusCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type ExportStateResponse struct {
|
||||
Body []byte
|
||||
HTTPResponse *http.Response
|
||||
@@ -1879,6 +1968,15 @@ func (c *ClientWithResponses) UpdateJobCollectorByJobIdWithResponse(ctx context.
|
||||
return ParseUpdateJobCollectorByJobIdResponse(rsp)
|
||||
}
|
||||
|
||||
// ListDocumentsByJobIdWithResponse request returning *ListDocumentsByJobIdResponse
|
||||
func (c *ClientWithResponses) ListDocumentsByJobIdWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*ListDocumentsByJobIdResponse, error) {
|
||||
rsp, err := c.ListDocumentsByJobId(ctx, id, reqEditors...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ParseListDocumentsByJobIdResponse(rsp)
|
||||
}
|
||||
|
||||
// ExportStateWithResponse request returning *ExportStateResponse
|
||||
func (c *ClientWithResponses) ExportStateWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*ExportStateResponse, error) {
|
||||
rsp, err := c.ExportState(ctx, id, reqEditors...)
|
||||
@@ -2161,6 +2259,32 @@ func ParseUpdateJobCollectorByJobIdResponse(rsp *http.Response) (*UpdateJobColle
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// ParseListDocumentsByJobIdResponse parses an HTTP response from a ListDocumentsByJobIdWithResponse call
|
||||
func ParseListDocumentsByJobIdResponse(rsp *http.Response) (*ListDocumentsByJobIdResponse, error) {
|
||||
bodyBytes, err := io.ReadAll(rsp.Body)
|
||||
defer func() { _ = rsp.Body.Close() }()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
response := &ListDocumentsByJobIdResponse{
|
||||
Body: bodyBytes,
|
||||
HTTPResponse: rsp,
|
||||
}
|
||||
|
||||
switch {
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
||||
var dest ListDocuments
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON200 = &dest
|
||||
|
||||
}
|
||||
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// ParseExportStateResponse parses an HTTP response from a ExportStateWithResponse call
|
||||
func ParseExportStateResponse(rsp *http.Response) (*ExportStateResponse, error) {
|
||||
bodyBytes, err := io.ReadAll(rsp.Body)
|
||||
|
||||
Reference in New Issue
Block a user