diff --git a/falcon/models/domain_discover_api_host_entities_response.go b/falcon/models/domain_discover_api_host_entities_response.go index 4366b5bb..64ff31cf 100644 --- a/falcon/models/domain_discover_api_host_entities_response.go +++ b/falcon/models/domain_discover_api_host_entities_response.go @@ -25,7 +25,7 @@ type DomainDiscoverAPIHostEntitiesResponse struct { // meta // Required: true - Meta *MsaspecMetaInfo `json:"meta"` + Meta *MsaMetaInfo `json:"meta"` // resources // Required: true diff --git a/falcon/models/msa_query_response.go b/falcon/models/msa_query_response.go index 9cb136de..7d55f6c1 100644 --- a/falcon/models/msa_query_response.go +++ b/falcon/models/msa_query_response.go @@ -26,7 +26,7 @@ type MsaQueryResponse struct { // meta // Required: true - Meta *MsaspecMetaInfo `json:"meta"` + Meta *MsaMetaInfo `json:"meta"` // resources // Required: true diff --git a/falcon/models/msaspec_meta_info.go b/falcon/models/msaspec_meta_info.go deleted file mode 100644 index cde53a9b..00000000 --- a/falcon/models/msaspec_meta_info.go +++ /dev/null @@ -1,188 +0,0 @@ -// 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" -) - -// MsaspecMetaInfo msaspec meta info -// -// swagger:model msaspec.MetaInfo -type MsaspecMetaInfo struct { - - // pagination - Pagination *MsaspecPaging `json:"pagination,omitempty"` - - // powered by - PoweredBy string `json:"powered_by,omitempty"` - - // query time - // Required: true - QueryTime *float64 `json:"query_time"` - - // trace id - // Required: true - TraceID *string `json:"trace_id"` - - // writes - Writes *MsaspecWrites `json:"writes,omitempty"` -} - -// Validate validates this msaspec meta info -func (m *MsaspecMetaInfo) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if err := m.validateQueryTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTraceID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWrites(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MsaspecMetaInfo) validatePagination(formats strfmt.Registry) error { - if swag.IsZero(m.Pagination) { // not required - return nil - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pagination") - } - return err - } - } - - return nil -} - -func (m *MsaspecMetaInfo) validateQueryTime(formats strfmt.Registry) error { - - if err := validate.Required("query_time", "body", m.QueryTime); err != nil { - return err - } - - return nil -} - -func (m *MsaspecMetaInfo) validateTraceID(formats strfmt.Registry) error { - - if err := validate.Required("trace_id", "body", m.TraceID); err != nil { - return err - } - - return nil -} - -func (m *MsaspecMetaInfo) validateWrites(formats strfmt.Registry) error { - if swag.IsZero(m.Writes) { // not required - return nil - } - - if m.Writes != nil { - if err := m.Writes.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("writes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("writes") - } - return err - } - } - - return nil -} - -// ContextValidate validate this msaspec meta info based on the context it is used -func (m *MsaspecMetaInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWrites(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MsaspecMetaInfo) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pagination") - } - return err - } - } - - return nil -} - -func (m *MsaspecMetaInfo) contextValidateWrites(ctx context.Context, formats strfmt.Registry) error { - - if m.Writes != nil { - if err := m.Writes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("writes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("writes") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MsaspecMetaInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MsaspecMetaInfo) UnmarshalBinary(b []byte) error { - var res MsaspecMetaInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/msaspec_paging.go b/falcon/models/msaspec_paging.go deleted file mode 100644 index 984370a3..00000000 --- a/falcon/models/msaspec_paging.go +++ /dev/null @@ -1,105 +0,0 @@ -// 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" -) - -// MsaspecPaging msaspec paging -// -// swagger:model msaspec.Paging -type MsaspecPaging struct { - - // limit - // Required: true - Limit *int32 `json:"limit"` - - // offset - // Required: true - Offset *int32 `json:"offset"` - - // total - // Required: true - Total *int64 `json:"total"` -} - -// Validate validates this msaspec paging -func (m *MsaspecPaging) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLimit(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOffset(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotal(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MsaspecPaging) validateLimit(formats strfmt.Registry) error { - - if err := validate.Required("limit", "body", m.Limit); err != nil { - return err - } - - return nil -} - -func (m *MsaspecPaging) validateOffset(formats strfmt.Registry) error { - - if err := validate.Required("offset", "body", m.Offset); err != nil { - return err - } - - return nil -} - -func (m *MsaspecPaging) validateTotal(formats strfmt.Registry) error { - - if err := validate.Required("total", "body", m.Total); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this msaspec paging based on context it is used -func (m *MsaspecPaging) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MsaspecPaging) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MsaspecPaging) UnmarshalBinary(b []byte) error { - var res MsaspecPaging - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/falcon/models/msaspec_response_fields.go b/falcon/models/msaspec_response_fields.go index ff27954b..69218747 100644 --- a/falcon/models/msaspec_response_fields.go +++ b/falcon/models/msaspec_response_fields.go @@ -25,7 +25,7 @@ type MsaspecResponseFields struct { // meta // Required: true - Meta *MsaspecMetaInfo `json:"meta"` + Meta *MsaMetaInfo `json:"meta"` } // Validate validates this msaspec response fields diff --git a/specs/transformation.jq b/specs/transformation.jq index 35c81e56..c1eba984 100644 --- a/specs/transformation.jq +++ b/specs/transformation.jq @@ -12,6 +12,13 @@ | .definitions."domain.DiscoverAPIHostEntitiesResponse".properties.errors.items."$ref" = "#/definitions/msa.APIError" | .definitions."msa.QueryResponse".properties.errors.items."$ref" = "#/definitions/msa.APIError" | .definitions."msaspec.ResponseFields".properties.errors.items."$ref" = "#/definitions/msa.APIError" + # Rename msaspec.Paging to msa.Paging. These are two names for the same type. + | del(.definitions."msaspec.Paging") + # Rename msaspec.MetaInfo to msa.MetaInfo. These are two names for the same type. + | del(.definitions."msaspec.MetaInfo") + | .definitions."domain.DiscoverAPIHostEntitiesResponse".properties.meta."$ref" = "#/definitions/msa.MetaInfo" + | .definitions."msa.QueryResponse".properties.meta."$ref" = "#/definitions/msa.MetaInfo" + | .definitions."msaspec.ResponseFields".properties.meta."$ref" = "#/definitions/msa.MetaInfo" # Misc fixes | .paths."/intel/entities/rules-latest-files/v1".get.parameters |= . + [{type: "string", description: "Download Only if changed since", name: "If-Modified-Since", "in": "header"}] | .paths."/intel/entities/rules-latest-files/v1".get.responses."304" = {description: "Not Modified"}