Merged in feature/collectorset (pull request #96)

Set Collector

* set
This commit is contained in:
Michael McGuinness
2025-03-10 13:00:57 +00:00
parent 62886dbba8
commit ed8cfbbee4
35 changed files with 430 additions and 783 deletions
+32 -32
View File
@@ -106,8 +106,8 @@ type CollectorField struct {
QueryId openapi_types.UUID `json:"query_id"`
}
// CollectorUpdate Payload for updating a Collector.
type CollectorUpdate struct {
// CollectorSet Payload for updating a Collector.
type CollectorSet struct {
// ActiveVersion The active version of the collector.
ActiveVersion *int32 `json:"active_version,omitempty"`
@@ -274,8 +274,8 @@ type CreateClientJSONRequestBody = ClientCreate
// UpdateClientJSONRequestBody defines body for UpdateClient for application/json ContentType.
type UpdateClientJSONRequestBody = ClientUpdate
// UpdateCollectorByClientIdJSONRequestBody defines body for UpdateCollectorByClientId for application/json ContentType.
type UpdateCollectorByClientIdJSONRequestBody = CollectorUpdate
// SetCollectorByClientIdJSONRequestBody defines body for SetCollectorByClientId for application/json ContentType.
type SetCollectorByClientIdJSONRequestBody = CollectorSet
// TriggerExportJSONRequestBody defines body for TriggerExport for application/json ContentType.
type TriggerExportJSONRequestBody = ExportTrigger
@@ -378,10 +378,10 @@ type ClientInterface interface {
// GetCollectorByClientId request
GetCollectorByClientId(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
// UpdateCollectorByClientIdWithBody request with any body
UpdateCollectorByClientIdWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetCollectorByClientIdWithBody request with any body
SetCollectorByClientIdWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
UpdateCollectorByClientId(ctx context.Context, id openapi_types.UUID, body UpdateCollectorByClientIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
SetCollectorByClientId(ctx context.Context, id openapi_types.UUID, body SetCollectorByClientIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListDocumentsByClientId request
ListDocumentsByClientId(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
@@ -491,8 +491,8 @@ func (c *Client) GetCollectorByClientId(ctx context.Context, id openapi_types.UU
return c.Client.Do(req)
}
func (c *Client) UpdateCollectorByClientIdWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewUpdateCollectorByClientIdRequestWithBody(c.Server, id, contentType, body)
func (c *Client) SetCollectorByClientIdWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewSetCollectorByClientIdRequestWithBody(c.Server, id, contentType, body)
if err != nil {
return nil, err
}
@@ -503,8 +503,8 @@ func (c *Client) UpdateCollectorByClientIdWithBody(ctx context.Context, id opena
return c.Client.Do(req)
}
func (c *Client) UpdateCollectorByClientId(ctx context.Context, id openapi_types.UUID, body UpdateCollectorByClientIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewUpdateCollectorByClientIdRequest(c.Server, id, body)
func (c *Client) SetCollectorByClientId(ctx context.Context, id openapi_types.UUID, body SetCollectorByClientIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewSetCollectorByClientIdRequest(c.Server, id, body)
if err != nil {
return nil, err
}
@@ -826,19 +826,19 @@ func NewGetCollectorByClientIdRequest(server string, id openapi_types.UUID) (*ht
return req, nil
}
// NewUpdateCollectorByClientIdRequest calls the generic UpdateCollectorByClientId builder with application/json body
func NewUpdateCollectorByClientIdRequest(server string, id openapi_types.UUID, body UpdateCollectorByClientIdJSONRequestBody) (*http.Request, error) {
// NewSetCollectorByClientIdRequest calls the generic SetCollectorByClientId builder with application/json body
func NewSetCollectorByClientIdRequest(server string, id openapi_types.UUID, body SetCollectorByClientIdJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewUpdateCollectorByClientIdRequestWithBody(server, id, "application/json", bodyReader)
return NewSetCollectorByClientIdRequestWithBody(server, id, "application/json", bodyReader)
}
// NewUpdateCollectorByClientIdRequestWithBody generates requests for UpdateCollectorByClientId with any type of body
func NewUpdateCollectorByClientIdRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) {
// NewSetCollectorByClientIdRequestWithBody generates requests for SetCollectorByClientId with any type of body
func NewSetCollectorByClientIdRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) {
var err error
var pathParam0 string
@@ -1276,10 +1276,10 @@ type ClientWithResponsesInterface interface {
// GetCollectorByClientIdWithResponse request
GetCollectorByClientIdWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetCollectorByClientIdResponse, error)
// UpdateCollectorByClientIdWithBodyWithResponse request with any body
UpdateCollectorByClientIdWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateCollectorByClientIdResponse, error)
// SetCollectorByClientIdWithBodyWithResponse request with any body
SetCollectorByClientIdWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetCollectorByClientIdResponse, error)
UpdateCollectorByClientIdWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateCollectorByClientIdJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateCollectorByClientIdResponse, error)
SetCollectorByClientIdWithResponse(ctx context.Context, id openapi_types.UUID, body SetCollectorByClientIdJSONRequestBody, reqEditors ...RequestEditorFn) (*SetCollectorByClientIdResponse, error)
// ListDocumentsByClientIdWithResponse request
ListDocumentsByClientIdWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*ListDocumentsByClientIdResponse, error)
@@ -1404,13 +1404,13 @@ func (r GetCollectorByClientIdResponse) StatusCode() int {
return 0
}
type UpdateCollectorByClientIdResponse struct {
type SetCollectorByClientIdResponse struct {
Body []byte
HTTPResponse *http.Response
}
// Status returns HTTPResponse.Status
func (r UpdateCollectorByClientIdResponse) Status() string {
func (r SetCollectorByClientIdResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
@@ -1418,7 +1418,7 @@ func (r UpdateCollectorByClientIdResponse) Status() string {
}
// StatusCode returns HTTPResponse.StatusCode
func (r UpdateCollectorByClientIdResponse) StatusCode() int {
func (r SetCollectorByClientIdResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
@@ -1674,21 +1674,21 @@ func (c *ClientWithResponses) GetCollectorByClientIdWithResponse(ctx context.Con
return ParseGetCollectorByClientIdResponse(rsp)
}
// UpdateCollectorByClientIdWithBodyWithResponse request with arbitrary body returning *UpdateCollectorByClientIdResponse
func (c *ClientWithResponses) UpdateCollectorByClientIdWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateCollectorByClientIdResponse, error) {
rsp, err := c.UpdateCollectorByClientIdWithBody(ctx, id, contentType, body, reqEditors...)
// SetCollectorByClientIdWithBodyWithResponse request with arbitrary body returning *SetCollectorByClientIdResponse
func (c *ClientWithResponses) SetCollectorByClientIdWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetCollectorByClientIdResponse, error) {
rsp, err := c.SetCollectorByClientIdWithBody(ctx, id, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseUpdateCollectorByClientIdResponse(rsp)
return ParseSetCollectorByClientIdResponse(rsp)
}
func (c *ClientWithResponses) UpdateCollectorByClientIdWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateCollectorByClientIdJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateCollectorByClientIdResponse, error) {
rsp, err := c.UpdateCollectorByClientId(ctx, id, body, reqEditors...)
func (c *ClientWithResponses) SetCollectorByClientIdWithResponse(ctx context.Context, id openapi_types.UUID, body SetCollectorByClientIdJSONRequestBody, reqEditors ...RequestEditorFn) (*SetCollectorByClientIdResponse, error) {
rsp, err := c.SetCollectorByClientId(ctx, id, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseUpdateCollectorByClientIdResponse(rsp)
return ParseSetCollectorByClientIdResponse(rsp)
}
// ListDocumentsByClientIdWithResponse request returning *ListDocumentsByClientIdResponse
@@ -1898,15 +1898,15 @@ func ParseGetCollectorByClientIdResponse(rsp *http.Response) (*GetCollectorByCli
return response, nil
}
// ParseUpdateCollectorByClientIdResponse parses an HTTP response from a UpdateCollectorByClientIdWithResponse call
func ParseUpdateCollectorByClientIdResponse(rsp *http.Response) (*UpdateCollectorByClientIdResponse, error) {
// ParseSetCollectorByClientIdResponse parses an HTTP response from a SetCollectorByClientIdWithResponse call
func ParseSetCollectorByClientIdResponse(rsp *http.Response) (*SetCollectorByClientIdResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &UpdateCollectorByClientIdResponse{
response := &SetCollectorByClientIdResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}