From 655244bec5f253915ea1537fdbdb8510d0ae57f7 Mon Sep 17 00:00:00 2001 From: Simon Lukasik Date: Thu, 21 Oct 2021 12:34:43 +0200 Subject: [PATCH] Re-generate the codebase using the latest swagger --- .../report_executions_client.go | 39 ++ .../report_executions_retry_parameters.go | 195 +++++++++ .../report_executions_retry_responses.go | 414 ++++++++++++++++++ falcon/models/api_execution_metadata_v1.go | 139 ++++++ .../api_report_execution_retry_request_v1.go | 71 +++ falcon/models/api_report_execution_v1.go | 111 ++--- falcon/models/domain_result_metadata.go | 100 +++++ 7 files changed, 1017 insertions(+), 52 deletions(-) create mode 100644 falcon/client/report_executions/report_executions_retry_parameters.go create mode 100644 falcon/client/report_executions/report_executions_retry_responses.go create mode 100644 falcon/models/api_execution_metadata_v1.go create mode 100644 falcon/models/api_report_execution_retry_request_v1.go diff --git a/falcon/client/report_executions/report_executions_client.go b/falcon/client/report_executions/report_executions_client.go index 068bd164..5cc6b86e 100644 --- a/falcon/client/report_executions/report_executions_client.go +++ b/falcon/client/report_executions/report_executions_client.go @@ -34,6 +34,8 @@ type ClientService interface { ReportExecutionsQuery(params *ReportExecutionsQueryParams, opts ...ClientOption) (*ReportExecutionsQueryOK, error) + ReportExecutionsRetry(params *ReportExecutionsRetryParams, opts ...ClientOption) (*ReportExecutionsRetryOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -148,6 +150,43 @@ func (a *Client) ReportExecutionsQuery(params *ReportExecutionsQueryParams, opts return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* + ReportExecutionsRetry this endpoint will be used to retry report executions +*/ +func (a *Client) ReportExecutionsRetry(params *ReportExecutionsRetryParams, opts ...ClientOption) (*ReportExecutionsRetryOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReportExecutionsRetryParams() + } + op := &runtime.ClientOperation{ + ID: "report-executions.retry", + Method: "POST", + PathPattern: "/reports/entities/report-executions-retry/v1", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"https"}, + Params: params, + Reader: &ReportExecutionsRetryReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ReportExecutionsRetryOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ReportExecutionsRetryDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/falcon/client/report_executions/report_executions_retry_parameters.go b/falcon/client/report_executions/report_executions_retry_parameters.go new file mode 100644 index 00000000..29158d04 --- /dev/null +++ b/falcon/client/report_executions/report_executions_retry_parameters.go @@ -0,0 +1,195 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package report_executions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// NewReportExecutionsRetryParams creates a new ReportExecutionsRetryParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReportExecutionsRetryParams() *ReportExecutionsRetryParams { + return &ReportExecutionsRetryParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReportExecutionsRetryParamsWithTimeout creates a new ReportExecutionsRetryParams object +// with the ability to set a timeout on a request. +func NewReportExecutionsRetryParamsWithTimeout(timeout time.Duration) *ReportExecutionsRetryParams { + return &ReportExecutionsRetryParams{ + timeout: timeout, + } +} + +// NewReportExecutionsRetryParamsWithContext creates a new ReportExecutionsRetryParams object +// with the ability to set a context for a request. +func NewReportExecutionsRetryParamsWithContext(ctx context.Context) *ReportExecutionsRetryParams { + return &ReportExecutionsRetryParams{ + Context: ctx, + } +} + +// NewReportExecutionsRetryParamsWithHTTPClient creates a new ReportExecutionsRetryParams object +// with the ability to set a custom HTTPClient for a request. +func NewReportExecutionsRetryParamsWithHTTPClient(client *http.Client) *ReportExecutionsRetryParams { + return &ReportExecutionsRetryParams{ + HTTPClient: client, + } +} + +/* ReportExecutionsRetryParams contains all the parameters to send to the API endpoint + for the report executions retry operation. + + Typically these are written to a http.Request. +*/ +type ReportExecutionsRetryParams struct { + + /* XCSUSERID. + + The user id + */ + XCSUSERID *string + + /* XCSUSERUUID. + + The user uuid + */ + XCSUSERUUID string + + // Body. + Body []*models.APIReportExecutionRetryRequestV1 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the report executions retry params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReportExecutionsRetryParams) WithDefaults() *ReportExecutionsRetryParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the report executions retry params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReportExecutionsRetryParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the report executions retry params +func (o *ReportExecutionsRetryParams) WithTimeout(timeout time.Duration) *ReportExecutionsRetryParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the report executions retry params +func (o *ReportExecutionsRetryParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the report executions retry params +func (o *ReportExecutionsRetryParams) WithContext(ctx context.Context) *ReportExecutionsRetryParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the report executions retry params +func (o *ReportExecutionsRetryParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the report executions retry params +func (o *ReportExecutionsRetryParams) WithHTTPClient(client *http.Client) *ReportExecutionsRetryParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the report executions retry params +func (o *ReportExecutionsRetryParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithXCSUSERID adds the xCSUSERID to the report executions retry params +func (o *ReportExecutionsRetryParams) WithXCSUSERID(xCSUSERID *string) *ReportExecutionsRetryParams { + o.SetXCSUSERID(xCSUSERID) + return o +} + +// SetXCSUSERID adds the xCSUSERId to the report executions retry params +func (o *ReportExecutionsRetryParams) SetXCSUSERID(xCSUSERID *string) { + o.XCSUSERID = xCSUSERID +} + +// WithXCSUSERUUID adds the xCSUSERUUID to the report executions retry params +func (o *ReportExecutionsRetryParams) WithXCSUSERUUID(xCSUSERUUID string) *ReportExecutionsRetryParams { + o.SetXCSUSERUUID(xCSUSERUUID) + return o +} + +// SetXCSUSERUUID adds the xCSUSERUuid to the report executions retry params +func (o *ReportExecutionsRetryParams) SetXCSUSERUUID(xCSUSERUUID string) { + o.XCSUSERUUID = xCSUSERUUID +} + +// WithBody adds the body to the report executions retry params +func (o *ReportExecutionsRetryParams) WithBody(body []*models.APIReportExecutionRetryRequestV1) *ReportExecutionsRetryParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the report executions retry params +func (o *ReportExecutionsRetryParams) SetBody(body []*models.APIReportExecutionRetryRequestV1) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *ReportExecutionsRetryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.XCSUSERID != nil { + + // header param X-CS-USERID + if err := r.SetHeaderParam("X-CS-USERID", *o.XCSUSERID); err != nil { + return err + } + } + + // header param X-CS-USERUUID + if err := r.SetHeaderParam("X-CS-USERUUID", o.XCSUSERUUID); err != nil { + return err + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/falcon/client/report_executions/report_executions_retry_responses.go b/falcon/client/report_executions/report_executions_retry_responses.go new file mode 100644 index 00000000..016f7608 --- /dev/null +++ b/falcon/client/report_executions/report_executions_retry_responses.go @@ -0,0 +1,414 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package report_executions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/crowdstrike/gofalcon/falcon/models" +) + +// ReportExecutionsRetryReader is a Reader for the ReportExecutionsRetry structure. +type ReportExecutionsRetryReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReportExecutionsRetryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReportExecutionsRetryOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewReportExecutionsRetryBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewReportExecutionsRetryForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 429: + result := NewReportExecutionsRetryTooManyRequests() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + result := NewReportExecutionsRetryDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewReportExecutionsRetryOK creates a ReportExecutionsRetryOK with default headers values +func NewReportExecutionsRetryOK() *ReportExecutionsRetryOK { + return &ReportExecutionsRetryOK{} +} + +/* ReportExecutionsRetryOK describes a response with status code 200, with default header values. + +OK +*/ +type ReportExecutionsRetryOK struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.APIReportExecutionsResponseV1 +} + +func (o *ReportExecutionsRetryOK) Error() string { + return fmt.Sprintf("[POST /reports/entities/report-executions-retry/v1][%d] reportExecutionsRetryOK %+v", 200, o.Payload) +} +func (o *ReportExecutionsRetryOK) GetPayload() *models.APIReportExecutionsResponseV1 { + return o.Payload +} + +func (o *ReportExecutionsRetryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.APIReportExecutionsResponseV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReportExecutionsRetryBadRequest creates a ReportExecutionsRetryBadRequest with default headers values +func NewReportExecutionsRetryBadRequest() *ReportExecutionsRetryBadRequest { + return &ReportExecutionsRetryBadRequest{} +} + +/* ReportExecutionsRetryBadRequest describes a response with status code 400, with default header values. + +Bad Request +*/ +type ReportExecutionsRetryBadRequest struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +func (o *ReportExecutionsRetryBadRequest) Error() string { + return fmt.Sprintf("[POST /reports/entities/report-executions-retry/v1][%d] reportExecutionsRetryBadRequest %+v", 400, o.Payload) +} +func (o *ReportExecutionsRetryBadRequest) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReportExecutionsRetryBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReportExecutionsRetryForbidden creates a ReportExecutionsRetryForbidden with default headers values +func NewReportExecutionsRetryForbidden() *ReportExecutionsRetryForbidden { + return &ReportExecutionsRetryForbidden{} +} + +/* ReportExecutionsRetryForbidden describes a response with status code 403, with default header values. + +Forbidden +*/ +type ReportExecutionsRetryForbidden struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + Payload *models.MsaReplyMetaOnly +} + +func (o *ReportExecutionsRetryForbidden) Error() string { + return fmt.Sprintf("[POST /reports/entities/report-executions-retry/v1][%d] reportExecutionsRetryForbidden %+v", 403, o.Payload) +} +func (o *ReportExecutionsRetryForbidden) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReportExecutionsRetryForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReportExecutionsRetryTooManyRequests creates a ReportExecutionsRetryTooManyRequests with default headers values +func NewReportExecutionsRetryTooManyRequests() *ReportExecutionsRetryTooManyRequests { + return &ReportExecutionsRetryTooManyRequests{} +} + +/* ReportExecutionsRetryTooManyRequests describes a response with status code 429, with default header values. + +Too Many Requests +*/ +type ReportExecutionsRetryTooManyRequests struct { + + /* Trace-ID: submit to support if resolving an issue + */ + XCSTRACEID string + + /* Request limit per minute. + */ + XRateLimitLimit int64 + + /* The number of requests remaining for the sliding one minute window. + */ + XRateLimitRemaining int64 + + /* Too many requests, retry after this time (as milliseconds since epoch) + */ + XRateLimitRetryAfter int64 + + Payload *models.MsaReplyMetaOnly +} + +func (o *ReportExecutionsRetryTooManyRequests) Error() string { + return fmt.Sprintf("[POST /reports/entities/report-executions-retry/v1][%d] reportExecutionsRetryTooManyRequests %+v", 429, o.Payload) +} +func (o *ReportExecutionsRetryTooManyRequests) GetPayload() *models.MsaReplyMetaOnly { + return o.Payload +} + +func (o *ReportExecutionsRetryTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header X-CS-TRACEID + hdrXCSTRACEID := response.GetHeader("X-CS-TRACEID") + + if hdrXCSTRACEID != "" { + o.XCSTRACEID = hdrXCSTRACEID + } + + // hydrates response header X-RateLimit-Limit + hdrXRateLimitLimit := response.GetHeader("X-RateLimit-Limit") + + if hdrXRateLimitLimit != "" { + valxRateLimitLimit, err := swag.ConvertInt64(hdrXRateLimitLimit) + if err != nil { + return errors.InvalidType("X-RateLimit-Limit", "header", "int64", hdrXRateLimitLimit) + } + o.XRateLimitLimit = valxRateLimitLimit + } + + // hydrates response header X-RateLimit-Remaining + hdrXRateLimitRemaining := response.GetHeader("X-RateLimit-Remaining") + + if hdrXRateLimitRemaining != "" { + valxRateLimitRemaining, err := swag.ConvertInt64(hdrXRateLimitRemaining) + if err != nil { + return errors.InvalidType("X-RateLimit-Remaining", "header", "int64", hdrXRateLimitRemaining) + } + o.XRateLimitRemaining = valxRateLimitRemaining + } + + // hydrates response header X-RateLimit-RetryAfter + hdrXRateLimitRetryAfter := response.GetHeader("X-RateLimit-RetryAfter") + + if hdrXRateLimitRetryAfter != "" { + valxRateLimitRetryAfter, err := swag.ConvertInt64(hdrXRateLimitRetryAfter) + if err != nil { + return errors.InvalidType("X-RateLimit-RetryAfter", "header", "int64", hdrXRateLimitRetryAfter) + } + o.XRateLimitRetryAfter = valxRateLimitRetryAfter + } + + o.Payload = new(models.MsaReplyMetaOnly) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReportExecutionsRetryDefault creates a ReportExecutionsRetryDefault with default headers values +func NewReportExecutionsRetryDefault(code int) *ReportExecutionsRetryDefault { + return &ReportExecutionsRetryDefault{ + _statusCode: code, + } +} + +/* ReportExecutionsRetryDefault describes a response with status code -1, with default header values. + +OK +*/ +type ReportExecutionsRetryDefault struct { + _statusCode int + + Payload *models.APIReportExecutionsResponseV1 +} + +// Code gets the status code for the report executions retry default response +func (o *ReportExecutionsRetryDefault) Code() int { + return o._statusCode +} + +func (o *ReportExecutionsRetryDefault) Error() string { + return fmt.Sprintf("[POST /reports/entities/report-executions-retry/v1][%d] report-executions.retry default %+v", o._statusCode, o.Payload) +} +func (o *ReportExecutionsRetryDefault) GetPayload() *models.APIReportExecutionsResponseV1 { + return o.Payload +} + +func (o *ReportExecutionsRetryDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.APIReportExecutionsResponseV1) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/falcon/models/api_execution_metadata_v1.go b/falcon/models/api_execution_metadata_v1.go new file mode 100644 index 00000000..0dfc22e9 --- /dev/null +++ b/falcon/models/api_execution_metadata_v1.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// APIExecutionMetadataV1 api execution metadata v1 +// +// swagger:model api.ExecutionMetadataV1 +type APIExecutionMetadataV1 struct { + + // retry allowed + // Required: true + RetryAllowed *bool `json:"retry_allowed"` + + // retry performed + // Required: true + RetryPerformed *bool `json:"retry_performed"` + + // retry report execution id + // Required: true + RetryReportExecutionID *string `json:"retry_report_execution_id"` + + // subtype + // Required: true + Subtype *string `json:"subtype"` + + // unscheduled execution type + // Required: true + UnscheduledExecutionType *string `json:"unscheduled_execution_type"` +} + +// Validate validates this api execution metadata v1 +func (m *APIExecutionMetadataV1) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRetryAllowed(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRetryPerformed(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRetryReportExecutionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubtype(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUnscheduledExecutionType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *APIExecutionMetadataV1) validateRetryAllowed(formats strfmt.Registry) error { + + if err := validate.Required("retry_allowed", "body", m.RetryAllowed); err != nil { + return err + } + + return nil +} + +func (m *APIExecutionMetadataV1) validateRetryPerformed(formats strfmt.Registry) error { + + if err := validate.Required("retry_performed", "body", m.RetryPerformed); err != nil { + return err + } + + return nil +} + +func (m *APIExecutionMetadataV1) validateRetryReportExecutionID(formats strfmt.Registry) error { + + if err := validate.Required("retry_report_execution_id", "body", m.RetryReportExecutionID); err != nil { + return err + } + + return nil +} + +func (m *APIExecutionMetadataV1) validateSubtype(formats strfmt.Registry) error { + + if err := validate.Required("subtype", "body", m.Subtype); err != nil { + return err + } + + return nil +} + +func (m *APIExecutionMetadataV1) validateUnscheduledExecutionType(formats strfmt.Registry) error { + + if err := validate.Required("unscheduled_execution_type", "body", m.UnscheduledExecutionType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this api execution metadata v1 based on context it is used +func (m *APIExecutionMetadataV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *APIExecutionMetadataV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *APIExecutionMetadataV1) UnmarshalBinary(b []byte) error { + var res APIExecutionMetadataV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/api_report_execution_retry_request_v1.go b/falcon/models/api_report_execution_retry_request_v1.go new file mode 100644 index 00000000..5ef4739b --- /dev/null +++ b/falcon/models/api_report_execution_retry_request_v1.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// APIReportExecutionRetryRequestV1 api report execution retry request v1 +// +// swagger:model api.ReportExecutionRetryRequestV1 +type APIReportExecutionRetryRequestV1 struct { + + // id + // Required: true + ID *string `json:"id"` +} + +// Validate validates this api report execution retry request v1 +func (m *APIReportExecutionRetryRequestV1) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *APIReportExecutionRetryRequestV1) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this api report execution retry request v1 based on context it is used +func (m *APIReportExecutionRetryRequestV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *APIReportExecutionRetryRequestV1) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *APIReportExecutionRetryRequestV1) UnmarshalBinary(b []byte) error { + var res APIReportExecutionRetryRequestV1 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/falcon/models/api_report_execution_v1.go b/falcon/models/api_report_execution_v1.go index 4240dca4..0d753f93 100644 --- a/falcon/models/api_report_execution_v1.go +++ b/falcon/models/api_report_execution_v1.go @@ -20,8 +20,7 @@ import ( type APIReportExecutionV1 struct { // can write - // Required: true - CanWrite *bool `json:"can_write"` + CanWrite bool `json:"can_write,omitempty"` // created on // Required: true @@ -32,6 +31,9 @@ type APIReportExecutionV1 struct { // Required: true CustomerID *string `json:"customer_id"` + // execution metadata + ExecutionMetadata *APIExecutionMetadataV1 `json:"execution_metadata,omitempty"` + // expiration on // Required: true // Format: date-time @@ -42,8 +44,7 @@ type APIReportExecutionV1 struct { ID *string `json:"id"` // job reference - // Required: true - JobReference *string `json:"job_reference"` + JobReference string `json:"job_reference,omitempty"` // last updated on // Required: true @@ -51,8 +52,7 @@ type APIReportExecutionV1 struct { LastUpdatedOn *strfmt.DateTime `json:"last_updated_on"` // report file reference - // Required: true - ReportFileReference *string `json:"report_file_reference"` + ReportFileReference string `json:"report_file_reference,omitempty"` // result metadata ResultMetadata *DomainResultMetadata `json:"result_metadata,omitempty"` @@ -69,6 +69,10 @@ type APIReportExecutionV1 struct { // Required: true Status *string `json:"status"` + // status display + // Required: true + StatusDisplay *string `json:"status_display"` + // status msg // Required: true StatusMsg *string `json:"status_msg"` @@ -77,8 +81,7 @@ type APIReportExecutionV1 struct { Tracking string `json:"tracking,omitempty"` // trigger reference - // Required: true - TriggerReference *string `json:"trigger_reference"` + TriggerReference string `json:"trigger_reference,omitempty"` // type // Required: true @@ -97,10 +100,6 @@ type APIReportExecutionV1 struct { func (m *APIReportExecutionV1) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateCanWrite(formats); err != nil { - res = append(res, err) - } - if err := m.validateCreatedOn(formats); err != nil { res = append(res, err) } @@ -109,15 +108,15 @@ func (m *APIReportExecutionV1) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateExpirationOn(formats); err != nil { + if err := m.validateExecutionMetadata(formats); err != nil { res = append(res, err) } - if err := m.validateID(formats); err != nil { + if err := m.validateExpirationOn(formats); err != nil { res = append(res, err) } - if err := m.validateJobReference(formats); err != nil { + if err := m.validateID(formats); err != nil { res = append(res, err) } @@ -125,10 +124,6 @@ func (m *APIReportExecutionV1) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateReportFileReference(formats); err != nil { - res = append(res, err) - } - if err := m.validateResultMetadata(formats); err != nil { res = append(res, err) } @@ -145,11 +140,11 @@ func (m *APIReportExecutionV1) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateStatusMsg(formats); err != nil { + if err := m.validateStatusDisplay(formats); err != nil { res = append(res, err) } - if err := m.validateTriggerReference(formats); err != nil { + if err := m.validateStatusMsg(formats); err != nil { res = append(res, err) } @@ -171,15 +166,6 @@ func (m *APIReportExecutionV1) Validate(formats strfmt.Registry) error { return nil } -func (m *APIReportExecutionV1) validateCanWrite(formats strfmt.Registry) error { - - if err := validate.Required("can_write", "body", m.CanWrite); err != nil { - return err - } - - return nil -} - func (m *APIReportExecutionV1) validateCreatedOn(formats strfmt.Registry) error { if err := validate.Required("created_on", "body", m.CreatedOn); err != nil { @@ -202,6 +188,25 @@ func (m *APIReportExecutionV1) validateCustomerID(formats strfmt.Registry) error return nil } +func (m *APIReportExecutionV1) validateExecutionMetadata(formats strfmt.Registry) error { + if swag.IsZero(m.ExecutionMetadata) { // not required + return nil + } + + if m.ExecutionMetadata != nil { + if err := m.ExecutionMetadata.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("execution_metadata") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("execution_metadata") + } + return err + } + } + + return nil +} + func (m *APIReportExecutionV1) validateExpirationOn(formats strfmt.Registry) error { if err := validate.Required("expiration_on", "body", m.ExpirationOn); err != nil { @@ -224,15 +229,6 @@ func (m *APIReportExecutionV1) validateID(formats strfmt.Registry) error { return nil } -func (m *APIReportExecutionV1) validateJobReference(formats strfmt.Registry) error { - - if err := validate.Required("job_reference", "body", m.JobReference); err != nil { - return err - } - - return nil -} - func (m *APIReportExecutionV1) validateLastUpdatedOn(formats strfmt.Registry) error { if err := validate.Required("last_updated_on", "body", m.LastUpdatedOn); err != nil { @@ -246,15 +242,6 @@ func (m *APIReportExecutionV1) validateLastUpdatedOn(formats strfmt.Registry) er return nil } -func (m *APIReportExecutionV1) validateReportFileReference(formats strfmt.Registry) error { - - if err := validate.Required("report_file_reference", "body", m.ReportFileReference); err != nil { - return err - } - - return nil -} - func (m *APIReportExecutionV1) validateResultMetadata(formats strfmt.Registry) error { if swag.IsZero(m.ResultMetadata) { // not required return nil @@ -301,18 +288,18 @@ func (m *APIReportExecutionV1) validateStatus(formats strfmt.Registry) error { return nil } -func (m *APIReportExecutionV1) validateStatusMsg(formats strfmt.Registry) error { +func (m *APIReportExecutionV1) validateStatusDisplay(formats strfmt.Registry) error { - if err := validate.Required("status_msg", "body", m.StatusMsg); err != nil { + if err := validate.Required("status_display", "body", m.StatusDisplay); err != nil { return err } return nil } -func (m *APIReportExecutionV1) validateTriggerReference(formats strfmt.Registry) error { +func (m *APIReportExecutionV1) validateStatusMsg(formats strfmt.Registry) error { - if err := validate.Required("trigger_reference", "body", m.TriggerReference); err != nil { + if err := validate.Required("status_msg", "body", m.StatusMsg); err != nil { return err } @@ -350,6 +337,10 @@ func (m *APIReportExecutionV1) validateUserUUID(formats strfmt.Registry) error { func (m *APIReportExecutionV1) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateExecutionMetadata(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateResultMetadata(ctx, formats); err != nil { res = append(res, err) } @@ -360,6 +351,22 @@ func (m *APIReportExecutionV1) ContextValidate(ctx context.Context, formats strf return nil } +func (m *APIReportExecutionV1) contextValidateExecutionMetadata(ctx context.Context, formats strfmt.Registry) error { + + if m.ExecutionMetadata != nil { + if err := m.ExecutionMetadata.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("execution_metadata") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("execution_metadata") + } + return err + } + } + + return nil +} + func (m *APIReportExecutionV1) contextValidateResultMetadata(ctx context.Context, formats strfmt.Registry) error { if m.ResultMetadata != nil { diff --git a/falcon/models/domain_result_metadata.go b/falcon/models/domain_result_metadata.go index 8e21937a..3603543d 100644 --- a/falcon/models/domain_result_metadata.go +++ b/falcon/models/domain_result_metadata.go @@ -19,19 +19,42 @@ import ( // swagger:model domain.ResultMetadata type DomainResultMetadata struct { + // execution delay + // Required: true + ExecutionDelay *int64 `json:"execution_delay"` + // execution duration // Required: true ExecutionDuration *int64 `json:"execution_duration"` + // execution finish + // Required: true + // Format: date-time + ExecutionFinish *strfmt.DateTime `json:"execution_finish"` + // execution start // Required: true // Format: date-time ExecutionStart *strfmt.DateTime `json:"execution_start"` + // queue duration + // Required: true + QueueDuration *int64 `json:"queue_duration"` + + // queue start + // Required: true + // Format: date-time + QueueStart *strfmt.DateTime `json:"queue_start"` + // report file name // Required: true ReportFileName *string `json:"report_file_name"` + // report finish + // Required: true + // Format: date-time + ReportFinish *strfmt.DateTime `json:"report_finish"` + // result count // Required: true ResultCount *int32 `json:"result_count"` @@ -55,18 +78,38 @@ type DomainResultMetadata struct { func (m *DomainResultMetadata) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateExecutionDelay(formats); err != nil { + res = append(res, err) + } + if err := m.validateExecutionDuration(formats); err != nil { res = append(res, err) } + if err := m.validateExecutionFinish(formats); err != nil { + res = append(res, err) + } + if err := m.validateExecutionStart(formats); err != nil { res = append(res, err) } + if err := m.validateQueueDuration(formats); err != nil { + res = append(res, err) + } + + if err := m.validateQueueStart(formats); err != nil { + res = append(res, err) + } + if err := m.validateReportFileName(formats); err != nil { res = append(res, err) } + if err := m.validateReportFinish(formats); err != nil { + res = append(res, err) + } + if err := m.validateResultCount(formats); err != nil { res = append(res, err) } @@ -89,6 +132,15 @@ func (m *DomainResultMetadata) Validate(formats strfmt.Registry) error { return nil } +func (m *DomainResultMetadata) validateExecutionDelay(formats strfmt.Registry) error { + + if err := validate.Required("execution_delay", "body", m.ExecutionDelay); err != nil { + return err + } + + return nil +} + func (m *DomainResultMetadata) validateExecutionDuration(formats strfmt.Registry) error { if err := validate.Required("execution_duration", "body", m.ExecutionDuration); err != nil { @@ -98,6 +150,19 @@ func (m *DomainResultMetadata) validateExecutionDuration(formats strfmt.Registry return nil } +func (m *DomainResultMetadata) validateExecutionFinish(formats strfmt.Registry) error { + + if err := validate.Required("execution_finish", "body", m.ExecutionFinish); err != nil { + return err + } + + if err := validate.FormatOf("execution_finish", "body", "date-time", m.ExecutionFinish.String(), formats); err != nil { + return err + } + + return nil +} + func (m *DomainResultMetadata) validateExecutionStart(formats strfmt.Registry) error { if err := validate.Required("execution_start", "body", m.ExecutionStart); err != nil { @@ -111,6 +176,28 @@ func (m *DomainResultMetadata) validateExecutionStart(formats strfmt.Registry) e return nil } +func (m *DomainResultMetadata) validateQueueDuration(formats strfmt.Registry) error { + + if err := validate.Required("queue_duration", "body", m.QueueDuration); err != nil { + return err + } + + return nil +} + +func (m *DomainResultMetadata) validateQueueStart(formats strfmt.Registry) error { + + if err := validate.Required("queue_start", "body", m.QueueStart); err != nil { + return err + } + + if err := validate.FormatOf("queue_start", "body", "date-time", m.QueueStart.String(), formats); err != nil { + return err + } + + return nil +} + func (m *DomainResultMetadata) validateReportFileName(formats strfmt.Registry) error { if err := validate.Required("report_file_name", "body", m.ReportFileName); err != nil { @@ -120,6 +207,19 @@ func (m *DomainResultMetadata) validateReportFileName(formats strfmt.Registry) e return nil } +func (m *DomainResultMetadata) validateReportFinish(formats strfmt.Registry) error { + + if err := validate.Required("report_finish", "body", m.ReportFinish); err != nil { + return err + } + + if err := validate.FormatOf("report_finish", "body", "date-time", m.ReportFinish.String(), formats); err != nil { + return err + } + + return nil +} + func (m *DomainResultMetadata) validateResultCount(formats strfmt.Registry) error { if err := validate.Required("result_count", "body", m.ResultCount); err != nil {