+149
-145
@@ -103,9 +103,6 @@ type ExportTrigger struct {
|
||||
// StartDate This first date of ingestion.
|
||||
StartDate *string `json:"start_date,omitempty"`
|
||||
} `json:"ingestion_filters,omitempty"`
|
||||
|
||||
// JobId The job id of the query results to be exported.
|
||||
JobId openapi_types.UUID `json:"job_id"`
|
||||
}
|
||||
|
||||
// FieldFilter Filtering a column
|
||||
@@ -303,15 +300,15 @@ type UpdateClientJSONRequestBody = ClientUpdate
|
||||
// CreateJobJSONRequestBody defines body for CreateJob for application/json ContentType.
|
||||
type CreateJobJSONRequestBody = JobCreate
|
||||
|
||||
// TriggerExportJSONRequestBody defines body for TriggerExport for application/json ContentType.
|
||||
type TriggerExportJSONRequestBody = ExportTrigger
|
||||
|
||||
// UpdateJobJSONRequestBody defines body for UpdateJob for application/json ContentType.
|
||||
type UpdateJobJSONRequestBody = JobUpdate
|
||||
|
||||
// UpdateJobCollectorByJobIdJSONRequestBody defines body for UpdateJobCollectorByJobId for application/json ContentType.
|
||||
type UpdateJobCollectorByJobIdJSONRequestBody = JobCollectorUpdate
|
||||
|
||||
// TriggerExportJSONRequestBody defines body for TriggerExport for application/json ContentType.
|
||||
type TriggerExportJSONRequestBody = ExportTrigger
|
||||
|
||||
// CreateQueryJSONRequestBody defines body for CreateQuery for application/json ContentType.
|
||||
type CreateQueryJSONRequestBody = QueryCreate
|
||||
|
||||
@@ -412,11 +409,6 @@ type ClientInterface interface {
|
||||
|
||||
CreateJob(ctx context.Context, body CreateJobJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
// TriggerExportWithBody request with any body
|
||||
TriggerExportWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
TriggerExport(ctx context.Context, body TriggerExportJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
// GetJob request
|
||||
GetJob(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
@@ -439,6 +431,11 @@ type ClientInterface interface {
|
||||
// ExportState request
|
||||
ExportState(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
// TriggerExportWithBody request with any body
|
||||
TriggerExportWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
TriggerExport(ctx context.Context, id openapi_types.UUID, body TriggerExportJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
// GetJobStatusByJobId request
|
||||
GetJobStatusByJobId(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
|
||||
|
||||
@@ -548,30 +545,6 @@ func (c *Client) CreateJob(ctx context.Context, body CreateJobJSONRequestBody, r
|
||||
return c.Client.Do(req)
|
||||
}
|
||||
|
||||
func (c *Client) TriggerExportWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewTriggerExportRequestWithBody(c.Server, contentType, body)
|
||||
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) TriggerExport(ctx context.Context, body TriggerExportJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewTriggerExportRequest(c.Server, body)
|
||||
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) GetJob(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewGetJobRequest(c.Server, id)
|
||||
if err != nil {
|
||||
@@ -668,6 +641,30 @@ func (c *Client) ExportState(ctx context.Context, id openapi_types.UUID, reqEdit
|
||||
return c.Client.Do(req)
|
||||
}
|
||||
|
||||
func (c *Client) TriggerExportWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewTriggerExportRequestWithBody(c.Server, id, contentType, body)
|
||||
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) TriggerExport(ctx context.Context, id openapi_types.UUID, body TriggerExportJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewTriggerExportRequest(c.Server, id, body)
|
||||
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) GetJobStatusByJobId(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
||||
req, err := NewGetJobStatusByJobIdRequest(c.Server, id)
|
||||
if err != nil {
|
||||
@@ -937,46 +934,6 @@ func NewCreateJobRequestWithBody(server string, contentType string, body io.Read
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// NewTriggerExportRequest calls the generic TriggerExport builder with application/json body
|
||||
func NewTriggerExportRequest(server string, body TriggerExportJSONRequestBody) (*http.Request, error) {
|
||||
var bodyReader io.Reader
|
||||
buf, err := json.Marshal(body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
bodyReader = bytes.NewReader(buf)
|
||||
return NewTriggerExportRequestWithBody(server, "application/json", bodyReader)
|
||||
}
|
||||
|
||||
// NewTriggerExportRequestWithBody generates requests for TriggerExport with any type of body
|
||||
func NewTriggerExportRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
|
||||
var err error
|
||||
|
||||
serverURL, err := url.Parse(server)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
operationPath := fmt.Sprintf("/job/export")
|
||||
if operationPath[0] == '/' {
|
||||
operationPath = "." + operationPath
|
||||
}
|
||||
|
||||
queryURL, err := serverURL.Parse(operationPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req, err := http.NewRequest("POST", queryURL.String(), body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req.Header.Add("Content-Type", contentType)
|
||||
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// NewGetJobRequest generates requests for GetJob
|
||||
func NewGetJobRequest(server string, id openapi_types.UUID) (*http.Request, error) {
|
||||
var err error
|
||||
@@ -1207,6 +1164,53 @@ func NewExportStateRequest(server string, id openapi_types.UUID) (*http.Request,
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// NewTriggerExportRequest calls the generic TriggerExport builder with application/json body
|
||||
func NewTriggerExportRequest(server string, id openapi_types.UUID, body TriggerExportJSONRequestBody) (*http.Request, error) {
|
||||
var bodyReader io.Reader
|
||||
buf, err := json.Marshal(body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
bodyReader = bytes.NewReader(buf)
|
||||
return NewTriggerExportRequestWithBody(server, id, "application/json", bodyReader)
|
||||
}
|
||||
|
||||
// NewTriggerExportRequestWithBody generates requests for TriggerExport with any type of body
|
||||
func NewTriggerExportRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*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/export", pathParam0)
|
||||
if operationPath[0] == '/' {
|
||||
operationPath = "." + operationPath
|
||||
}
|
||||
|
||||
queryURL, err := serverURL.Parse(operationPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req, err := http.NewRequest("POST", queryURL.String(), body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req.Header.Add("Content-Type", contentType)
|
||||
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// NewGetJobStatusByJobIdRequest generates requests for GetJobStatusByJobId
|
||||
func NewGetJobStatusByJobIdRequest(server string, id openapi_types.UUID) (*http.Request, error) {
|
||||
var err error
|
||||
@@ -1497,11 +1501,6 @@ type ClientWithResponsesInterface interface {
|
||||
|
||||
CreateJobWithResponse(ctx context.Context, body CreateJobJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateJobResponse, error)
|
||||
|
||||
// TriggerExportWithBodyWithResponse request with any body
|
||||
TriggerExportWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TriggerExportResponse, error)
|
||||
|
||||
TriggerExportWithResponse(ctx context.Context, body TriggerExportJSONRequestBody, reqEditors ...RequestEditorFn) (*TriggerExportResponse, error)
|
||||
|
||||
// GetJobWithResponse request
|
||||
GetJobWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetJobResponse, error)
|
||||
|
||||
@@ -1524,6 +1523,11 @@ type ClientWithResponsesInterface interface {
|
||||
// ExportStateWithResponse request
|
||||
ExportStateWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*ExportStateResponse, error)
|
||||
|
||||
// TriggerExportWithBodyWithResponse request with any body
|
||||
TriggerExportWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TriggerExportResponse, error)
|
||||
|
||||
TriggerExportWithResponse(ctx context.Context, id openapi_types.UUID, body TriggerExportJSONRequestBody, reqEditors ...RequestEditorFn) (*TriggerExportResponse, error)
|
||||
|
||||
// GetJobStatusByJobIdWithResponse request
|
||||
GetJobStatusByJobIdWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetJobStatusByJobIdResponse, error)
|
||||
|
||||
@@ -1636,28 +1640,6 @@ func (r CreateJobResponse) StatusCode() int {
|
||||
return 0
|
||||
}
|
||||
|
||||
type TriggerExportResponse struct {
|
||||
Body []byte
|
||||
HTTPResponse *http.Response
|
||||
JSON201 *IdMessage
|
||||
}
|
||||
|
||||
// Status returns HTTPResponse.Status
|
||||
func (r TriggerExportResponse) Status() string {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.Status
|
||||
}
|
||||
return http.StatusText(0)
|
||||
}
|
||||
|
||||
// StatusCode returns HTTPResponse.StatusCode
|
||||
func (r TriggerExportResponse) StatusCode() int {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.StatusCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type GetJobResponse struct {
|
||||
Body []byte
|
||||
HTTPResponse *http.Response
|
||||
@@ -1788,6 +1770,28 @@ func (r ExportStateResponse) StatusCode() int {
|
||||
return 0
|
||||
}
|
||||
|
||||
type TriggerExportResponse struct {
|
||||
Body []byte
|
||||
HTTPResponse *http.Response
|
||||
JSON201 *IdMessage
|
||||
}
|
||||
|
||||
// Status returns HTTPResponse.Status
|
||||
func (r TriggerExportResponse) Status() string {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.Status
|
||||
}
|
||||
return http.StatusText(0)
|
||||
}
|
||||
|
||||
// StatusCode returns HTTPResponse.StatusCode
|
||||
func (r TriggerExportResponse) StatusCode() int {
|
||||
if r.HTTPResponse != nil {
|
||||
return r.HTTPResponse.StatusCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type GetJobStatusByJobIdResponse struct {
|
||||
Body []byte
|
||||
HTTPResponse *http.Response
|
||||
@@ -1979,23 +1983,6 @@ func (c *ClientWithResponses) CreateJobWithResponse(ctx context.Context, body Cr
|
||||
return ParseCreateJobResponse(rsp)
|
||||
}
|
||||
|
||||
// TriggerExportWithBodyWithResponse request with arbitrary body returning *TriggerExportResponse
|
||||
func (c *ClientWithResponses) TriggerExportWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TriggerExportResponse, error) {
|
||||
rsp, err := c.TriggerExportWithBody(ctx, contentType, body, reqEditors...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ParseTriggerExportResponse(rsp)
|
||||
}
|
||||
|
||||
func (c *ClientWithResponses) TriggerExportWithResponse(ctx context.Context, body TriggerExportJSONRequestBody, reqEditors ...RequestEditorFn) (*TriggerExportResponse, error) {
|
||||
rsp, err := c.TriggerExport(ctx, body, reqEditors...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ParseTriggerExportResponse(rsp)
|
||||
}
|
||||
|
||||
// GetJobWithResponse request returning *GetJobResponse
|
||||
func (c *ClientWithResponses) GetJobWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetJobResponse, error) {
|
||||
rsp, err := c.GetJob(ctx, id, reqEditors...)
|
||||
@@ -2066,6 +2053,23 @@ func (c *ClientWithResponses) ExportStateWithResponse(ctx context.Context, id op
|
||||
return ParseExportStateResponse(rsp)
|
||||
}
|
||||
|
||||
// TriggerExportWithBodyWithResponse request with arbitrary body returning *TriggerExportResponse
|
||||
func (c *ClientWithResponses) TriggerExportWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TriggerExportResponse, error) {
|
||||
rsp, err := c.TriggerExportWithBody(ctx, id, contentType, body, reqEditors...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ParseTriggerExportResponse(rsp)
|
||||
}
|
||||
|
||||
func (c *ClientWithResponses) TriggerExportWithResponse(ctx context.Context, id openapi_types.UUID, body TriggerExportJSONRequestBody, reqEditors ...RequestEditorFn) (*TriggerExportResponse, error) {
|
||||
rsp, err := c.TriggerExport(ctx, id, body, reqEditors...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return ParseTriggerExportResponse(rsp)
|
||||
}
|
||||
|
||||
// GetJobStatusByJobIdWithResponse request returning *GetJobStatusByJobIdResponse
|
||||
func (c *ClientWithResponses) GetJobStatusByJobIdWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetJobStatusByJobIdResponse, error) {
|
||||
rsp, err := c.GetJobStatusByJobId(ctx, id, reqEditors...)
|
||||
@@ -2238,32 +2242,6 @@ func ParseCreateJobResponse(rsp *http.Response) (*CreateJobResponse, error) {
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// ParseTriggerExportResponse parses an HTTP response from a TriggerExportWithResponse call
|
||||
func ParseTriggerExportResponse(rsp *http.Response) (*TriggerExportResponse, error) {
|
||||
bodyBytes, err := io.ReadAll(rsp.Body)
|
||||
defer func() { _ = rsp.Body.Close() }()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
response := &TriggerExportResponse{
|
||||
Body: bodyBytes,
|
||||
HTTPResponse: rsp,
|
||||
}
|
||||
|
||||
switch {
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201:
|
||||
var dest IdMessage
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON201 = &dest
|
||||
|
||||
}
|
||||
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// ParseGetJobResponse parses an HTTP response from a GetJobWithResponse call
|
||||
func ParseGetJobResponse(rsp *http.Response) (*GetJobResponse, error) {
|
||||
bodyBytes, err := io.ReadAll(rsp.Body)
|
||||
@@ -2400,6 +2378,32 @@ func ParseExportStateResponse(rsp *http.Response) (*ExportStateResponse, error)
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// ParseTriggerExportResponse parses an HTTP response from a TriggerExportWithResponse call
|
||||
func ParseTriggerExportResponse(rsp *http.Response) (*TriggerExportResponse, error) {
|
||||
bodyBytes, err := io.ReadAll(rsp.Body)
|
||||
defer func() { _ = rsp.Body.Close() }()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
response := &TriggerExportResponse{
|
||||
Body: bodyBytes,
|
||||
HTTPResponse: rsp,
|
||||
}
|
||||
|
||||
switch {
|
||||
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201:
|
||||
var dest IdMessage
|
||||
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response.JSON201 = &dest
|
||||
|
||||
}
|
||||
|
||||
return response, nil
|
||||
}
|
||||
|
||||
// ParseGetJobStatusByJobIdResponse parses an HTTP response from a GetJobStatusByJobIdWithResponse call
|
||||
func ParseGetJobStatusByJobIdResponse(rsp *http.Response) (*GetJobStatusByJobIdResponse, error) {
|
||||
bodyBytes, err := io.ReadAll(rsp.Body)
|
||||
|
||||
Reference in New Issue
Block a user