entityops

package
v2.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 77 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MutationPropertyEntityID is the standard mutation metadata key used for entity identifiers
	MutationPropertyEntityID = "ID"
	// MutationPropertyOperation is the mutation metadata key used for the operation type
	MutationPropertyOperation = "operation"
	// MutationPropertyMutationType is the mutation metadata key used for the ent schema type
	MutationPropertyMutationType = "mutation_type"
)
View Source
const (
	// FieldOwnerID is the provenance column recording the owning organization
	FieldOwnerID = "owner_id"
	// FieldIntegrationID is the provenance column recording the writing installation's FK
	FieldIntegrationID = "integration_id"
	// FieldManagedBy is the provenance column recording which installation owns a record
	FieldManagedBy = "managed_by"
	// FieldPlatformID is the provenance column recording the platform of the writing installation
	FieldPlatformID = "platform_id"
	// FieldSourceDefinitionID is the provenance column recording the source definition id
	FieldSourceDefinitionID = "source_definition_id"
	// FieldSourceDefinitionVersion is the provenance column recording the source definition version
	FieldSourceDefinitionVersion = "source_definition_version"
	// FieldSourceInstanceID is the provenance column recording the external tenant or instance
	FieldSourceInstanceID = "source_instance_id"
	// FieldIntegrationRunID is the provenance column recording the integration run that last wrote a record
	FieldIntegrationRunID = "integration_run_id"
)
View Source
const (
	// FieldSchema is the log field key for the schema name
	FieldSchema = "schema"
)
View Source
const OpSoftDelete = "OpSoftDelete"

OpSoftDelete is the soft-delete operation, classified at emit when the entx soft-delete mixin rewrites a delete into an update

Variables

View Source
var (
	// ErrSchemaNotFound indicates the schema name could not be resolved
	ErrSchemaNotFound = errors.New("entityops: schema not found")
	// ErrCreateFailed indicates an entity creation failed
	ErrCreateFailed = errors.New("entityops: create failed")
	// ErrUpdateFailed indicates an entity update failed
	ErrUpdateFailed = errors.New("entityops: update failed")
	// ErrQueryFailed indicates an entity query failed
	ErrQueryFailed = errors.New("entityops: query failed")
	// ErrLoadFailed indicates an entity load failed
	ErrLoadFailed = errors.New("entityops: load failed")
	// ErrLinkFailed indicates an edge link operation failed
	ErrLinkFailed = errors.New("entityops: link failed")
	// ErrEdgeNotFound indicates the named edge does not exist or is not linkable on the source schema
	ErrEdgeNotFound = errors.New("entityops: edge not found")
	// ErrDecodeFailed indicates input JSON decoding failed
	ErrDecodeFailed = errors.New("entityops: decode failed")
	// ErrMarshalFailed indicates entity JSON marshaling failed
	ErrMarshalFailed = errors.New("entityops: marshal failed")
	// ErrEmitFailed indicates a gala event emission failed
	ErrEmitFailed = errors.New("entityops: emit failed")
	// ErrPersistFailed indicates a generic persistence failure
	ErrPersistFailed = errors.New("entityops: persist failed")
	// ErrValidationFailed indicates the input did not satisfy schema constraints
	ErrValidationFailed = errors.New("entityops: validation failed")
	// ErrUpsertConflict indicates an upsert matched more than one existing record
	ErrUpsertConflict = errors.New("entityops: upsert conflict")
	// ErrUpsertKeyMissing indicates the payload omitted the schema's lookup key value
	ErrUpsertKeyMissing = errors.New("entityops: upsert key missing")
	// ErrUpsertUnsupported indicates the schema does not support catalog-driven upserts
	ErrUpsertUnsupported = errors.New("entityops: upsert unsupported")
	// ErrFieldNotFound indicates a field name could not be resolved on the schema
	ErrFieldNotFound = errors.New("entityops: field not found")
	// ErrValueCoercion indicates a raw value could not be coerced to the field's type
	ErrValueCoercion = errors.New("entityops: value coercion failed")
	// ErrListenerRegistrationFailed indicates a gala listener could not be registered
	ErrListenerRegistrationFailed = errors.New("entityops: listener registration failed")
	// ErrMutationListenerInvalid indicates a listener is missing its schema or handler
	ErrMutationListenerInvalid = errors.New("entityops: invalid mutation listener")
	// ErrNotifySpecInvalid indicates a notify spec is missing recipients or content
	ErrNotifySpecInvalid = errors.New("entityops: notify spec requires recipients, type, topic, and title and body templates")
	// ErrMutationSchemaMismatch indicates a payload was delivered to a listener for another schema
	ErrMutationSchemaMismatch = errors.New("entityops: mutation schema mismatch")
	// ErrClientResolveFailed indicates the ent client could not be resolved from the injector
	ErrClientResolveFailed = errors.New("entityops: client resolve failed")
	// ErrQueryUnsupported indicates the schema does not support org-scoped queries
	ErrQueryUnsupported = errors.New("entityops: query unsupported")
	// ErrEvaluationFailed indicates a CEL expression evaluation failed
	ErrEvaluationFailed = errors.New("entityops: evaluation failed")
	// ErrKeyMatchUnsupported indicates the schema does not support key-based target queries
	ErrKeyMatchUnsupported = errors.New("entityops: key match unsupported")
	// ErrInvalidKeyField indicates a key match referenced a field that is not an indexable key on the schema
	ErrInvalidKeyField = errors.New("entityops: invalid key field")
	// ErrEvaluatorBuildFailed indicates the typed CEL evaluator for a schema projection could not be built
	ErrEvaluatorBuildFailed = errors.New("entityops: evaluator build failed")
	// ErrIngestUnsupported indicates the schema has no generated ingest capability
	ErrIngestUnsupported = errors.New("entityops: ingest unsupported")
	// ErrIngestMisconfigured indicates a schema ingest capability was registered incorrectly at startup
	ErrIngestMisconfigured = errors.New("entityops: ingest misconfigured")
	// ErrIngestIntegrationResolveFailed indicates the durable command's integration could not be resolved
	ErrIngestIntegrationResolveFailed = errors.New("entityops: ingest integration resolve failed")
	// ErrUpsertStaleRun indicates an ingest update was superseded by a newer or equal integration run
	ErrUpsertStaleRun = errors.New("entityops: upsert stale run")
	// ErrLookupAlternativeInvalid indicates a lookup names an alternative index the schema does not declare
	ErrLookupAlternativeInvalid = errors.New("entityops: lookup alternative invalid")
)
View Source
var (
	// OpCreate is the create mutation operation
	OpCreate = ent.OpCreate.String()
	// OpUpdate is the bulk update mutation operation
	OpUpdate = ent.OpUpdate.String()
	// OpUpdateOne is the single-row update mutation operation
	OpUpdateOne = ent.OpUpdateOne.String()
	// OpDelete is the bulk hard-delete mutation operation
	OpDelete = ent.OpDelete.String()
	// OpDeleteOne is the single-row hard-delete mutation operation
	OpDeleteOne = ent.OpDeleteOne.String()
)

mutation operation vocabulary for listener registration and payload matching

View Source
var (
	SchemaAPIToken = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "APIToken",
			Snake: "api_token",
			Lower: "apitoken",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "api_token", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.APIToken.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaActionPlan = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "ActionPlan",
			Snake:            "action_plan",
			Lower:            "actionplan",
			WorkflowEligible: true,
		},
		ProjectionType:        reflect.TypeFor[ActionPlanProjection](),
		MentionSpec:           &MentionSpec{Schema: "ActionPlan", NameField: "name", DetailsField: "details", DetailsJSONField: "details_json", OwnerField: "owner_id"},
		ApprovalSpec:          &ApprovalSpec{Schema: "ActionPlan", StatusField: "status", ApproverField: "approver_id"},
		IntegrationM2MEdge:    "integrations",
		IntegrationRunM2MEdge: "integration_runs",
		Lookup: []LookupAlternative{
			{Fields: []string{"external_file_id"}},
		},
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "action_plan", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateActionPlanInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.ActionPlan.Create().SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return "", logError(ctx, ref, ErrCreateFailed, err)
			}

			entity, err := builder.Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "action_plan", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateActionPlanInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.ActionPlan.UpdateOneID(entityID).SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return logError(ctx, ref, ErrUpdateFailed, err)
			}

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "action_plan", Operation: refOpQuery}

			entities, err := client.ActionPlan.Query().
				Where(actionplan.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "action_plan", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.ActionPlan.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.ActionPlan.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "action_plan", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "action_plan.ingest.requested"),
		},
	}
	SchemaAssessment = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Assessment",
			Snake:            "assessment",
			Lower:            "assessment",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[AssessmentProjection](),
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "assessment", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateAssessmentInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Assessment.UpdateOneID(entityID).SetInput(decoded)

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "assessment", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Assessment.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Assessment.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "assessment", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaAssessmentResponse = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "AssessmentResponse",
			Snake:            "assessment_response",
			Lower:            "assessmentresponse",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[AssessmentResponseProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "assessment_response", Operation: refOpQuery}

			entities, err := client.AssessmentResponse.Query().
				Where(assessmentresponse.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "assessment_response", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.AssessmentResponse.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.AssessmentResponse.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "assessment_response", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaAsset = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Asset",
			Snake: "asset",
			Lower: "asset",
		},
		ProjectionType:        reflect.TypeFor[AssetProjection](),
		IntegrationFKField:    "integration_id",
		IntegrationRunM2MEdge: "integration_runs",
		Lookup: []LookupAlternative{
			{Fields: []string{"source_identifier"}},
		},
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "asset", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateAssetInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Asset.Create().SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return "", logError(ctx, ref, ErrCreateFailed, err)
			}

			entity, err := builder.Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "asset", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateAssetInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Asset.UpdateOneID(entityID).SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return logError(ctx, ref, ErrUpdateFailed, err)
			}

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "asset", Operation: refOpQuery}

			entities, err := client.Asset.Query().
				Where(asset.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "asset", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Asset.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "asset.ingest.requested"),
		},
	}
	SchemaCampaign = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Campaign",
			Snake:            "campaign",
			Lower:            "campaign",
			WorkflowEligible: true,
		},
		ProjectionType:     reflect.TypeFor[CampaignProjection](),
		IntegrationFKField: "integration_id",
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "campaign", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateCampaignInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Campaign.UpdateOneID(entityID).SetInput(decoded)

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "campaign", Operation: refOpQuery}

			entities, err := client.Campaign.Query().
				Where(campaign.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "campaign", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Campaign.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Campaign.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "campaign", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaCampaignTarget = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "CampaignTarget",
			Snake:            "campaign_target",
			Lower:            "campaigntarget",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[CampaignTargetProjection](),
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "campaign_target", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateCampaignTargetInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.CampaignTarget.UpdateOneID(entityID).SetInput(decoded)

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "campaign_target", Operation: refOpQuery}

			entities, err := client.CampaignTarget.Query().
				Where(campaigntarget.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "campaign_target", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.CampaignTarget.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.CampaignTarget.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "campaign_target", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaCheckResult = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "CheckResult",
			Snake: "check_result",
			Lower: "checkresult",
		},
		ProjectionType:        reflect.TypeFor[CheckResultProjection](),
		IntegrationFKField:    "integration_id",
		IntegrationRunM2MEdge: "integration_runs",
		Lookup: []LookupAlternative{
			{Fields: []string{"parent_external_id"}},
		},
		InstanceScoped: true,
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "check_result", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateCheckResultInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.CheckResult.Create().SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return "", logError(ctx, ref, ErrCreateFailed, err)
			}

			entity, err := builder.Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "check_result", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateCheckResultInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.CheckResult.UpdateOneID(entityID).SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return logError(ctx, ref, ErrUpdateFailed, err)
			}

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "check_result", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.CheckResult.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "check_result.ingest.requested"),
		},
	}
	SchemaContact = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Contact",
			Snake: "contact",
			Lower: "contact",
		},
		ProjectionType:        reflect.TypeFor[ContactProjection](),
		IntegrationRunM2MEdge: "integration_runs",
		Lookup: []LookupAlternative{
			{Fields: []string{"external_id"}},
			{Fields: []string{"email"}},
		},
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "contact", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateContactInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Contact.Create().SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return "", logError(ctx, ref, ErrCreateFailed, err)
			}

			entity, err := builder.Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "contact", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateContactInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Contact.UpdateOneID(entityID).SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return logError(ctx, ref, ErrUpdateFailed, err)
			}

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "contact", Operation: refOpQuery}

			entities, err := client.Contact.Query().
				Where(contact.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "contact", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Contact.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "contact.ingest.requested"),
		},
	}
	SchemaControl = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Control",
			Snake:            "control",
			Lower:            "control",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[ControlProjection](),
		ConsoleRoute:   &ConsoleRoute{Base: "controls"},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "control", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateControlInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Control.UpdateOneID(entityID).SetInput(decoded)

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "control", Operation: refOpQuery}

			entities, err := client.Control.Query().
				Where(control.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "control", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Control.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Control.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "control", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaControlImplementation = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "ControlImplementation",
			Snake: "control_implementation",
			Lower: "controlimplementation",
		},
		ProjectionType: reflect.TypeFor[ControlImplementationProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "control_implementation", Operation: refOpQuery}

			entities, err := client.ControlImplementation.Query().
				Where(controlimplementation.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "control_implementation", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.ControlImplementation.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaControlObjective = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "ControlObjective",
			Snake: "control_objective",
			Lower: "controlobjective",
		},
		ProjectionType: reflect.TypeFor[ControlObjectiveProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "control_objective", Operation: refOpQuery}

			entities, err := client.ControlObjective.Query().
				Where(controlobjective.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "control_objective", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.ControlObjective.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaCustomDomain = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "CustomDomain",
			Snake: "custom_domain",
			Lower: "customdomain",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "custom_domain", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.CustomDomain.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaCustomTypeEnum = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "CustomTypeEnum",
			Snake: "custom_type_enum",
			Lower: "customtypeenum",
		},
		ProjectionType: reflect.TypeFor[CustomTypeEnumProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "custom_type_enum", Operation: refOpQuery}

			entities, err := client.CustomTypeEnum.Query().
				Where(customtypeenum.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "custom_type_enum", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.CustomTypeEnum.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaDNSVerification = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "DNSVerification",
			Snake: "dns_verification",
			Lower: "dnsverification",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "dns_verification", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.DNSVerification.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaDirectoryAccount = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "DirectoryAccount",
			Snake: "directory_account",
			Lower: "directoryaccount",
		},
		ProjectionType:        reflect.TypeFor[DirectoryAccountProjection](),
		IntegrationFKField:    "integration_id",
		IntegrationRunM2MEdge: "integration_runs",
		RemovedAtField:        "removed_at",
		Lookup: []LookupAlternative{
			{Fields: []string{"external_id"}},
		},
		InstanceScoped: true,
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "directory_account", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateDirectoryAccountInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.DirectoryAccount.Create().SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return "", logError(ctx, ref, ErrCreateFailed, err)
			}

			entity, err := builder.Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "directory_account", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateDirectoryAccountInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.DirectoryAccount.UpdateOneID(entityID).SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return logError(ctx, ref, ErrUpdateFailed, err)
			}

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "directory_account", Operation: refOpQuery}

			entities, err := client.DirectoryAccount.Query().
				Where(directoryaccount.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "directory_account", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.DirectoryAccount.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "directory_account.ingest.requested"),
		},
	}
	SchemaDirectoryGroup = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "DirectoryGroup",
			Snake: "directory_group",
			Lower: "directorygroup",
		},
		ProjectionType:        reflect.TypeFor[DirectoryGroupProjection](),
		IntegrationFKField:    "integration_id",
		IntegrationRunM2MEdge: "integration_runs",
		RemovedAtField:        "removed_at",
		Lookup: []LookupAlternative{
			{Fields: []string{"external_id"}},
		},
		InstanceScoped: true,
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "directory_group", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateDirectoryGroupInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.DirectoryGroup.Create().SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return "", logError(ctx, ref, ErrCreateFailed, err)
			}

			entity, err := builder.Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "directory_group", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateDirectoryGroupInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.DirectoryGroup.UpdateOneID(entityID).SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return logError(ctx, ref, ErrUpdateFailed, err)
			}

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "directory_group", Operation: refOpQuery}

			entities, err := client.DirectoryGroup.Query().
				Where(directorygroup.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "directory_group", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.DirectoryGroup.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "directory_group.ingest.requested"),
		},
	}
	SchemaDirectoryMembership = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "DirectoryMembership",
			Snake: "directory_membership",
			Lower: "directorymembership",
		},
		ProjectionType:        reflect.TypeFor[DirectoryMembershipProjection](),
		IntegrationFKField:    "integration_id",
		IntegrationRunM2MEdge: "integration_runs",
		RemovedAtField:        "removed_at",
		RemovedAtEpisodic:     true,
		Lookup: []LookupAlternative{
			{Fields: []string{"directory_account_id", "directory_group_id"}},
		},
		InstanceScoped: true,
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "directory_membership", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateDirectoryMembershipInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.DirectoryMembership.Create().SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return "", logError(ctx, ref, ErrCreateFailed, err)
			}

			entity, err := builder.Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "directory_membership", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateDirectoryMembershipInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.DirectoryMembership.UpdateOneID(entityID).SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return logError(ctx, ref, ErrUpdateFailed, err)
			}

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "directory_membership", Operation: refOpQuery}

			entities, err := client.DirectoryMembership.Query().
				Where(directorymembership.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "directory_membership", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.DirectoryMembership.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "directory_membership.ingest.requested"),
		},
	}
	SchemaDiscussion = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Discussion",
			Snake: "discussion",
			Lower: "discussion",
		},
		ProjectionType: reflect.TypeFor[DiscussionProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "discussion", Operation: refOpQuery}

			entities, err := client.Discussion.Query().
				Where(discussion.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "discussion", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Discussion.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaDocumentData = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "DocumentData",
			Snake: "document_data",
			Lower: "documentdata",
		},
		ProjectionType: reflect.TypeFor[DocumentDataProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "document_data", Operation: refOpQuery}

			entities, err := client.DocumentData.Query().
				Where(documentdata.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "document_data", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.DocumentData.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaEmailTemplate = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "EmailTemplate",
			Snake: "email_template",
			Lower: "emailtemplate",
		},
		IntegrationFKField: "integration_id",
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "email_template", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.EmailTemplate.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaEmailVerificationToken = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "EmailVerificationToken",
			Snake: "email_verification_token",
			Lower: "emailverificationtoken",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "email_verification_token", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.EmailVerificationToken.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaEntity = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Entity",
			Snake: "entity",
			Lower: "entity",
		},
		ProjectionType:        reflect.TypeFor[EntityProjection](),
		IntegrationM2MEdge:    "integrations",
		IntegrationRunM2MEdge: "integration_runs",
		Lookup: []LookupAlternative{
			{Fields: []string{"external_id"}},
		},
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "entity", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateEntityInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Entity.Create().SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return "", logError(ctx, ref, ErrCreateFailed, err)
			}

			entity, err := builder.Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "entity", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateEntityInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Entity.UpdateOneID(entityID).SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return logError(ctx, ref, ErrUpdateFailed, err)
			}

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "entity", Operation: refOpQuery}

			entities, err := client.Entity.Query().
				Where(entity.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "entity", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Entity.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "entity.ingest.requested"),
		},
	}
	SchemaEntityType = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "EntityType",
			Snake: "entity_type",
			Lower: "entitytype",
		},
		ProjectionType: reflect.TypeFor[EntityTypeProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "entity_type", Operation: refOpQuery}

			entities, err := client.EntityType.Query().
				Where(entitytype.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "entity_type", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.EntityType.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaEvent = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Event",
			Snake: "event",
			Lower: "event",
		},
		ProjectionType:     reflect.TypeFor[EventProjection](),
		IntegrationM2MEdge: "integrations",
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "event", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Event.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaEvidence = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Evidence",
			Snake:            "evidence",
			Lower:            "evidence",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[EvidenceProjection](),
		ConsoleRoute:   &ConsoleRoute{Base: "evidence", IDParam: "id"},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "evidence", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateEvidenceInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Evidence.UpdateOneID(entityID).SetInput(decoded)

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "evidence", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Evidence.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Evidence.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "evidence", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaExport = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Export",
			Snake: "export",
			Lower: "export",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "export", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Export.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaFile = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "File",
			Snake: "file",
			Lower: "file",
		},
		ProjectionType:     reflect.TypeFor[FileProjection](),
		IntegrationM2MEdge: "integrations",
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "file", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.File.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaFileDownloadToken = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "FileDownloadToken",
			Snake: "file_download_token",
			Lower: "filedownloadtoken",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "file_download_token", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.FileDownloadToken.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaFinding = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Finding",
			Snake:            "finding",
			Lower:            "finding",
			WorkflowEligible: true,
		},
		ProjectionType:        reflect.TypeFor[FindingProjection](),
		IntegrationM2MEdge:    "integrations",
		IntegrationRunM2MEdge: "integration_runs",
		Lookup: []LookupAlternative{
			{Fields: []string{"external_id"}},
		},
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "finding", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateFindingInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Finding.Create().SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return "", logError(ctx, ref, ErrCreateFailed, err)
			}

			entity, err := builder.Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "finding", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateFindingInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Finding.UpdateOneID(entityID).SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return logError(ctx, ref, ErrUpdateFailed, err)
			}

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "finding", Operation: refOpQuery}

			entities, err := client.Finding.Query().
				Where(finding.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "finding", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Finding.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Finding.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "finding", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "finding.ingest.requested"),
		},
	}
	SchemaFindingControl = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "FindingControl",
			Snake: "finding_control",
			Lower: "findingcontrol",
		},
		ProjectionType: reflect.TypeFor[FindingControlProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "finding_control", Operation: refOpQuery}

			entities, err := client.FindingControl.Query().
				Where(findingcontrol.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "finding_control", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.FindingControl.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaGroup = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Group",
			Snake: "group",
			Lower: "group",
		},
		ProjectionType:     reflect.TypeFor[GroupProjection](),
		IntegrationM2MEdge: "integrations",
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "group", Operation: refOpQuery}

			entities, err := client.Group.Query().
				Where(group.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "group", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Group.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaGroupMembership = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "GroupMembership",
			Snake: "group_membership",
			Lower: "groupmembership",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "group_membership", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.GroupMembership.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaGroupSetting = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "GroupSetting",
			Snake: "group_setting",
			Lower: "groupsetting",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "group_setting", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.GroupSetting.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaHush = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Hush",
			Snake: "hush",
			Lower: "hush",
		},
		IntegrationM2MEdge: "integrations",
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "hush", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Hush.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaIdentityHolder = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "IdentityHolder",
			Snake:            "identity_holder",
			Lower:            "identityholder",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[IdentityHolderProjection](),
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "identity_holder", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateIdentityHolderInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.IdentityHolder.UpdateOneID(entityID).SetInput(decoded)

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "identity_holder", Operation: refOpQuery}

			entities, err := client.IdentityHolder.Query().
				Where(identityholder.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "identity_holder", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.IdentityHolder.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.IdentityHolder.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "identity_holder", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaImpersonationEvent = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "ImpersonationEvent",
			Snake: "impersonation_event",
			Lower: "impersonationevent",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "impersonation_event", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.ImpersonationEvent.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaIntegration = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Integration",
			Snake: "integration",
			Lower: "integration",
		},
		ProjectionType:        reflect.TypeFor[IntegrationProjection](),
		ConsoleRoute:          &ConsoleRoute{Base: "automation/integrations"},
		IntegrationRunM2MEdge: "integration_runs",
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "integration", Operation: refOpQuery}

			entities, err := client.Integration.Query().
				Where(integration.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "integration", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Integration.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaIntegrationRun = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "IntegrationRun",
			Snake: "integration_run",
			Lower: "integrationrun",
		},
		ProjectionType:     reflect.TypeFor[IntegrationRunProjection](),
		IntegrationFKField: "integration_id",
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "integration_run", Operation: refOpQuery}

			entities, err := client.IntegrationRun.Query().
				Where(integrationrun.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "integration_run", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.IntegrationRun.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaIntegrationWebhook = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "IntegrationWebhook",
			Snake: "integration_webhook",
			Lower: "integrationwebhook",
		},
		IntegrationFKField: "integration_id",
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "integration_webhook", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.IntegrationWebhook.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaInternalPolicy = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "InternalPolicy",
			Snake:            "internal_policy",
			Lower:            "internalpolicy",
			WorkflowEligible: true,
		},
		ProjectionType:        reflect.TypeFor[InternalPolicyProjection](),
		ConsoleRoute:          &ConsoleRoute{Base: "policies", Suffix: "view"},
		MentionSpec:           &MentionSpec{Schema: "InternalPolicy", NameField: "name", DetailsField: "details", DetailsJSONField: "details_json", OwnerField: "owner_id"},
		ApprovalSpec:          &ApprovalSpec{Schema: "InternalPolicy", StatusField: "status", ApproverField: "approver_id"},
		IntegrationM2MEdge:    "integrations",
		IntegrationRunM2MEdge: "integration_runs",
		Lookup: []LookupAlternative{
			{Fields: []string{"external_file_id"}},
		},
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "internal_policy", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateInternalPolicyInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.InternalPolicy.Create().SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return "", logError(ctx, ref, ErrCreateFailed, err)
			}

			entity, err := builder.Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "internal_policy", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateInternalPolicyInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.InternalPolicy.UpdateOneID(entityID).SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return logError(ctx, ref, ErrUpdateFailed, err)
			}

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "internal_policy", Operation: refOpQuery}

			entities, err := client.InternalPolicy.Query().
				Where(internalpolicy.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "internal_policy", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.InternalPolicy.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.InternalPolicy.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "internal_policy", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "internal_policy.ingest.requested"),
		},
	}
	SchemaInvite = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Invite",
			Snake: "invite",
			Lower: "invite",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "invite", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Invite.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaMappableDomain = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "MappableDomain",
			Snake: "mappable_domain",
			Lower: "mappabledomain",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "mappable_domain", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.MappableDomain.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaMappedControl = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "MappedControl",
			Snake: "mapped_control",
			Lower: "mappedcontrol",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "mapped_control", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.MappedControl.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaNarrative = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Narrative",
			Snake: "narrative",
			Lower: "narrative",
		},
		ProjectionType: reflect.TypeFor[NarrativeProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "narrative", Operation: refOpQuery}

			entities, err := client.Narrative.Query().
				Where(narrative.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "narrative", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Narrative.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaNote = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Note",
			Snake: "note",
			Lower: "note",
		},
		ProjectionType: reflect.TypeFor[NoteProjection](),
		MentionSpec:    &MentionSpec{Schema: "Note", NameField: "title", DetailsField: "text", DetailsJSONField: "text_json", OwnerField: "owner_id"},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "note", Operation: refOpQuery}

			entities, err := client.Note.Query().
				Where(note.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "note", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Note.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaNotification = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Notification",
			Snake: "notification",
			Lower: "notification",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "notification", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Notification.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaNotificationPreference = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "NotificationPreference",
			Snake: "notification_preference",
			Lower: "notificationpreference",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "notification_preference", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.NotificationPreference.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaNotificationTemplate = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "NotificationTemplate",
			Snake: "notification_template",
			Lower: "notificationtemplate",
		},
		IntegrationFKField: "integration_id",
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "notification_template", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.NotificationTemplate.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaOnboarding = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Onboarding",
			Snake: "onboarding",
			Lower: "onboarding",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "onboarding", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Onboarding.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaOrgMembership = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "OrgMembership",
			Snake: "org_membership",
			Lower: "orgmembership",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "org_membership", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.OrgMembership.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaOrgModule = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "OrgModule",
			Snake: "org_module",
			Lower: "orgmodule",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "org_module", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.OrgModule.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaOrgPrice = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "OrgPrice",
			Snake: "org_price",
			Lower: "orgprice",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "org_price", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.OrgPrice.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaOrgProduct = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "OrgProduct",
			Snake: "org_product",
			Lower: "orgproduct",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "org_product", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.OrgProduct.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaOrgSubscription = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "OrgSubscription",
			Snake: "org_subscription",
			Lower: "orgsubscription",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "org_subscription", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.OrgSubscription.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaOrganization = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Organization",
			Snake: "organization",
			Lower: "organization",
		},
		ProjectionType:        reflect.TypeFor[OrganizationProjection](),
		IntegrationM2MEdge:    "integrations",
		IntegrationRunM2MEdge: "integration_runs",
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "organization", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Organization.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaOrganizationSetting = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "OrganizationSetting",
			Snake: "organization_setting",
			Lower: "organizationsetting",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "organization_setting", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.OrganizationSetting.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaPasswordResetToken = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "PasswordResetToken",
			Snake: "password_reset_token",
			Lower: "passwordresettoken",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "password_reset_token", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.PasswordResetToken.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaPersonalAccessToken = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "PersonalAccessToken",
			Snake: "personal_access_token",
			Lower: "personalaccesstoken",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "personal_access_token", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.PersonalAccessToken.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaPlatform = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Platform",
			Snake:            "platform",
			Lower:            "platform",
			WorkflowEligible: true,
		},
		ProjectionType:     reflect.TypeFor[PlatformProjection](),
		IntegrationM2MEdge: "integrations",
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "platform", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdatePlatformInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Platform.UpdateOneID(entityID).SetInput(decoded)

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "platform", Operation: refOpQuery}

			entities, err := client.Platform.Query().
				Where(platform.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "platform", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Platform.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Platform.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "platform", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaProcedure = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Procedure",
			Snake:            "procedure",
			Lower:            "procedure",
			WorkflowEligible: true,
		},
		ProjectionType:        reflect.TypeFor[ProcedureProjection](),
		ConsoleRoute:          &ConsoleRoute{Base: "procedures", Suffix: "view"},
		MentionSpec:           &MentionSpec{Schema: "Procedure", NameField: "name", DetailsField: "details", DetailsJSONField: "details_json", OwnerField: "owner_id"},
		ApprovalSpec:          &ApprovalSpec{Schema: "Procedure", StatusField: "status", ApproverField: "approver_id"},
		IntegrationRunM2MEdge: "integration_runs",
		Lookup: []LookupAlternative{
			{Fields: []string{"external_file_id"}},
		},
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "procedure", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateProcedureInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Procedure.Create().SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return "", logError(ctx, ref, ErrCreateFailed, err)
			}

			entity, err := builder.Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "procedure", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateProcedureInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Procedure.UpdateOneID(entityID).SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return logError(ctx, ref, ErrUpdateFailed, err)
			}

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "procedure", Operation: refOpQuery}

			entities, err := client.Procedure.Query().
				Where(procedure.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "procedure", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Procedure.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Procedure.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "procedure", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "procedure.ingest.requested"),
		},
	}
	SchemaProgram = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Program",
			Snake: "program",
			Lower: "program",
		},
		ProjectionType: reflect.TypeFor[ProgramProjection](),
		ConsoleRoute:   &ConsoleRoute{Base: "programs"},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "program", Operation: refOpQuery}

			entities, err := client.Program.Query().
				Where(program.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "program", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Program.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaProgramMembership = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "ProgramMembership",
			Snake: "program_membership",
			Lower: "programmembership",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "program_membership", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.ProgramMembership.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaRemediation = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Remediation",
			Snake:            "remediation",
			Lower:            "remediation",
			WorkflowEligible: true,
		},
		ProjectionType:     reflect.TypeFor[RemediationProjection](),
		IntegrationM2MEdge: "integrations",
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "remediation", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateRemediationInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Remediation.UpdateOneID(entityID).SetInput(decoded)

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "remediation", Operation: refOpQuery}

			entities, err := client.Remediation.Query().
				Where(remediation.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "remediation", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Remediation.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Remediation.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "remediation", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaReview = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Review",
			Snake: "review",
			Lower: "review",
		},
		ProjectionType:     reflect.TypeFor[ReviewProjection](),
		IntegrationM2MEdge: "integrations",
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "review", Operation: refOpQuery}

			entities, err := client.Review.Query().
				Where(review.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "review", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Review.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaRisk = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Risk",
			Snake:            "risk",
			Lower:            "risk",
			WorkflowEligible: true,
		},
		ProjectionType:        reflect.TypeFor[RiskProjection](),
		ConsoleRoute:          &ConsoleRoute{Base: "exposure/risks"},
		MentionSpec:           &MentionSpec{Schema: "Risk", NameField: "name", DetailsField: "details", DetailsJSONField: "details_json", OwnerField: "owner_id"},
		IntegrationRunM2MEdge: "integration_runs",
		Lookup: []LookupAlternative{
			{Fields: []string{"external_id"}},
		},
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "risk", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateRiskInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Risk.Create().SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return "", logError(ctx, ref, ErrCreateFailed, err)
			}

			entity, err := builder.Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "risk", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateRiskInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Risk.UpdateOneID(entityID).SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return logError(ctx, ref, ErrUpdateFailed, err)
			}

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "risk", Operation: refOpQuery}

			entities, err := client.Risk.Query().
				Where(risk.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "risk", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Risk.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Risk.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "risk", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "risk.ingest.requested"),
		},
	}
	SchemaSLADefinition = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "SLADefinition",
			Snake: "sla_definition",
			Lower: "sladefinition",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "sla_definition", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.SLADefinition.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaScan = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Scan",
			Snake: "scan",
			Lower: "scan",
		},
		ProjectionType: reflect.TypeFor[ScanProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "scan", Operation: refOpQuery}

			entities, err := client.Scan.Query().
				Where(scan.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "scan", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Scan.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaStandard = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Standard",
			Snake: "standard",
			Lower: "standard",
		},
		ConsoleRoute: &ConsoleRoute{Base: "standards"},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "standard", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Standard.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaSubcontrol = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Subcontrol",
			Snake:            "subcontrol",
			Lower:            "subcontrol",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[SubcontrolProjection](),
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "subcontrol", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateSubcontrolInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Subcontrol.UpdateOneID(entityID).SetInput(decoded)

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "subcontrol", Operation: refOpQuery}

			entities, err := client.Subcontrol.Query().
				Where(subcontrol.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "subcontrol", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Subcontrol.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Subcontrol.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "subcontrol", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaSubprocessor = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Subprocessor",
			Snake: "subprocessor",
			Lower: "subprocessor",
		},
		ProjectionType: reflect.TypeFor[SubprocessorProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "subprocessor", Operation: refOpQuery}

			entities, err := client.Subprocessor.Query().
				Where(subprocessor.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "subprocessor", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Subprocessor.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaSubscriber = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Subscriber",
			Snake: "subscriber",
			Lower: "subscriber",
		},
		ProjectionType: reflect.TypeFor[SubscriberProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "subscriber", Operation: refOpQuery}

			entities, err := client.Subscriber.Query().
				Where(subscriber.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "subscriber", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Subscriber.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaSystemDetail = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "SystemDetail",
			Snake: "system_detail",
			Lower: "systemdetail",
		},
		ProjectionType: reflect.TypeFor[SystemDetailProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "system_detail", Operation: refOpQuery}

			entities, err := client.SystemDetail.Query().
				Where(systemdetail.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "system_detail", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.SystemDetail.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTFASetting = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TFASetting",
			Snake: "tfa_setting",
			Lower: "tfasetting",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "tfa_setting", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TFASetting.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTagDefinition = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TagDefinition",
			Snake: "tag_definition",
			Lower: "tagdefinition",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "tag_definition", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TagDefinition.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTask = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Task",
			Snake:            "task",
			Lower:            "task",
			WorkflowEligible: true,
		},
		ProjectionType: reflect.TypeFor[TaskProjection](),
		ConsoleRoute:   &ConsoleRoute{Base: "automation/tasks", IDParam: "id"},
		MentionSpec:    &MentionSpec{Schema: "Task", NameField: "title", DetailsField: "details", DetailsJSONField: "details_json", OwnerField: "owner_id"},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "task", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateTaskInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Task.UpdateOneID(entityID).SetInput(decoded)

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "task", Operation: refOpQuery}

			entities, err := client.Task.Query().
				Where(task.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "task", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Task.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Task.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "task", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
	}
	SchemaTemplate = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Template",
			Snake: "template",
			Lower: "template",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "template", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Template.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTrustCenter = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TrustCenter",
			Snake: "trust_center",
			Lower: "trustcenter",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "trust_center", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TrustCenter.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTrustCenterCompliance = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TrustCenterCompliance",
			Snake: "trust_center_compliance",
			Lower: "trustcentercompliance",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "trust_center_compliance", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TrustCenterCompliance.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTrustCenterDoc = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TrustCenterDoc",
			Snake: "trust_center_doc",
			Lower: "trustcenterdoc",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "trust_center_doc", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TrustCenterDoc.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTrustCenterEntity = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TrustCenterEntity",
			Snake: "trust_center_entity",
			Lower: "trustcenterentity",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "trust_center_entity", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TrustCenterEntity.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTrustCenterFAQ = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TrustCenterFAQ",
			Snake: "trust_center_faq",
			Lower: "trustcenterfaq",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "trust_center_faq", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TrustCenterFAQ.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTrustCenterNDARequest = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TrustCenterNDARequest",
			Snake: "trust_center_nda_request",
			Lower: "trustcenterndarequest",
		},
		ConsoleRoute: &ConsoleRoute{Base: "trust-center/NDAs"},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "trust_center_nda_request", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TrustCenterNDARequest.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTrustCenterSetting = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TrustCenterSetting",
			Snake: "trust_center_setting",
			Lower: "trustcentersetting",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "trust_center_setting", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TrustCenterSetting.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTrustCenterSubprocessor = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TrustCenterSubprocessor",
			Snake: "trust_center_subprocessor",
			Lower: "trustcentersubprocessor",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "trust_center_subprocessor", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TrustCenterSubprocessor.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaTrustCenterWatermarkConfig = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "TrustCenterWatermarkConfig",
			Snake: "trust_center_watermark_config",
			Lower: "trustcenterwatermarkconfig",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "trust_center_watermark_config", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.TrustCenterWatermarkConfig.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaUser = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "User",
			Snake: "user",
			Lower: "user",
		},
		ProjectionType: reflect.TypeFor[UserProjection](),
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "user", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.User.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaUserSetting = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "UserSetting",
			Snake: "user_setting",
			Lower: "usersetting",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "user_setting", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.UserSetting.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaVendorRiskScore = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "VendorRiskScore",
			Snake: "vendor_risk_score",
			Lower: "vendorriskscore",
		},
		ProjectionType: reflect.TypeFor[VendorRiskScoreProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "vendor_risk_score", Operation: refOpQuery}

			entities, err := client.VendorRiskScore.Query().
				Where(vendorriskscore.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "vendor_risk_score", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.VendorRiskScore.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaVendorScoringConfig = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "VendorScoringConfig",
			Snake: "vendor_scoring_config",
			Lower: "vendorscoringconfig",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "vendor_scoring_config", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.VendorScoringConfig.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaVulnerability = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:             "Vulnerability",
			Snake:            "vulnerability",
			Lower:            "vulnerability",
			WorkflowEligible: true,
		},
		ProjectionType:        reflect.TypeFor[VulnerabilityProjection](),
		IntegrationM2MEdge:    "integrations",
		IntegrationRunM2MEdge: "integration_runs",
		Lookup: []LookupAlternative{
			{Fields: []string{"external_id"}},
		},
		Create: func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error) {
			ref := SchemaRef{Schema: "vulnerability", Operation: refOpCreate}

			decoded, err := jsonx.Decode[generated.CreateVulnerabilityInput](input)
			if err != nil {
				return "", logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Vulnerability.Create().SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return "", logError(ctx, ref, ErrCreateFailed, err)
			}

			entity, err := builder.Save(ctx)
			if err != nil {
				return "", logPersistError(ctx, ref, ErrCreateFailed, err)
			}

			return entity.ID, nil
		},
		Update: func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error {
			ref := SchemaRef{Schema: "vulnerability", Operation: refOpUpdate, EntityID: entityID}

			decoded, err := jsonx.Decode[generated.UpdateVulnerabilityInput](applyClears(input))
			if err != nil {
				return logError(ctx, ref, ErrDecodeFailed, err)
			}

			builder := client.Vulnerability.UpdateOneID(entityID).SetInput(decoded)

			if err := applyStampedFields(builder.Mutation(), input, FieldIntegrationRunID, FieldManagedBy, FieldSourceDefinitionID, FieldSourceDefinitionVersion, FieldSourceInstanceID); err != nil {
				return logError(ctx, ref, ErrUpdateFailed, err)
			}

			if err := builder.Exec(ctx); err != nil {
				return logPersistError(ctx, ref, ErrUpdateFailed, err)
			}

			return nil
		},
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "vulnerability", Operation: refOpQuery}

			entities, err := client.Vulnerability.Query().
				Where(vulnerability.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "vulnerability", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Vulnerability.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
		LoadObject: func(ctx context.Context, client *generated.Client, entityID string) (any, error) {
			entity, err := client.Vulnerability.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, SchemaRef{Schema: "vulnerability", Operation: refOpLoad, EntityID: entityID}, ErrLoadFailed, err)
			}

			return entity, nil
		},
		Ingest: &IngestCapability{
			Topic: gala.NamespacedTopic[IngestRequest](IngestTopics, "vulnerability.ingest.requested"),
		},
	}
	SchemaWebauthn = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "Webauthn",
			Snake: "webauthn",
			Lower: "webauthn",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "webauthn", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.Webauthn.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaWorkflowAssignment = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "WorkflowAssignment",
			Snake: "workflow_assignment",
			Lower: "workflowassignment",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "workflow_assignment", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.WorkflowAssignment.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaWorkflowAssignmentTarget = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "WorkflowAssignmentTarget",
			Snake: "workflow_assignment_target",
			Lower: "workflowassignmenttarget",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "workflow_assignment_target", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.WorkflowAssignmentTarget.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaWorkflowDefinition = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "WorkflowDefinition",
			Snake: "workflow_definition",
			Lower: "workflowdefinition",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "workflow_definition", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.WorkflowDefinition.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaWorkflowEvent = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "WorkflowEvent",
			Snake: "workflow_event",
			Lower: "workflowevent",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "workflow_event", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.WorkflowEvent.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaWorkflowInstance = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "WorkflowInstance",
			Snake: "workflow_instance",
			Lower: "workflowinstance",
		},
		IntegrationFKField: "integration_id",
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "workflow_instance", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.WorkflowInstance.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaWorkflowObjectRef = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "WorkflowObjectRef",
			Snake: "workflow_object_ref",
			Lower: "workflowobjectref",
		},
		ProjectionType: reflect.TypeFor[WorkflowObjectRefProjection](),
		Query: func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error) {
			ref := SchemaRef{Schema: "workflow_object_ref", Operation: refOpQuery}

			entities, err := client.WorkflowObjectRef.Query().
				Where(workflowobjectref.OwnerID(orgID)).
				All(ctx)
			if err != nil {
				return nil, logError(ctx, ref, ErrQueryFailed, err)
			}

			results := make([]json.RawMessage, 0, len(entities))
			for _, e := range entities {
				data, err := json.Marshal(e)
				if err != nil {
					logError(ctx, ref, ErrMarshalFailed, err)
					continue
				}

				results = append(results, data)
			}

			return results, nil
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "workflow_object_ref", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.WorkflowObjectRef.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
	SchemaWorkflowProposal = &Schema{
		SchemaDescriptor: SchemaDescriptor{
			Name:  "WorkflowProposal",
			Snake: "workflow_proposal",
			Lower: "workflowproposal",
		},
		Load: func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error) {
			ref := SchemaRef{Schema: "workflow_proposal", Operation: refOpLoad, EntityID: entityID}

			entity, err := client.WorkflowProposal.Get(ctx, entityID)
			if err != nil {
				return nil, logError(ctx, ref, ErrLoadFailed, err)
			}

			data, err := json.Marshal(entity)
			if err != nil {
				return nil, logError(ctx, ref, ErrMarshalFailed, err)
			}

			return data, nil
		},
	}
)
View Source
var ActionPlanFields = struct {
	// ActionPlanKindID is the action_plan_kind_id field
	ActionPlanKindID FieldDescriptor
	// ActionPlanKindName is the action_plan_kind_name field
	ActionPlanKindName FieldDescriptor
	// ApprovalRequired is the approval_required field
	ApprovalRequired FieldDescriptor
	// ApproverID is the approver_id field
	ApproverID FieldDescriptor
	// Blocked is the blocked field
	Blocked FieldDescriptor
	// BlockerReason is the blocker_reason field
	BlockerReason FieldDescriptor
	// CompletedAt is the completed_at field
	CompletedAt FieldDescriptor
	// ControlSuggestions is the control_suggestions field
	ControlSuggestions FieldDescriptor
	// DelegateID is the delegate_id field
	DelegateID FieldDescriptor
	// Description is the description field
	Description FieldDescriptor
	// Details is the details field
	Details FieldDescriptor
	// DetailsJSON is the details_json field
	DetailsJSON FieldDescriptor
	// DismissedControlSuggestions is the dismissed_control_suggestions field
	DismissedControlSuggestions FieldDescriptor
	// DismissedImprovementSuggestions is the dismissed_improvement_suggestions field
	DismissedImprovementSuggestions FieldDescriptor
	// DismissedTagSuggestions is the dismissed_tag_suggestions field
	DismissedTagSuggestions FieldDescriptor
	// DueDate is the due_date field
	DueDate FieldDescriptor
	// ExternalContents is the external_contents field
	ExternalContents FieldDescriptor
	// ExternalFileID is the external_file_id field
	ExternalFileID FieldDescriptor
	// ImprovementSuggestions is the improvement_suggestions field
	ImprovementSuggestions FieldDescriptor
	// InternalNotes is the internal_notes field
	InternalNotes FieldDescriptor
	// ManagementMode is the management_mode field
	ManagementMode FieldDescriptor
	// Metadata is the metadata field
	Metadata FieldDescriptor
	// Name is the name field
	Name FieldDescriptor
	// Priority is the priority field
	Priority FieldDescriptor
	// RawPayload is the raw_payload field
	RawPayload FieldDescriptor
	// RequiresApproval is the requires_approval field
	RequiresApproval FieldDescriptor
	// ReviewDue is the review_due field
	ReviewDue FieldDescriptor
	// ReviewFrequency is the review_frequency field
	ReviewFrequency FieldDescriptor
	// Revision is the revision field
	Revision FieldDescriptor
	// Source is the source field
	Source FieldDescriptor
	// Status is the status field
	Status FieldDescriptor
	// SystemInternalID is the system_internal_id field
	SystemInternalID FieldDescriptor
	// TagSuggestions is the tag_suggestions field
	TagSuggestions FieldDescriptor
	// Tags is the tags field
	Tags FieldDescriptor
	// Title is the title field
	Title FieldDescriptor
	// URL is the url field
	URL FieldDescriptor
}{
	ActionPlanKindID:                FieldDescriptor{Name: "action_plan_kind_id", InputKey: "action_plan_kind_id"},
	ActionPlanKindName:              FieldDescriptor{Name: "action_plan_kind_name", InputKey: "action_plan_kind_name"},
	ApprovalRequired:                FieldDescriptor{Name: "approval_required", InputKey: "approval_required"},
	ApproverID:                      FieldDescriptor{Name: "approver_id", InputKey: "approver_id"},
	Blocked:                         FieldDescriptor{Name: "blocked", InputKey: "blocked"},
	BlockerReason:                   FieldDescriptor{Name: "blocker_reason", InputKey: "blocker_reason"},
	CompletedAt:                     FieldDescriptor{Name: "completed_at", InputKey: "completed_at"},
	ControlSuggestions:              FieldDescriptor{Name: "control_suggestions", InputKey: "control_suggestions"},
	DelegateID:                      FieldDescriptor{Name: "delegate_id", InputKey: "delegate_id"},
	Description:                     FieldDescriptor{Name: "description", InputKey: "description"},
	Details:                         FieldDescriptor{Name: "details", InputKey: "details"},
	DetailsJSON:                     FieldDescriptor{Name: "details_json", InputKey: "details_json"},
	DismissedControlSuggestions:     FieldDescriptor{Name: "dismissed_control_suggestions", InputKey: "dismissed_control_suggestions"},
	DismissedImprovementSuggestions: FieldDescriptor{Name: "dismissed_improvement_suggestions", InputKey: "dismissed_improvement_suggestions"},
	DismissedTagSuggestions:         FieldDescriptor{Name: "dismissed_tag_suggestions", InputKey: "dismissed_tag_suggestions"},
	DueDate:                         FieldDescriptor{Name: "due_date", InputKey: "due_date"},
	ExternalContents:                FieldDescriptor{Name: "external_contents", InputKey: "external_contents"},
	ExternalFileID:                  FieldDescriptor{Name: "external_file_id", InputKey: "external_file_id"},
	ImprovementSuggestions:          FieldDescriptor{Name: "improvement_suggestions", InputKey: "improvement_suggestions"},
	InternalNotes:                   FieldDescriptor{Name: "internal_notes", InputKey: "internal_notes"},
	ManagementMode:                  FieldDescriptor{Name: "management_mode", InputKey: "management_mode"},
	Metadata:                        FieldDescriptor{Name: "metadata", InputKey: "metadata"},
	Name:                            FieldDescriptor{Name: "name", InputKey: "name"},
	Priority:                        FieldDescriptor{Name: "priority", InputKey: "priority"},
	RawPayload:                      FieldDescriptor{Name: "raw_payload", InputKey: "raw_payload"},
	RequiresApproval:                FieldDescriptor{Name: "requires_approval", InputKey: "requires_approval"},
	ReviewDue:                       FieldDescriptor{Name: "review_due", InputKey: "review_due"},
	ReviewFrequency:                 FieldDescriptor{Name: "review_frequency", InputKey: "review_frequency"},
	Revision:                        FieldDescriptor{Name: "revision", InputKey: "revision"},
	Source:                          FieldDescriptor{Name: "source", InputKey: "source"},
	Status:                          FieldDescriptor{Name: "status", InputKey: "status"},
	SystemInternalID:                FieldDescriptor{Name: "system_internal_id", InputKey: "system_internal_id"},
	TagSuggestions:                  FieldDescriptor{Name: "tag_suggestions", InputKey: "tag_suggestions"},
	Tags:                            FieldDescriptor{Name: "tags", InputKey: "tags"},
	Title:                           FieldDescriptor{Name: "title", InputKey: "title"},
	URL:                             FieldDescriptor{Name: "url", InputKey: "url"},
}

ActionPlanFields indexes the provider-mappable fields of ActionPlan

AllMutationOps is every operation including soft deletes

View Source
var AssetFields = struct {
	// AccessModelID is the access_model_id field
	AccessModelID FieldDescriptor
	// AccessModelName is the access_model_name field
	AccessModelName FieldDescriptor
	// AssetDataClassificationID is the asset_data_classification_id field
	AssetDataClassificationID FieldDescriptor
	// AssetDataClassificationName is the asset_data_classification_name field
	AssetDataClassificationName FieldDescriptor
	// AssetSubtypeID is the asset_subtype_id field
	AssetSubtypeID FieldDescriptor
	// AssetSubtypeName is the asset_subtype_name field
	AssetSubtypeName FieldDescriptor
	// AssetType is the asset_type field
	AssetType FieldDescriptor
	// Categories is the categories field
	Categories FieldDescriptor
	// ContainsPii is the contains_pii field
	ContainsPii FieldDescriptor
	// CostCenter is the cost_center field
	CostCenter FieldDescriptor
	// CriticalityID is the criticality_id field
	CriticalityID FieldDescriptor
	// CriticalityName is the criticality_name field
	CriticalityName FieldDescriptor
	// Description is the description field
	Description FieldDescriptor
	// DisplayName is the display_name field
	DisplayName FieldDescriptor
	// EncryptionStatusID is the encryption_status_id field
	EncryptionStatusID FieldDescriptor
	// EncryptionStatusName is the encryption_status_name field
	EncryptionStatusName FieldDescriptor
	// EnvironmentID is the environment_id field
	EnvironmentID FieldDescriptor
	// EnvironmentName is the environment_name field
	EnvironmentName FieldDescriptor
	// EstimatedMonthlyCost is the estimated_monthly_cost field
	EstimatedMonthlyCost FieldDescriptor
	// Identifier is the identifier field
	Identifier FieldDescriptor
	// InternalNotes is the internal_notes field
	InternalNotes FieldDescriptor
	// InternalOwner is the internal_owner field
	InternalOwner FieldDescriptor
	// InternalOwnerGroupID is the internal_owner_group_id field
	InternalOwnerGroupID FieldDescriptor
	// InternalOwnerIdentityHolderID is the internal_owner_identity_holder_id field
	InternalOwnerIdentityHolderID FieldDescriptor
	// InternalOwnerUserID is the internal_owner_user_id field
	InternalOwnerUserID FieldDescriptor
	// Name is the name field
	Name FieldDescriptor
	// ObservedAt is the observed_at field
	ObservedAt FieldDescriptor
	// PhysicalLocation is the physical_location field
	PhysicalLocation FieldDescriptor
	// PurchaseDate is the purchase_date field
	PurchaseDate FieldDescriptor
	// Region is the region field
	Region FieldDescriptor
	// ScopeID is the scope_id field
	ScopeID FieldDescriptor
	// ScopeName is the scope_name field
	ScopeName FieldDescriptor
	// SecurityTierID is the security_tier_id field
	SecurityTierID FieldDescriptor
	// SecurityTierName is the security_tier_name field
	SecurityTierName FieldDescriptor
	// SourceIdentifier is the source_identifier field
	SourceIdentifier FieldDescriptor
	// SourceType is the source_type field
	SourceType FieldDescriptor
	// SystemInternalID is the system_internal_id field
	SystemInternalID FieldDescriptor
	// Tags is the tags field
	Tags FieldDescriptor
	// Website is the website field
	Website FieldDescriptor
}{
	AccessModelID:                 FieldDescriptor{Name: "access_model_id", InputKey: "access_model_id"},
	AccessModelName:               FieldDescriptor{Name: "access_model_name", InputKey: "access_model_name"},
	AssetDataClassificationID:     FieldDescriptor{Name: "asset_data_classification_id", InputKey: "asset_data_classification_id"},
	AssetDataClassificationName:   FieldDescriptor{Name: "asset_data_classification_name", InputKey: "asset_data_classification_name"},
	AssetSubtypeID:                FieldDescriptor{Name: "asset_subtype_id", InputKey: "asset_subtype_id"},
	AssetSubtypeName:              FieldDescriptor{Name: "asset_subtype_name", InputKey: "asset_subtype_name"},
	AssetType:                     FieldDescriptor{Name: "asset_type", InputKey: "asset_type"},
	Categories:                    FieldDescriptor{Name: "categories", InputKey: "categories"},
	ContainsPii:                   FieldDescriptor{Name: "contains_pii", InputKey: "contains_pii"},
	CostCenter:                    FieldDescriptor{Name: "cost_center", InputKey: "cost_center"},
	CriticalityID:                 FieldDescriptor{Name: "criticality_id", InputKey: "criticality_id"},
	CriticalityName:               FieldDescriptor{Name: "criticality_name", InputKey: "criticality_name"},
	Description:                   FieldDescriptor{Name: "description", InputKey: "description"},
	DisplayName:                   FieldDescriptor{Name: "display_name", InputKey: "display_name"},
	EncryptionStatusID:            FieldDescriptor{Name: "encryption_status_id", InputKey: "encryption_status_id"},
	EncryptionStatusName:          FieldDescriptor{Name: "encryption_status_name", InputKey: "encryption_status_name"},
	EnvironmentID:                 FieldDescriptor{Name: "environment_id", InputKey: "environment_id"},
	EnvironmentName:               FieldDescriptor{Name: "environment_name", InputKey: "environment_name"},
	EstimatedMonthlyCost:          FieldDescriptor{Name: "estimated_monthly_cost", InputKey: "estimated_monthly_cost"},
	Identifier:                    FieldDescriptor{Name: "identifier", InputKey: "identifier"},
	InternalNotes:                 FieldDescriptor{Name: "internal_notes", InputKey: "internal_notes"},
	InternalOwner:                 FieldDescriptor{Name: "internal_owner", InputKey: "internal_owner"},
	InternalOwnerGroupID:          FieldDescriptor{Name: "internal_owner_group_id", InputKey: "internal_owner_group_id"},
	InternalOwnerIdentityHolderID: FieldDescriptor{Name: "internal_owner_identity_holder_id", InputKey: "internal_owner_identity_holder_id"},
	InternalOwnerUserID:           FieldDescriptor{Name: "internal_owner_user_id", InputKey: "internal_owner_user_id"},
	Name:                          FieldDescriptor{Name: "name", InputKey: "name"},
	ObservedAt:                    FieldDescriptor{Name: "observed_at", InputKey: "observed_at"},
	PhysicalLocation:              FieldDescriptor{Name: "physical_location", InputKey: "physical_location"},
	PurchaseDate:                  FieldDescriptor{Name: "purchase_date", InputKey: "purchase_date"},
	Region:                        FieldDescriptor{Name: "region", InputKey: "region"},
	ScopeID:                       FieldDescriptor{Name: "scope_id", InputKey: "scope_id"},
	ScopeName:                     FieldDescriptor{Name: "scope_name", InputKey: "scope_name"},
	SecurityTierID:                FieldDescriptor{Name: "security_tier_id", InputKey: "security_tier_id"},
	SecurityTierName:              FieldDescriptor{Name: "security_tier_name", InputKey: "security_tier_name"},
	SourceIdentifier:              FieldDescriptor{Name: "source_identifier", InputKey: "source_identifier"},
	SourceType:                    FieldDescriptor{Name: "source_type", InputKey: "source_type"},
	SystemInternalID:              FieldDescriptor{Name: "system_internal_id", InputKey: "system_internal_id"},
	Tags:                          FieldDescriptor{Name: "tags", InputKey: "tags"},
	Website:                       FieldDescriptor{Name: "website", InputKey: "website"},
}

AssetFields indexes the provider-mappable fields of Asset

View Source
var CheckResultFields = struct {
	// Details is the details field
	Details FieldDescriptor
	// ExternalURI is the external_uri field
	ExternalURI FieldDescriptor
	// LastObservedAt is the last_observed_at field
	LastObservedAt FieldDescriptor
	// ParentExternalID is the parent_external_id field
	ParentExternalID FieldDescriptor
	// Source is the source field
	Source FieldDescriptor
	// Status is the status field
	Status FieldDescriptor
	// Tags is the tags field
	Tags FieldDescriptor
}{
	Details:          FieldDescriptor{Name: "details", InputKey: "details"},
	ExternalURI:      FieldDescriptor{Name: "external_uri", InputKey: "external_uri"},
	LastObservedAt:   FieldDescriptor{Name: "last_observed_at", InputKey: "last_observed_at"},
	ParentExternalID: FieldDescriptor{Name: "parent_external_id", InputKey: "parent_external_id"},
	Source:           FieldDescriptor{Name: "source", InputKey: "source"},
	Status:           FieldDescriptor{Name: "status", InputKey: "status"},
	Tags:             FieldDescriptor{Name: "tags", InputKey: "tags"},
}

CheckResultFields indexes the provider-mappable fields of CheckResult

View Source
var ContactFields = struct {
	// Address is the address field
	Address FieldDescriptor
	// Company is the company field
	Company FieldDescriptor
	// Email is the email field
	Email FieldDescriptor
	// ExternalID is the external_id field
	ExternalID FieldDescriptor
	// FullName is the full_name field
	FullName FieldDescriptor
	// ObservedAt is the observed_at field
	ObservedAt FieldDescriptor
	// PhoneNumber is the phone_number field
	PhoneNumber FieldDescriptor
	// Status is the status field
	Status FieldDescriptor
	// Tags is the tags field
	Tags FieldDescriptor
	// Title is the title field
	Title FieldDescriptor
}{
	Address:     FieldDescriptor{Name: "address", InputKey: "address"},
	Company:     FieldDescriptor{Name: "company", InputKey: "company"},
	Email:       FieldDescriptor{Name: "email", InputKey: "email"},
	ExternalID:  FieldDescriptor{Name: "external_id", InputKey: "external_id"},
	FullName:    FieldDescriptor{Name: "full_name", InputKey: "full_name"},
	ObservedAt:  FieldDescriptor{Name: "observed_at", InputKey: "observed_at"},
	PhoneNumber: FieldDescriptor{Name: "phone_number", InputKey: "phone_number"},
	Status:      FieldDescriptor{Name: "status", InputKey: "status"},
	Tags:        FieldDescriptor{Name: "tags", InputKey: "tags"},
	Title:       FieldDescriptor{Name: "title", InputKey: "title"},
}

ContactFields indexes the provider-mappable fields of Contact

View Source
var DirectoryAccountFields = struct {
	// AccountType is the account_type field
	AccountType FieldDescriptor
	// AddedAt is the added_at field
	AddedAt FieldDescriptor
	// AvatarRemoteURL is the avatar_remote_url field
	AvatarRemoteURL FieldDescriptor
	// AvatarUpdatedAt is the avatar_updated_at field
	AvatarUpdatedAt FieldDescriptor
	// CanonicalEmail is the canonical_email field
	CanonicalEmail FieldDescriptor
	// Department is the department field
	Department FieldDescriptor
	// DirectoryName is the directory_name field
	DirectoryName FieldDescriptor
	// DisplayName is the display_name field
	DisplayName FieldDescriptor
	// EmailAliases is the email_aliases field
	EmailAliases FieldDescriptor
	// EnvironmentID is the environment_id field
	EnvironmentID FieldDescriptor
	// EnvironmentName is the environment_name field
	EnvironmentName FieldDescriptor
	// ExternalID is the external_id field
	ExternalID FieldDescriptor
	// FamilyName is the family_name field
	FamilyName FieldDescriptor
	// GivenName is the given_name field
	GivenName FieldDescriptor
	// IdentityHolderID is the identity_holder_id field
	IdentityHolderID FieldDescriptor
	// JobTitle is the job_title field
	JobTitle FieldDescriptor
	// LastSeenIP is the last_seen_ip field
	LastSeenIP FieldDescriptor
	// Metadata is the metadata field
	Metadata FieldDescriptor
	// MfaState is the mfa_state field
	MfaState FieldDescriptor
	// ObservedAt is the observed_at field
	ObservedAt FieldDescriptor
	// OrganizationUnit is the organization_unit field
	OrganizationUnit FieldDescriptor
	// PhoneNumber is the phone_number field
	PhoneNumber FieldDescriptor
	// PrimarySource is the primary_source field
	PrimarySource FieldDescriptor
	// Profile is the profile field
	Profile FieldDescriptor
	// RemovedAt is the removed_at field
	RemovedAt FieldDescriptor
	// ScopeID is the scope_id field
	ScopeID FieldDescriptor
	// ScopeName is the scope_name field
	ScopeName FieldDescriptor
	// SecondaryKey is the secondary_key field
	SecondaryKey FieldDescriptor
	// SourceVersion is the source_version field
	SourceVersion FieldDescriptor
	// Status is the status field
	Status FieldDescriptor
	// Tags is the tags field
	Tags FieldDescriptor
}{
	AccountType:      FieldDescriptor{Name: "account_type", InputKey: "account_type"},
	AddedAt:          FieldDescriptor{Name: "added_at", InputKey: "added_at"},
	AvatarRemoteURL:  FieldDescriptor{Name: "avatar_remote_url", InputKey: "avatar_remote_url"},
	AvatarUpdatedAt:  FieldDescriptor{Name: "avatar_updated_at", InputKey: "avatar_updated_at"},
	CanonicalEmail:   FieldDescriptor{Name: "canonical_email", InputKey: "canonical_email"},
	Department:       FieldDescriptor{Name: "department", InputKey: "department"},
	DirectoryName:    FieldDescriptor{Name: "directory_name", InputKey: "directory_name"},
	DisplayName:      FieldDescriptor{Name: "display_name", InputKey: "display_name"},
	EmailAliases:     FieldDescriptor{Name: "email_aliases", InputKey: "email_aliases"},
	EnvironmentID:    FieldDescriptor{Name: "environment_id", InputKey: "environment_id"},
	EnvironmentName:  FieldDescriptor{Name: "environment_name", InputKey: "environment_name"},
	ExternalID:       FieldDescriptor{Name: "external_id", InputKey: "external_id"},
	FamilyName:       FieldDescriptor{Name: "family_name", InputKey: "family_name"},
	GivenName:        FieldDescriptor{Name: "given_name", InputKey: "given_name"},
	IdentityHolderID: FieldDescriptor{Name: "identity_holder_id", InputKey: "identity_holder_id"},
	JobTitle:         FieldDescriptor{Name: "job_title", InputKey: "job_title"},
	LastSeenIP:       FieldDescriptor{Name: "last_seen_ip", InputKey: "last_seen_ip"},
	Metadata:         FieldDescriptor{Name: "metadata", InputKey: "metadata"},
	MfaState:         FieldDescriptor{Name: "mfa_state", InputKey: "mfa_state"},
	ObservedAt:       FieldDescriptor{Name: "observed_at", InputKey: "observed_at"},
	OrganizationUnit: FieldDescriptor{Name: "organization_unit", InputKey: "organization_unit"},
	PhoneNumber:      FieldDescriptor{Name: "phone_number", InputKey: "phone_number"},
	PrimarySource:    FieldDescriptor{Name: "primary_source", InputKey: "primary_source"},
	Profile:          FieldDescriptor{Name: "profile", InputKey: "profile"},
	RemovedAt:        FieldDescriptor{Name: "removed_at", InputKey: "removed_at"},
	ScopeID:          FieldDescriptor{Name: "scope_id", InputKey: "scope_id"},
	ScopeName:        FieldDescriptor{Name: "scope_name", InputKey: "scope_name"},
	SecondaryKey:     FieldDescriptor{Name: "secondary_key", InputKey: "secondary_key"},
	SourceVersion:    FieldDescriptor{Name: "source_version", InputKey: "source_version"},
	Status:           FieldDescriptor{Name: "status", InputKey: "status"},
	Tags:             FieldDescriptor{Name: "tags", InputKey: "tags"},
}

DirectoryAccountFields indexes the provider-mappable fields of DirectoryAccount

View Source
var DirectoryGroupFields = struct {
	// AddedAt is the added_at field
	AddedAt FieldDescriptor
	// Classification is the classification field
	Classification FieldDescriptor
	// DirectoryName is the directory_name field
	DirectoryName FieldDescriptor
	// DisplayName is the display_name field
	DisplayName FieldDescriptor
	// Email is the email field
	Email FieldDescriptor
	// EnvironmentID is the environment_id field
	EnvironmentID FieldDescriptor
	// EnvironmentName is the environment_name field
	EnvironmentName FieldDescriptor
	// ExternalID is the external_id field
	ExternalID FieldDescriptor
	// ExternalSharingAllowed is the external_sharing_allowed field
	ExternalSharingAllowed FieldDescriptor
	// MemberCount is the member_count field
	MemberCount FieldDescriptor
	// Metadata is the metadata field
	Metadata FieldDescriptor
	// ObservedAt is the observed_at field
	ObservedAt FieldDescriptor
	// Profile is the profile field
	Profile FieldDescriptor
	// RemovedAt is the removed_at field
	RemovedAt FieldDescriptor
	// ScopeID is the scope_id field
	ScopeID FieldDescriptor
	// ScopeName is the scope_name field
	ScopeName FieldDescriptor
	// SourceVersion is the source_version field
	SourceVersion FieldDescriptor
	// Status is the status field
	Status FieldDescriptor
	// Tags is the tags field
	Tags FieldDescriptor
}{
	AddedAt:                FieldDescriptor{Name: "added_at", InputKey: "added_at"},
	Classification:         FieldDescriptor{Name: "classification", InputKey: "classification"},
	DirectoryName:          FieldDescriptor{Name: "directory_name", InputKey: "directory_name"},
	DisplayName:            FieldDescriptor{Name: "display_name", InputKey: "display_name"},
	Email:                  FieldDescriptor{Name: "email", InputKey: "email"},
	EnvironmentID:          FieldDescriptor{Name: "environment_id", InputKey: "environment_id"},
	EnvironmentName:        FieldDescriptor{Name: "environment_name", InputKey: "environment_name"},
	ExternalID:             FieldDescriptor{Name: "external_id", InputKey: "external_id"},
	ExternalSharingAllowed: FieldDescriptor{Name: "external_sharing_allowed", InputKey: "external_sharing_allowed"},
	MemberCount:            FieldDescriptor{Name: "member_count", InputKey: "member_count"},
	Metadata:               FieldDescriptor{Name: "metadata", InputKey: "metadata"},
	ObservedAt:             FieldDescriptor{Name: "observed_at", InputKey: "observed_at"},
	Profile:                FieldDescriptor{Name: "profile", InputKey: "profile"},
	RemovedAt:              FieldDescriptor{Name: "removed_at", InputKey: "removed_at"},
	ScopeID:                FieldDescriptor{Name: "scope_id", InputKey: "scope_id"},
	ScopeName:              FieldDescriptor{Name: "scope_name", InputKey: "scope_name"},
	SourceVersion:          FieldDescriptor{Name: "source_version", InputKey: "source_version"},
	Status:                 FieldDescriptor{Name: "status", InputKey: "status"},
	Tags:                   FieldDescriptor{Name: "tags", InputKey: "tags"},
}

DirectoryGroupFields indexes the provider-mappable fields of DirectoryGroup

View Source
var DirectoryMembershipFields = struct {
	// AddedAt is the added_at field
	AddedAt FieldDescriptor
	// DirectoryAccountID is the directory_account_id field
	DirectoryAccountID FieldDescriptor
	// DirectoryGroupID is the directory_group_id field
	DirectoryGroupID FieldDescriptor
	// DirectoryName is the directory_name field
	DirectoryName FieldDescriptor
	// EnvironmentID is the environment_id field
	EnvironmentID FieldDescriptor
	// EnvironmentName is the environment_name field
	EnvironmentName FieldDescriptor
	// Metadata is the metadata field
	Metadata FieldDescriptor
	// ObservedAt is the observed_at field
	ObservedAt FieldDescriptor
	// PlatformID is the platform_id field
	PlatformID FieldDescriptor
	// RemovedAt is the removed_at field
	RemovedAt FieldDescriptor
	// Role is the role field
	Role FieldDescriptor
	// ScopeID is the scope_id field
	ScopeID FieldDescriptor
	// ScopeName is the scope_name field
	ScopeName FieldDescriptor
	// Source is the source field
	Source FieldDescriptor
}{
	AddedAt:            FieldDescriptor{Name: "added_at", InputKey: "added_at"},
	DirectoryAccountID: FieldDescriptor{Name: "directory_account_id", InputKey: "directory_account_id"},
	DirectoryGroupID:   FieldDescriptor{Name: "directory_group_id", InputKey: "directory_group_id"},
	DirectoryName:      FieldDescriptor{Name: "directory_name", InputKey: "directory_name"},
	EnvironmentID:      FieldDescriptor{Name: "environment_id", InputKey: "environment_id"},
	EnvironmentName:    FieldDescriptor{Name: "environment_name", InputKey: "environment_name"},
	Metadata:           FieldDescriptor{Name: "metadata", InputKey: "metadata"},
	ObservedAt:         FieldDescriptor{Name: "observed_at", InputKey: "observed_at"},
	PlatformID:         FieldDescriptor{Name: "platform_id", InputKey: "platform_id"},
	RemovedAt:          FieldDescriptor{Name: "removed_at", InputKey: "removed_at"},
	Role:               FieldDescriptor{Name: "role", InputKey: "role"},
	ScopeID:            FieldDescriptor{Name: "scope_id", InputKey: "scope_id"},
	ScopeName:          FieldDescriptor{Name: "scope_name", InputKey: "scope_name"},
	Source:             FieldDescriptor{Name: "source", InputKey: "source"},
}

DirectoryMembershipFields indexes the provider-mappable fields of DirectoryMembership

View Source
var EntityFields = struct {
	// Aliases is the aliases field
	Aliases FieldDescriptor
	// AnnualSpend is the annual_spend field
	AnnualSpend FieldDescriptor
	// ApprovedForUse is the approved_for_use field
	ApprovedForUse FieldDescriptor
	// AutoRenews is the auto_renews field
	AutoRenews FieldDescriptor
	// BillingModel is the billing_model field
	BillingModel FieldDescriptor
	// ContractEndDate is the contract_end_date field
	ContractEndDate FieldDescriptor
	// ContractRenewalAt is the contract_renewal_at field
	ContractRenewalAt FieldDescriptor
	// ContractStartDate is the contract_start_date field
	ContractStartDate FieldDescriptor
	// Description is the description field
	Description FieldDescriptor
	// DisplayName is the display_name field
	DisplayName FieldDescriptor
	// Domains is the domains field
	Domains FieldDescriptor
	// EntityRelationshipStateID is the entity_relationship_state_id field
	EntityRelationshipStateID FieldDescriptor
	// EntityRelationshipStateName is the entity_relationship_state_name field
	EntityRelationshipStateName FieldDescriptor
	// EntitySecurityQuestionnaireStatusID is the entity_security_questionnaire_status_id field
	EntitySecurityQuestionnaireStatusID FieldDescriptor
	// EntitySecurityQuestionnaireStatusName is the entity_security_questionnaire_status_name field
	EntitySecurityQuestionnaireStatusName FieldDescriptor
	// EntitySourceTypeID is the entity_source_type_id field
	EntitySourceTypeID FieldDescriptor
	// EntitySourceTypeName is the entity_source_type_name field
	EntitySourceTypeName FieldDescriptor
	// EnvironmentID is the environment_id field
	EnvironmentID FieldDescriptor
	// EnvironmentName is the environment_name field
	EnvironmentName FieldDescriptor
	// ExternalID is the external_id field
	ExternalID FieldDescriptor
	// HasSoc2 is the has_soc2 field
	HasSoc2 FieldDescriptor
	// InternalNotes is the internal_notes field
	InternalNotes FieldDescriptor
	// InternalOwner is the internal_owner field
	InternalOwner FieldDescriptor
	// InternalOwnerGroupID is the internal_owner_group_id field
	InternalOwnerGroupID FieldDescriptor
	// InternalOwnerIdentityHolderID is the internal_owner_identity_holder_id field
	InternalOwnerIdentityHolderID FieldDescriptor
	// InternalOwnerUserID is the internal_owner_user_id field
	InternalOwnerUserID FieldDescriptor
	// LastReviewedAt is the last_reviewed_at field
	LastReviewedAt FieldDescriptor
	// Links is the links field
	Links FieldDescriptor
	// LogoRemoteURL is the logo_remote_url field
	LogoRemoteURL FieldDescriptor
	// MfaEnforced is the mfa_enforced field
	MfaEnforced FieldDescriptor
	// MfaSupported is the mfa_supported field
	MfaSupported FieldDescriptor
	// Name is the name field
	Name FieldDescriptor
	// NextReviewAt is the next_review_at field
	NextReviewAt FieldDescriptor
	// ObservedAt is the observed_at field
	ObservedAt FieldDescriptor
	// ProvidedServices is the provided_services field
	ProvidedServices FieldDescriptor
	// RenewalRisk is the renewal_risk field
	RenewalRisk FieldDescriptor
	// ReviewFrequency is the review_frequency field
	ReviewFrequency FieldDescriptor
	// ReviewedBy is the reviewed_by field
	ReviewedBy FieldDescriptor
	// ReviewedByGroupID is the reviewed_by_group_id field
	ReviewedByGroupID FieldDescriptor
	// ReviewedByIdentityHolderID is the reviewed_by_identity_holder_id field
	ReviewedByIdentityHolderID FieldDescriptor
	// ReviewedByUserID is the reviewed_by_user_id field
	ReviewedByUserID FieldDescriptor
	// RiskRating is the risk_rating field
	RiskRating FieldDescriptor
	// RiskScore is the risk_score field
	RiskScore FieldDescriptor
	// ScopeID is the scope_id field
	ScopeID FieldDescriptor
	// ScopeName is the scope_name field
	ScopeName FieldDescriptor
	// Soc2PeriodEnd is the soc2_period_end field
	Soc2PeriodEnd FieldDescriptor
	// SpendCurrency is the spend_currency field
	SpendCurrency FieldDescriptor
	// SSOEnforced is the sso_enforced field
	SSOEnforced FieldDescriptor
	// Status is the status field
	Status FieldDescriptor
	// StatusPageURL is the status_page_url field
	StatusPageURL FieldDescriptor
	// SystemInternalID is the system_internal_id field
	SystemInternalID FieldDescriptor
	// Tags is the tags field
	Tags FieldDescriptor
	// TerminationNoticeDays is the termination_notice_days field
	TerminationNoticeDays FieldDescriptor
	// Tier is the tier field
	Tier FieldDescriptor
	// VendorMetadata is the vendor_metadata field
	VendorMetadata FieldDescriptor
}{
	Aliases:                               FieldDescriptor{Name: "aliases", InputKey: "aliases"},
	AnnualSpend:                           FieldDescriptor{Name: "annual_spend", InputKey: "annual_spend"},
	ApprovedForUse:                        FieldDescriptor{Name: "approved_for_use", InputKey: "approved_for_use"},
	AutoRenews:                            FieldDescriptor{Name: "auto_renews", InputKey: "auto_renews"},
	BillingModel:                          FieldDescriptor{Name: "billing_model", InputKey: "billing_model"},
	ContractEndDate:                       FieldDescriptor{Name: "contract_end_date", InputKey: "contract_end_date"},
	ContractRenewalAt:                     FieldDescriptor{Name: "contract_renewal_at", InputKey: "contract_renewal_at"},
	ContractStartDate:                     FieldDescriptor{Name: "contract_start_date", InputKey: "contract_start_date"},
	Description:                           FieldDescriptor{Name: "description", InputKey: "description"},
	DisplayName:                           FieldDescriptor{Name: "display_name", InputKey: "display_name"},
	Domains:                               FieldDescriptor{Name: "domains", InputKey: "domains"},
	EntityRelationshipStateID:             FieldDescriptor{Name: "entity_relationship_state_id", InputKey: "entity_relationship_state_id"},
	EntityRelationshipStateName:           FieldDescriptor{Name: "entity_relationship_state_name", InputKey: "entity_relationship_state_name"},
	EntitySecurityQuestionnaireStatusID:   FieldDescriptor{Name: "entity_security_questionnaire_status_id", InputKey: "entity_security_questionnaire_status_id"},
	EntitySecurityQuestionnaireStatusName: FieldDescriptor{Name: "entity_security_questionnaire_status_name", InputKey: "entity_security_questionnaire_status_name"},
	EntitySourceTypeID:                    FieldDescriptor{Name: "entity_source_type_id", InputKey: "entity_source_type_id"},
	EntitySourceTypeName:                  FieldDescriptor{Name: "entity_source_type_name", InputKey: "entity_source_type_name"},
	EnvironmentID:                         FieldDescriptor{Name: "environment_id", InputKey: "environment_id"},
	EnvironmentName:                       FieldDescriptor{Name: "environment_name", InputKey: "environment_name"},
	ExternalID:                            FieldDescriptor{Name: "external_id", InputKey: "external_id"},
	HasSoc2:                               FieldDescriptor{Name: "has_soc2", InputKey: "has_soc2"},
	InternalNotes:                         FieldDescriptor{Name: "internal_notes", InputKey: "internal_notes"},
	InternalOwner:                         FieldDescriptor{Name: "internal_owner", InputKey: "internal_owner"},
	InternalOwnerGroupID:                  FieldDescriptor{Name: "internal_owner_group_id", InputKey: "internal_owner_group_id"},
	InternalOwnerIdentityHolderID:         FieldDescriptor{Name: "internal_owner_identity_holder_id", InputKey: "internal_owner_identity_holder_id"},
	InternalOwnerUserID:                   FieldDescriptor{Name: "internal_owner_user_id", InputKey: "internal_owner_user_id"},
	LastReviewedAt:                        FieldDescriptor{Name: "last_reviewed_at", InputKey: "last_reviewed_at"},
	Links:                                 FieldDescriptor{Name: "links", InputKey: "links"},
	LogoRemoteURL:                         FieldDescriptor{Name: "logo_remote_url", InputKey: "logo_remote_url"},
	MfaEnforced:                           FieldDescriptor{Name: "mfa_enforced", InputKey: "mfa_enforced"},
	MfaSupported:                          FieldDescriptor{Name: "mfa_supported", InputKey: "mfa_supported"},
	Name:                                  FieldDescriptor{Name: "name", InputKey: "name"},
	NextReviewAt:                          FieldDescriptor{Name: "next_review_at", InputKey: "next_review_at"},
	ObservedAt:                            FieldDescriptor{Name: "observed_at", InputKey: "observed_at"},
	ProvidedServices:                      FieldDescriptor{Name: "provided_services", InputKey: "provided_services"},
	RenewalRisk:                           FieldDescriptor{Name: "renewal_risk", InputKey: "renewal_risk"},
	ReviewFrequency:                       FieldDescriptor{Name: "review_frequency", InputKey: "review_frequency"},
	ReviewedBy:                            FieldDescriptor{Name: "reviewed_by", InputKey: "reviewed_by"},
	ReviewedByGroupID:                     FieldDescriptor{Name: "reviewed_by_group_id", InputKey: "reviewed_by_group_id"},
	ReviewedByIdentityHolderID:            FieldDescriptor{Name: "reviewed_by_identity_holder_id", InputKey: "reviewed_by_identity_holder_id"},
	ReviewedByUserID:                      FieldDescriptor{Name: "reviewed_by_user_id", InputKey: "reviewed_by_user_id"},
	RiskRating:                            FieldDescriptor{Name: "risk_rating", InputKey: "risk_rating"},
	RiskScore:                             FieldDescriptor{Name: "risk_score", InputKey: "risk_score"},
	ScopeID:                               FieldDescriptor{Name: "scope_id", InputKey: "scope_id"},
	ScopeName:                             FieldDescriptor{Name: "scope_name", InputKey: "scope_name"},
	Soc2PeriodEnd:                         FieldDescriptor{Name: "soc2_period_end", InputKey: "soc2_period_end"},
	SpendCurrency:                         FieldDescriptor{Name: "spend_currency", InputKey: "spend_currency"},
	SSOEnforced:                           FieldDescriptor{Name: "sso_enforced", InputKey: "sso_enforced"},
	Status:                                FieldDescriptor{Name: "status", InputKey: "status"},
	StatusPageURL:                         FieldDescriptor{Name: "status_page_url", InputKey: "status_page_url"},
	SystemInternalID:                      FieldDescriptor{Name: "system_internal_id", InputKey: "system_internal_id"},
	Tags:                                  FieldDescriptor{Name: "tags", InputKey: "tags"},
	TerminationNoticeDays:                 FieldDescriptor{Name: "termination_notice_days", InputKey: "termination_notice_days"},
	Tier:                                  FieldDescriptor{Name: "tier", InputKey: "tier"},
	VendorMetadata:                        FieldDescriptor{Name: "vendor_metadata", InputKey: "vendor_metadata"},
}

EntityFields indexes the provider-mappable fields of Entity

View Source
var FindingFields = struct {
	// AssessmentID is the assessment_id field
	AssessmentID FieldDescriptor
	// AssignedTo is the assigned_to field
	AssignedTo FieldDescriptor
	// AssignedToGroupID is the assigned_to_group_id field
	AssignedToGroupID FieldDescriptor
	// AssignedToIdentityHolderID is the assigned_to_identity_holder_id field
	AssignedToIdentityHolderID FieldDescriptor
	// AssignedToUserID is the assigned_to_user_id field
	AssignedToUserID FieldDescriptor
	// BlocksProduction is the blocks_production field
	BlocksProduction FieldDescriptor
	// Categories is the categories field
	Categories FieldDescriptor
	// Category is the category field
	Category FieldDescriptor
	// Description is the description field
	Description FieldDescriptor
	// DisplayName is the display_name field
	DisplayName FieldDescriptor
	// EnvironmentID is the environment_id field
	EnvironmentID FieldDescriptor
	// EnvironmentName is the environment_name field
	EnvironmentName FieldDescriptor
	// EventTime is the event_time field
	EventTime FieldDescriptor
	// Exploitability is the exploitability field
	Exploitability FieldDescriptor
	// ExternalID is the external_id field
	ExternalID FieldDescriptor
	// ExternalOwnerID is the external_owner_id field
	ExternalOwnerID FieldDescriptor
	// ExternalURI is the external_uri field
	ExternalURI FieldDescriptor
	// FindingClass is the finding_class field
	FindingClass FieldDescriptor
	// FindingStatusID is the finding_status_id field
	FindingStatusID FieldDescriptor
	// FindingStatusName is the finding_status_name field
	FindingStatusName FieldDescriptor
	// Impact is the impact field
	Impact FieldDescriptor
	// InternalNotes is the internal_notes field
	InternalNotes FieldDescriptor
	// InternalOwner is the internal_owner field
	InternalOwner FieldDescriptor
	// InternalOwnerGroupID is the internal_owner_group_id field
	InternalOwnerGroupID FieldDescriptor
	// InternalOwnerIdentityHolderID is the internal_owner_identity_holder_id field
	InternalOwnerIdentityHolderID FieldDescriptor
	// InternalOwnerUserID is the internal_owner_user_id field
	InternalOwnerUserID FieldDescriptor
	// Metadata is the metadata field
	Metadata FieldDescriptor
	// NumericSeverity is the numeric_severity field
	NumericSeverity FieldDescriptor
	// Open is the open field
	Open FieldDescriptor
	// Priority is the priority field
	Priority FieldDescriptor
	// Production is the production field
	Production FieldDescriptor
	// Public is the public field
	Public FieldDescriptor
	// RawPayload is the raw_payload field
	RawPayload FieldDescriptor
	// Recommendation is the recommendation field
	Recommendation FieldDescriptor
	// RecommendedActions is the recommended_actions field
	RecommendedActions FieldDescriptor
	// References is the references field
	References FieldDescriptor
	// RemediationSLA is the remediation_sla field
	RemediationSLA FieldDescriptor
	// ReportedAt is the reported_at field
	ReportedAt FieldDescriptor
	// ResourceName is the resource_name field
	ResourceName FieldDescriptor
	// ReviewedBy is the reviewed_by field
	ReviewedBy FieldDescriptor
	// ReviewedByGroupID is the reviewed_by_group_id field
	ReviewedByGroupID FieldDescriptor
	// ReviewedByIdentityHolderID is the reviewed_by_identity_holder_id field
	ReviewedByIdentityHolderID FieldDescriptor
	// ReviewedByUserID is the reviewed_by_user_id field
	ReviewedByUserID FieldDescriptor
	// ScopeID is the scope_id field
	ScopeID FieldDescriptor
	// ScopeName is the scope_name field
	ScopeName FieldDescriptor
	// Score is the score field
	Score FieldDescriptor
	// Severity is the severity field
	Severity FieldDescriptor
	// Source is the source field
	Source FieldDescriptor
	// SourceUpdatedAt is the source_updated_at field
	SourceUpdatedAt FieldDescriptor
	// State is the state field
	State FieldDescriptor
	// StepsToReproduce is the steps_to_reproduce field
	StepsToReproduce FieldDescriptor
	// SystemInternalID is the system_internal_id field
	SystemInternalID FieldDescriptor
	// Tags is the tags field
	Tags FieldDescriptor
	// TargetDetails is the target_details field
	TargetDetails FieldDescriptor
	// Targets is the targets field
	Targets FieldDescriptor
	// Validated is the validated field
	Validated FieldDescriptor
	// Vector is the vector field
	Vector FieldDescriptor
}{
	AssessmentID:                  FieldDescriptor{Name: "assessment_id", InputKey: "assessment_id"},
	AssignedTo:                    FieldDescriptor{Name: "assigned_to", InputKey: "assigned_to"},
	AssignedToGroupID:             FieldDescriptor{Name: "assigned_to_group_id", InputKey: "assigned_to_group_id"},
	AssignedToIdentityHolderID:    FieldDescriptor{Name: "assigned_to_identity_holder_id", InputKey: "assigned_to_identity_holder_id"},
	AssignedToUserID:              FieldDescriptor{Name: "assigned_to_user_id", InputKey: "assigned_to_user_id"},
	BlocksProduction:              FieldDescriptor{Name: "blocks_production", InputKey: "blocks_production"},
	Categories:                    FieldDescriptor{Name: "categories", InputKey: "categories"},
	Category:                      FieldDescriptor{Name: "category", InputKey: "category"},
	Description:                   FieldDescriptor{Name: "description", InputKey: "description"},
	DisplayName:                   FieldDescriptor{Name: "display_name", InputKey: "display_name"},
	EnvironmentID:                 FieldDescriptor{Name: "environment_id", InputKey: "environment_id"},
	EnvironmentName:               FieldDescriptor{Name: "environment_name", InputKey: "environment_name"},
	EventTime:                     FieldDescriptor{Name: "event_time", InputKey: "event_time"},
	Exploitability:                FieldDescriptor{Name: "exploitability", InputKey: "exploitability"},
	ExternalID:                    FieldDescriptor{Name: "external_id", InputKey: "external_id"},
	ExternalOwnerID:               FieldDescriptor{Name: "external_owner_id", InputKey: "external_owner_id"},
	ExternalURI:                   FieldDescriptor{Name: "external_uri", InputKey: "external_uri"},
	FindingClass:                  FieldDescriptor{Name: "finding_class", InputKey: "finding_class"},
	FindingStatusID:               FieldDescriptor{Name: "finding_status_id", InputKey: "finding_status_id"},
	FindingStatusName:             FieldDescriptor{Name: "finding_status_name", InputKey: "finding_status_name"},
	Impact:                        FieldDescriptor{Name: "impact", InputKey: "impact"},
	InternalNotes:                 FieldDescriptor{Name: "internal_notes", InputKey: "internal_notes"},
	InternalOwner:                 FieldDescriptor{Name: "internal_owner", InputKey: "internal_owner"},
	InternalOwnerGroupID:          FieldDescriptor{Name: "internal_owner_group_id", InputKey: "internal_owner_group_id"},
	InternalOwnerIdentityHolderID: FieldDescriptor{Name: "internal_owner_identity_holder_id", InputKey: "internal_owner_identity_holder_id"},
	InternalOwnerUserID:           FieldDescriptor{Name: "internal_owner_user_id", InputKey: "internal_owner_user_id"},
	Metadata:                      FieldDescriptor{Name: "metadata", InputKey: "metadata"},
	NumericSeverity:               FieldDescriptor{Name: "numeric_severity", InputKey: "numeric_severity"},
	Open:                          FieldDescriptor{Name: "open", InputKey: "open"},
	Priority:                      FieldDescriptor{Name: "priority", InputKey: "priority"},
	Production:                    FieldDescriptor{Name: "production", InputKey: "production"},
	Public:                        FieldDescriptor{Name: "public", InputKey: "public"},
	RawPayload:                    FieldDescriptor{Name: "raw_payload", InputKey: "raw_payload"},
	Recommendation:                FieldDescriptor{Name: "recommendation", InputKey: "recommendation"},
	RecommendedActions:            FieldDescriptor{Name: "recommended_actions", InputKey: "recommended_actions"},
	References:                    FieldDescriptor{Name: "references", InputKey: "references"},
	RemediationSLA:                FieldDescriptor{Name: "remediation_sla", InputKey: "remediation_sla"},
	ReportedAt:                    FieldDescriptor{Name: "reported_at", InputKey: "reported_at"},
	ResourceName:                  FieldDescriptor{Name: "resource_name", InputKey: "resource_name"},
	ReviewedBy:                    FieldDescriptor{Name: "reviewed_by", InputKey: "reviewed_by"},
	ReviewedByGroupID:             FieldDescriptor{Name: "reviewed_by_group_id", InputKey: "reviewed_by_group_id"},
	ReviewedByIdentityHolderID:    FieldDescriptor{Name: "reviewed_by_identity_holder_id", InputKey: "reviewed_by_identity_holder_id"},
	ReviewedByUserID:              FieldDescriptor{Name: "reviewed_by_user_id", InputKey: "reviewed_by_user_id"},
	ScopeID:                       FieldDescriptor{Name: "scope_id", InputKey: "scope_id"},
	ScopeName:                     FieldDescriptor{Name: "scope_name", InputKey: "scope_name"},
	Score:                         FieldDescriptor{Name: "score", InputKey: "score"},
	Severity:                      FieldDescriptor{Name: "severity", InputKey: "severity"},
	Source:                        FieldDescriptor{Name: "source", InputKey: "source"},
	SourceUpdatedAt:               FieldDescriptor{Name: "source_updated_at", InputKey: "source_updated_at"},
	State:                         FieldDescriptor{Name: "state", InputKey: "state"},
	StepsToReproduce:              FieldDescriptor{Name: "steps_to_reproduce", InputKey: "steps_to_reproduce"},
	SystemInternalID:              FieldDescriptor{Name: "system_internal_id", InputKey: "system_internal_id"},
	Tags:                          FieldDescriptor{Name: "tags", InputKey: "tags"},
	TargetDetails:                 FieldDescriptor{Name: "target_details", InputKey: "target_details"},
	Targets:                       FieldDescriptor{Name: "targets", InputKey: "targets"},
	Validated:                     FieldDescriptor{Name: "validated", InputKey: "validated"},
	Vector:                        FieldDescriptor{Name: "vector", InputKey: "vector"},
}

FindingFields indexes the provider-mappable fields of Finding

View Source
var IngestTopics = gala.IntegrationIngest.At("entityops")

IngestTopics is the namespace for every generated asynchronous schema-ingest topic.

View Source
var InternalPolicyFields = struct {
	// ApprovalRequired is the approval_required field
	ApprovalRequired FieldDescriptor
	// ApproverID is the approver_id field
	ApproverID FieldDescriptor
	// ControlSuggestions is the control_suggestions field
	ControlSuggestions FieldDescriptor
	// DelegateID is the delegate_id field
	DelegateID FieldDescriptor
	// Details is the details field
	Details FieldDescriptor
	// DetailsJSON is the details_json field
	DetailsJSON FieldDescriptor
	// DismissedControlSuggestions is the dismissed_control_suggestions field
	DismissedControlSuggestions FieldDescriptor
	// DismissedImprovementSuggestions is the dismissed_improvement_suggestions field
	DismissedImprovementSuggestions FieldDescriptor
	// DismissedTagSuggestions is the dismissed_tag_suggestions field
	DismissedTagSuggestions FieldDescriptor
	// EnvironmentID is the environment_id field
	EnvironmentID FieldDescriptor
	// EnvironmentName is the environment_name field
	EnvironmentName FieldDescriptor
	// ExternalContents is the external_contents field
	ExternalContents FieldDescriptor
	// ExternalFileID is the external_file_id field
	ExternalFileID FieldDescriptor
	// ExternalUUID is the external_uuid field
	ExternalUUID FieldDescriptor
	// ImprovementSuggestions is the improvement_suggestions field
	ImprovementSuggestions FieldDescriptor
	// InternalNotes is the internal_notes field
	InternalNotes FieldDescriptor
	// InternalPolicyKindID is the internal_policy_kind_id field
	InternalPolicyKindID FieldDescriptor
	// InternalPolicyKindName is the internal_policy_kind_name field
	InternalPolicyKindName FieldDescriptor
	// ManagementMode is the management_mode field
	ManagementMode FieldDescriptor
	// Name is the name field
	Name FieldDescriptor
	// ReviewDue is the review_due field
	ReviewDue FieldDescriptor
	// ReviewFrequency is the review_frequency field
	ReviewFrequency FieldDescriptor
	// Revision is the revision field
	Revision FieldDescriptor
	// ScopeID is the scope_id field
	ScopeID FieldDescriptor
	// ScopeName is the scope_name field
	ScopeName FieldDescriptor
	// Status is the status field
	Status FieldDescriptor
	// SystemInternalID is the system_internal_id field
	SystemInternalID FieldDescriptor
	// TagSuggestions is the tag_suggestions field
	TagSuggestions FieldDescriptor
	// Tags is the tags field
	Tags FieldDescriptor
	// URL is the url field
	URL FieldDescriptor
}{
	ApprovalRequired:                FieldDescriptor{Name: "approval_required", InputKey: "approval_required"},
	ApproverID:                      FieldDescriptor{Name: "approver_id", InputKey: "approver_id"},
	ControlSuggestions:              FieldDescriptor{Name: "control_suggestions", InputKey: "control_suggestions"},
	DelegateID:                      FieldDescriptor{Name: "delegate_id", InputKey: "delegate_id"},
	Details:                         FieldDescriptor{Name: "details", InputKey: "details"},
	DetailsJSON:                     FieldDescriptor{Name: "details_json", InputKey: "details_json"},
	DismissedControlSuggestions:     FieldDescriptor{Name: "dismissed_control_suggestions", InputKey: "dismissed_control_suggestions"},
	DismissedImprovementSuggestions: FieldDescriptor{Name: "dismissed_improvement_suggestions", InputKey: "dismissed_improvement_suggestions"},
	DismissedTagSuggestions:         FieldDescriptor{Name: "dismissed_tag_suggestions", InputKey: "dismissed_tag_suggestions"},
	EnvironmentID:                   FieldDescriptor{Name: "environment_id", InputKey: "environment_id"},
	EnvironmentName:                 FieldDescriptor{Name: "environment_name", InputKey: "environment_name"},
	ExternalContents:                FieldDescriptor{Name: "external_contents", InputKey: "external_contents"},
	ExternalFileID:                  FieldDescriptor{Name: "external_file_id", InputKey: "external_file_id"},
	ExternalUUID:                    FieldDescriptor{Name: "external_uuid", InputKey: "external_uuid"},
	ImprovementSuggestions:          FieldDescriptor{Name: "improvement_suggestions", InputKey: "improvement_suggestions"},
	InternalNotes:                   FieldDescriptor{Name: "internal_notes", InputKey: "internal_notes"},
	InternalPolicyKindID:            FieldDescriptor{Name: "internal_policy_kind_id", InputKey: "internal_policy_kind_id"},
	InternalPolicyKindName:          FieldDescriptor{Name: "internal_policy_kind_name", InputKey: "internal_policy_kind_name"},
	ManagementMode:                  FieldDescriptor{Name: "management_mode", InputKey: "management_mode"},
	Name:                            FieldDescriptor{Name: "name", InputKey: "name"},
	ReviewDue:                       FieldDescriptor{Name: "review_due", InputKey: "review_due"},
	ReviewFrequency:                 FieldDescriptor{Name: "review_frequency", InputKey: "review_frequency"},
	Revision:                        FieldDescriptor{Name: "revision", InputKey: "revision"},
	ScopeID:                         FieldDescriptor{Name: "scope_id", InputKey: "scope_id"},
	ScopeName:                       FieldDescriptor{Name: "scope_name", InputKey: "scope_name"},
	Status:                          FieldDescriptor{Name: "status", InputKey: "status"},
	SystemInternalID:                FieldDescriptor{Name: "system_internal_id", InputKey: "system_internal_id"},
	TagSuggestions:                  FieldDescriptor{Name: "tag_suggestions", InputKey: "tag_suggestions"},
	Tags:                            FieldDescriptor{Name: "tags", InputKey: "tags"},
	URL:                             FieldDescriptor{Name: "url", InputKey: "url"},
}

InternalPolicyFields indexes the provider-mappable fields of InternalPolicy

View Source
var ProcedureFields = struct {
	// ApprovalRequired is the approval_required field
	ApprovalRequired FieldDescriptor
	// ApproverID is the approver_id field
	ApproverID FieldDescriptor
	// ControlSuggestions is the control_suggestions field
	ControlSuggestions FieldDescriptor
	// DelegateID is the delegate_id field
	DelegateID FieldDescriptor
	// Details is the details field
	Details FieldDescriptor
	// DetailsJSON is the details_json field
	DetailsJSON FieldDescriptor
	// DismissedControlSuggestions is the dismissed_control_suggestions field
	DismissedControlSuggestions FieldDescriptor
	// DismissedImprovementSuggestions is the dismissed_improvement_suggestions field
	DismissedImprovementSuggestions FieldDescriptor
	// DismissedTagSuggestions is the dismissed_tag_suggestions field
	DismissedTagSuggestions FieldDescriptor
	// EnvironmentID is the environment_id field
	EnvironmentID FieldDescriptor
	// EnvironmentName is the environment_name field
	EnvironmentName FieldDescriptor
	// ExternalContents is the external_contents field
	ExternalContents FieldDescriptor
	// ExternalFileID is the external_file_id field
	ExternalFileID FieldDescriptor
	// ImprovementSuggestions is the improvement_suggestions field
	ImprovementSuggestions FieldDescriptor
	// InternalNotes is the internal_notes field
	InternalNotes FieldDescriptor
	// ManagementMode is the management_mode field
	ManagementMode FieldDescriptor
	// Name is the name field
	Name FieldDescriptor
	// ProcedureKindID is the procedure_kind_id field
	ProcedureKindID FieldDescriptor
	// ProcedureKindName is the procedure_kind_name field
	ProcedureKindName FieldDescriptor
	// ReviewDue is the review_due field
	ReviewDue FieldDescriptor
	// ReviewFrequency is the review_frequency field
	ReviewFrequency FieldDescriptor
	// Revision is the revision field
	Revision FieldDescriptor
	// ScopeID is the scope_id field
	ScopeID FieldDescriptor
	// ScopeName is the scope_name field
	ScopeName FieldDescriptor
	// Status is the status field
	Status FieldDescriptor
	// SystemInternalID is the system_internal_id field
	SystemInternalID FieldDescriptor
	// TagSuggestions is the tag_suggestions field
	TagSuggestions FieldDescriptor
	// Tags is the tags field
	Tags FieldDescriptor
	// URL is the url field
	URL FieldDescriptor
}{
	ApprovalRequired:                FieldDescriptor{Name: "approval_required", InputKey: "approval_required"},
	ApproverID:                      FieldDescriptor{Name: "approver_id", InputKey: "approver_id"},
	ControlSuggestions:              FieldDescriptor{Name: "control_suggestions", InputKey: "control_suggestions"},
	DelegateID:                      FieldDescriptor{Name: "delegate_id", InputKey: "delegate_id"},
	Details:                         FieldDescriptor{Name: "details", InputKey: "details"},
	DetailsJSON:                     FieldDescriptor{Name: "details_json", InputKey: "details_json"},
	DismissedControlSuggestions:     FieldDescriptor{Name: "dismissed_control_suggestions", InputKey: "dismissed_control_suggestions"},
	DismissedImprovementSuggestions: FieldDescriptor{Name: "dismissed_improvement_suggestions", InputKey: "dismissed_improvement_suggestions"},
	DismissedTagSuggestions:         FieldDescriptor{Name: "dismissed_tag_suggestions", InputKey: "dismissed_tag_suggestions"},
	EnvironmentID:                   FieldDescriptor{Name: "environment_id", InputKey: "environment_id"},
	EnvironmentName:                 FieldDescriptor{Name: "environment_name", InputKey: "environment_name"},
	ExternalContents:                FieldDescriptor{Name: "external_contents", InputKey: "external_contents"},
	ExternalFileID:                  FieldDescriptor{Name: "external_file_id", InputKey: "external_file_id"},
	ImprovementSuggestions:          FieldDescriptor{Name: "improvement_suggestions", InputKey: "improvement_suggestions"},
	InternalNotes:                   FieldDescriptor{Name: "internal_notes", InputKey: "internal_notes"},
	ManagementMode:                  FieldDescriptor{Name: "management_mode", InputKey: "management_mode"},
	Name:                            FieldDescriptor{Name: "name", InputKey: "name"},
	ProcedureKindID:                 FieldDescriptor{Name: "procedure_kind_id", InputKey: "procedure_kind_id"},
	ProcedureKindName:               FieldDescriptor{Name: "procedure_kind_name", InputKey: "procedure_kind_name"},
	ReviewDue:                       FieldDescriptor{Name: "review_due", InputKey: "review_due"},
	ReviewFrequency:                 FieldDescriptor{Name: "review_frequency", InputKey: "review_frequency"},
	Revision:                        FieldDescriptor{Name: "revision", InputKey: "revision"},
	ScopeID:                         FieldDescriptor{Name: "scope_id", InputKey: "scope_id"},
	ScopeName:                       FieldDescriptor{Name: "scope_name", InputKey: "scope_name"},
	Status:                          FieldDescriptor{Name: "status", InputKey: "status"},
	SystemInternalID:                FieldDescriptor{Name: "system_internal_id", InputKey: "system_internal_id"},
	TagSuggestions:                  FieldDescriptor{Name: "tag_suggestions", InputKey: "tag_suggestions"},
	Tags:                            FieldDescriptor{Name: "tags", InputKey: "tags"},
	URL:                             FieldDescriptor{Name: "url", InputKey: "url"},
}

ProcedureFields indexes the provider-mappable fields of Procedure

RegularMutationOps is every operation except soft deletes; empty listener Operations expand to this set so soft deletes stay explicit opt-in

View Source
var RiskFields = struct {
	// BusinessCosts is the business_costs field
	BusinessCosts FieldDescriptor
	// BusinessCostsJSON is the business_costs_json field
	BusinessCostsJSON FieldDescriptor
	// DelegateGroupID is the delegate_group_id field
	DelegateGroupID FieldDescriptor
	// DelegateIdentityHolderID is the delegate_identity_holder_id field
	DelegateIdentityHolderID FieldDescriptor
	// DelegateName is the delegate_name field
	DelegateName FieldDescriptor
	// DelegateUserID is the delegate_user_id field
	DelegateUserID FieldDescriptor
	// Details is the details field
	Details FieldDescriptor
	// DetailsJSON is the details_json field
	DetailsJSON FieldDescriptor
	// DueDate is the due_date field
	DueDate FieldDescriptor
	// EnvironmentID is the environment_id field
	EnvironmentID FieldDescriptor
	// EnvironmentName is the environment_name field
	EnvironmentName FieldDescriptor
	// ExternalID is the external_id field
	ExternalID FieldDescriptor
	// ExternalUUID is the external_uuid field
	ExternalUUID FieldDescriptor
	// Impact is the impact field
	Impact FieldDescriptor
	// LastReviewedAt is the last_reviewed_at field
	LastReviewedAt FieldDescriptor
	// Likelihood is the likelihood field
	Likelihood FieldDescriptor
	// MitigatedAt is the mitigated_at field
	MitigatedAt FieldDescriptor
	// Mitigation is the mitigation field
	Mitigation FieldDescriptor
	// MitigationJSON is the mitigation_json field
	MitigationJSON FieldDescriptor
	// Name is the name field
	Name FieldDescriptor
	// NextReviewDueAt is the next_review_due_at field
	NextReviewDueAt FieldDescriptor
	// ObservedAt is the observed_at field
	ObservedAt FieldDescriptor
	// ResidualScore is the residual_score field
	ResidualScore FieldDescriptor
	// ReviewFrequency is the review_frequency field
	ReviewFrequency FieldDescriptor
	// ReviewRequired is the review_required field
	ReviewRequired FieldDescriptor
	// RiskCategoryID is the risk_category_id field
	RiskCategoryID FieldDescriptor
	// RiskCategoryName is the risk_category_name field
	RiskCategoryName FieldDescriptor
	// RiskDecision is the risk_decision field
	RiskDecision FieldDescriptor
	// RiskKindID is the risk_kind_id field
	RiskKindID FieldDescriptor
	// RiskKindName is the risk_kind_name field
	RiskKindName FieldDescriptor
	// ScopeID is the scope_id field
	ScopeID FieldDescriptor
	// ScopeName is the scope_name field
	ScopeName FieldDescriptor
	// Score is the score field
	Score FieldDescriptor
	// StakeholderGroupID is the stakeholder_group_id field
	StakeholderGroupID FieldDescriptor
	// StakeholderIdentityHolderID is the stakeholder_identity_holder_id field
	StakeholderIdentityHolderID FieldDescriptor
	// StakeholderName is the stakeholder_name field
	StakeholderName FieldDescriptor
	// StakeholderUserID is the stakeholder_user_id field
	StakeholderUserID FieldDescriptor
	// Status is the status field
	Status FieldDescriptor
	// Tags is the tags field
	Tags FieldDescriptor
}{
	BusinessCosts:               FieldDescriptor{Name: "business_costs", InputKey: "business_costs"},
	BusinessCostsJSON:           FieldDescriptor{Name: "business_costs_json", InputKey: "business_costs_json"},
	DelegateGroupID:             FieldDescriptor{Name: "delegate_group_id", InputKey: "delegate_group_id"},
	DelegateIdentityHolderID:    FieldDescriptor{Name: "delegate_identity_holder_id", InputKey: "delegate_identity_holder_id"},
	DelegateName:                FieldDescriptor{Name: "delegate_name", InputKey: "delegate_name"},
	DelegateUserID:              FieldDescriptor{Name: "delegate_user_id", InputKey: "delegate_user_id"},
	Details:                     FieldDescriptor{Name: "details", InputKey: "details"},
	DetailsJSON:                 FieldDescriptor{Name: "details_json", InputKey: "details_json"},
	DueDate:                     FieldDescriptor{Name: "due_date", InputKey: "due_date"},
	EnvironmentID:               FieldDescriptor{Name: "environment_id", InputKey: "environment_id"},
	EnvironmentName:             FieldDescriptor{Name: "environment_name", InputKey: "environment_name"},
	ExternalID:                  FieldDescriptor{Name: "external_id", InputKey: "external_id"},
	ExternalUUID:                FieldDescriptor{Name: "external_uuid", InputKey: "external_uuid"},
	Impact:                      FieldDescriptor{Name: "impact", InputKey: "impact"},
	LastReviewedAt:              FieldDescriptor{Name: "last_reviewed_at", InputKey: "last_reviewed_at"},
	Likelihood:                  FieldDescriptor{Name: "likelihood", InputKey: "likelihood"},
	MitigatedAt:                 FieldDescriptor{Name: "mitigated_at", InputKey: "mitigated_at"},
	Mitigation:                  FieldDescriptor{Name: "mitigation", InputKey: "mitigation"},
	MitigationJSON:              FieldDescriptor{Name: "mitigation_json", InputKey: "mitigation_json"},
	Name:                        FieldDescriptor{Name: "name", InputKey: "name"},
	NextReviewDueAt:             FieldDescriptor{Name: "next_review_due_at", InputKey: "next_review_due_at"},
	ObservedAt:                  FieldDescriptor{Name: "observed_at", InputKey: "observed_at"},
	ResidualScore:               FieldDescriptor{Name: "residual_score", InputKey: "residual_score"},
	ReviewFrequency:             FieldDescriptor{Name: "review_frequency", InputKey: "review_frequency"},
	ReviewRequired:              FieldDescriptor{Name: "review_required", InputKey: "review_required"},
	RiskCategoryID:              FieldDescriptor{Name: "risk_category_id", InputKey: "risk_category_id"},
	RiskCategoryName:            FieldDescriptor{Name: "risk_category_name", InputKey: "risk_category_name"},
	RiskDecision:                FieldDescriptor{Name: "risk_decision", InputKey: "risk_decision"},
	RiskKindID:                  FieldDescriptor{Name: "risk_kind_id", InputKey: "risk_kind_id"},
	RiskKindName:                FieldDescriptor{Name: "risk_kind_name", InputKey: "risk_kind_name"},
	ScopeID:                     FieldDescriptor{Name: "scope_id", InputKey: "scope_id"},
	ScopeName:                   FieldDescriptor{Name: "scope_name", InputKey: "scope_name"},
	Score:                       FieldDescriptor{Name: "score", InputKey: "score"},
	StakeholderGroupID:          FieldDescriptor{Name: "stakeholder_group_id", InputKey: "stakeholder_group_id"},
	StakeholderIdentityHolderID: FieldDescriptor{Name: "stakeholder_identity_holder_id", InputKey: "stakeholder_identity_holder_id"},
	StakeholderName:             FieldDescriptor{Name: "stakeholder_name", InputKey: "stakeholder_name"},
	StakeholderUserID:           FieldDescriptor{Name: "stakeholder_user_id", InputKey: "stakeholder_user_id"},
	Status:                      FieldDescriptor{Name: "status", InputKey: "status"},
	Tags:                        FieldDescriptor{Name: "tags", InputKey: "tags"},
}

RiskFields indexes the provider-mappable fields of Risk

View Source
var VulnerabilityFields = struct {
	// AssignedTo is the assigned_to field
	AssignedTo FieldDescriptor
	// AssignedToGroupID is the assigned_to_group_id field
	AssignedToGroupID FieldDescriptor
	// AssignedToIdentityHolderID is the assigned_to_identity_holder_id field
	AssignedToIdentityHolderID FieldDescriptor
	// AssignedToUserID is the assigned_to_user_id field
	AssignedToUserID FieldDescriptor
	// AutoDismissedAt is the auto_dismissed_at field
	AutoDismissedAt FieldDescriptor
	// Blocking is the blocking field
	Blocking FieldDescriptor
	// Category is the category field
	Category FieldDescriptor
	// CveID is the cve_id field
	CveID FieldDescriptor
	// CweIds is the cwe_ids field
	CweIds FieldDescriptor
	// DependencyScope is the dependency_scope field
	DependencyScope FieldDescriptor
	// Description is the description field
	Description FieldDescriptor
	// DiscoveredAt is the discovered_at field
	DiscoveredAt FieldDescriptor
	// DismissedAt is the dismissed_at field
	DismissedAt FieldDescriptor
	// DismissedComment is the dismissed_comment field
	DismissedComment FieldDescriptor
	// DismissedReason is the dismissed_reason field
	DismissedReason FieldDescriptor
	// DisplayName is the display_name field
	DisplayName FieldDescriptor
	// EnvironmentID is the environment_id field
	EnvironmentID FieldDescriptor
	// EnvironmentName is the environment_name field
	EnvironmentName FieldDescriptor
	// Exploitability is the exploitability field
	Exploitability FieldDescriptor
	// ExternalID is the external_id field
	ExternalID FieldDescriptor
	// ExternalOwnerID is the external_owner_id field
	ExternalOwnerID FieldDescriptor
	// ExternalURI is the external_uri field
	ExternalURI FieldDescriptor
	// FirstPatchedVersion is the first_patched_version field
	FirstPatchedVersion FieldDescriptor
	// FixAvailable is the fix_available field
	FixAvailable FieldDescriptor
	// FixedAt is the fixed_at field
	FixedAt FieldDescriptor
	// Impact is the impact field
	Impact FieldDescriptor
	// Impacts is the impacts field
	Impacts FieldDescriptor
	// InternalNotes is the internal_notes field
	InternalNotes FieldDescriptor
	// InternalOwner is the internal_owner field
	InternalOwner FieldDescriptor
	// InternalOwnerGroupID is the internal_owner_group_id field
	InternalOwnerGroupID FieldDescriptor
	// InternalOwnerIdentityHolderID is the internal_owner_identity_holder_id field
	InternalOwnerIdentityHolderID FieldDescriptor
	// InternalOwnerUserID is the internal_owner_user_id field
	InternalOwnerUserID FieldDescriptor
	// ManifestPath is the manifest_path field
	ManifestPath FieldDescriptor
	// Metadata is the metadata field
	Metadata FieldDescriptor
	// Open is the open field
	Open FieldDescriptor
	// PackageEcosystem is the package_ecosystem field
	PackageEcosystem FieldDescriptor
	// PackageName is the package_name field
	PackageName FieldDescriptor
	// Priority is the priority field
	Priority FieldDescriptor
	// Production is the production field
	Production FieldDescriptor
	// Public is the public field
	Public FieldDescriptor
	// PublishedAt is the published_at field
	PublishedAt FieldDescriptor
	// RawPayload is the raw_payload field
	RawPayload FieldDescriptor
	// References is the references field
	References FieldDescriptor
	// RemediationSLA is the remediation_sla field
	RemediationSLA FieldDescriptor
	// ReviewedBy is the reviewed_by field
	ReviewedBy FieldDescriptor
	// ReviewedByGroupID is the reviewed_by_group_id field
	ReviewedByGroupID FieldDescriptor
	// ReviewedByIdentityHolderID is the reviewed_by_identity_holder_id field
	ReviewedByIdentityHolderID FieldDescriptor
	// ReviewedByUserID is the reviewed_by_user_id field
	ReviewedByUserID FieldDescriptor
	// ScopeID is the scope_id field
	ScopeID FieldDescriptor
	// ScopeName is the scope_name field
	ScopeName FieldDescriptor
	// Score is the score field
	Score FieldDescriptor
	// Severity is the severity field
	Severity FieldDescriptor
	// Source is the source field
	Source FieldDescriptor
	// SourceUpdatedAt is the source_updated_at field
	SourceUpdatedAt FieldDescriptor
	// Summary is the summary field
	Summary FieldDescriptor
	// SystemInternalID is the system_internal_id field
	SystemInternalID FieldDescriptor
	// Tags is the tags field
	Tags FieldDescriptor
	// Validated is the validated field
	Validated FieldDescriptor
	// Vector is the vector field
	Vector FieldDescriptor
	// VulnerabilityStatusID is the vulnerability_status_id field
	VulnerabilityStatusID FieldDescriptor
	// VulnerabilityStatusName is the vulnerability_status_name field
	VulnerabilityStatusName FieldDescriptor
	// VulnerableVersionRange is the vulnerable_version_range field
	VulnerableVersionRange FieldDescriptor
}{
	AssignedTo:                    FieldDescriptor{Name: "assigned_to", InputKey: "assigned_to"},
	AssignedToGroupID:             FieldDescriptor{Name: "assigned_to_group_id", InputKey: "assigned_to_group_id"},
	AssignedToIdentityHolderID:    FieldDescriptor{Name: "assigned_to_identity_holder_id", InputKey: "assigned_to_identity_holder_id"},
	AssignedToUserID:              FieldDescriptor{Name: "assigned_to_user_id", InputKey: "assigned_to_user_id"},
	AutoDismissedAt:               FieldDescriptor{Name: "auto_dismissed_at", InputKey: "auto_dismissed_at"},
	Blocking:                      FieldDescriptor{Name: "blocking", InputKey: "blocking"},
	Category:                      FieldDescriptor{Name: "category", InputKey: "category"},
	CveID:                         FieldDescriptor{Name: "cve_id", InputKey: "cve_id"},
	CweIds:                        FieldDescriptor{Name: "cwe_ids", InputKey: "cwe_ids"},
	DependencyScope:               FieldDescriptor{Name: "dependency_scope", InputKey: "dependency_scope"},
	Description:                   FieldDescriptor{Name: "description", InputKey: "description"},
	DiscoveredAt:                  FieldDescriptor{Name: "discovered_at", InputKey: "discovered_at"},
	DismissedAt:                   FieldDescriptor{Name: "dismissed_at", InputKey: "dismissed_at"},
	DismissedComment:              FieldDescriptor{Name: "dismissed_comment", InputKey: "dismissed_comment"},
	DismissedReason:               FieldDescriptor{Name: "dismissed_reason", InputKey: "dismissed_reason"},
	DisplayName:                   FieldDescriptor{Name: "display_name", InputKey: "display_name"},
	EnvironmentID:                 FieldDescriptor{Name: "environment_id", InputKey: "environment_id"},
	EnvironmentName:               FieldDescriptor{Name: "environment_name", InputKey: "environment_name"},
	Exploitability:                FieldDescriptor{Name: "exploitability", InputKey: "exploitability"},
	ExternalID:                    FieldDescriptor{Name: "external_id", InputKey: "external_id"},
	ExternalOwnerID:               FieldDescriptor{Name: "external_owner_id", InputKey: "external_owner_id"},
	ExternalURI:                   FieldDescriptor{Name: "external_uri", InputKey: "external_uri"},
	FirstPatchedVersion:           FieldDescriptor{Name: "first_patched_version", InputKey: "first_patched_version"},
	FixAvailable:                  FieldDescriptor{Name: "fix_available", InputKey: "fix_available"},
	FixedAt:                       FieldDescriptor{Name: "fixed_at", InputKey: "fixed_at"},
	Impact:                        FieldDescriptor{Name: "impact", InputKey: "impact"},
	Impacts:                       FieldDescriptor{Name: "impacts", InputKey: "impacts"},
	InternalNotes:                 FieldDescriptor{Name: "internal_notes", InputKey: "internal_notes"},
	InternalOwner:                 FieldDescriptor{Name: "internal_owner", InputKey: "internal_owner"},
	InternalOwnerGroupID:          FieldDescriptor{Name: "internal_owner_group_id", InputKey: "internal_owner_group_id"},
	InternalOwnerIdentityHolderID: FieldDescriptor{Name: "internal_owner_identity_holder_id", InputKey: "internal_owner_identity_holder_id"},
	InternalOwnerUserID:           FieldDescriptor{Name: "internal_owner_user_id", InputKey: "internal_owner_user_id"},
	ManifestPath:                  FieldDescriptor{Name: "manifest_path", InputKey: "manifest_path"},
	Metadata:                      FieldDescriptor{Name: "metadata", InputKey: "metadata"},
	Open:                          FieldDescriptor{Name: "open", InputKey: "open"},
	PackageEcosystem:              FieldDescriptor{Name: "package_ecosystem", InputKey: "package_ecosystem"},
	PackageName:                   FieldDescriptor{Name: "package_name", InputKey: "package_name"},
	Priority:                      FieldDescriptor{Name: "priority", InputKey: "priority"},
	Production:                    FieldDescriptor{Name: "production", InputKey: "production"},
	Public:                        FieldDescriptor{Name: "public", InputKey: "public"},
	PublishedAt:                   FieldDescriptor{Name: "published_at", InputKey: "published_at"},
	RawPayload:                    FieldDescriptor{Name: "raw_payload", InputKey: "raw_payload"},
	References:                    FieldDescriptor{Name: "references", InputKey: "references"},
	RemediationSLA:                FieldDescriptor{Name: "remediation_sla", InputKey: "remediation_sla"},
	ReviewedBy:                    FieldDescriptor{Name: "reviewed_by", InputKey: "reviewed_by"},
	ReviewedByGroupID:             FieldDescriptor{Name: "reviewed_by_group_id", InputKey: "reviewed_by_group_id"},
	ReviewedByIdentityHolderID:    FieldDescriptor{Name: "reviewed_by_identity_holder_id", InputKey: "reviewed_by_identity_holder_id"},
	ReviewedByUserID:              FieldDescriptor{Name: "reviewed_by_user_id", InputKey: "reviewed_by_user_id"},
	ScopeID:                       FieldDescriptor{Name: "scope_id", InputKey: "scope_id"},
	ScopeName:                     FieldDescriptor{Name: "scope_name", InputKey: "scope_name"},
	Score:                         FieldDescriptor{Name: "score", InputKey: "score"},
	Severity:                      FieldDescriptor{Name: "severity", InputKey: "severity"},
	Source:                        FieldDescriptor{Name: "source", InputKey: "source"},
	SourceUpdatedAt:               FieldDescriptor{Name: "source_updated_at", InputKey: "source_updated_at"},
	Summary:                       FieldDescriptor{Name: "summary", InputKey: "summary"},
	SystemInternalID:              FieldDescriptor{Name: "system_internal_id", InputKey: "system_internal_id"},
	Tags:                          FieldDescriptor{Name: "tags", InputKey: "tags"},
	Validated:                     FieldDescriptor{Name: "validated", InputKey: "validated"},
	Vector:                        FieldDescriptor{Name: "vector", InputKey: "vector"},
	VulnerabilityStatusID:         FieldDescriptor{Name: "vulnerability_status_id", InputKey: "vulnerability_status_id"},
	VulnerabilityStatusName:       FieldDescriptor{Name: "vulnerability_status_name", InputKey: "vulnerability_status_name"},
	VulnerableVersionRange:        FieldDescriptor{Name: "vulnerable_version_range", InputKey: "vulnerable_version_range"},
}

VulnerabilityFields indexes the provider-mappable fields of Vulnerability

Functions

func ApprovalListeners

func ApprovalListeners(concern MutationConcern, caller func(*auth.Caller, MutationPayload) *auth.Caller, content NotificationContent, statusValues []string, skip ...*Schema) []gala.Registration

ApprovalListeners returns one declarative approval listener per approval-annotated schema, gated on the schema's status field matching any of the trigger values; the caller owns the notification content, trigger vocabulary, and capability hook

func ConsoleLanding

func ConsoleLanding(schemaType string) string

ConsoleLanding returns the annotation-declared console landing path for a schema.

func ConsoleObjectPath

func ConsoleObjectPath(schemaType, objectID string) string

ConsoleObjectPath returns the annotation-declared console path for an object.

func CreateNotifications

func CreateNotifications(ctx context.Context, client *generated.Client, recipients []string, input *generated.CreateNotificationInput) error

CreateNotifications creates one notification per recipient from the given input, normalizing the object type; it is the single creation funnel for declarative and bespoke notifications

func EmissionVetoed

func EmissionVetoed(ctx context.Context) bool

EmissionVetoed reports whether mutation event emission is vetoed

func EmitMutation

func EmitMutation(ctx context.Context, runtimes []*gala.Gala, payload MutationPayload)

EmitMutation fans a mutation payload out to every interested concern topic on each runtime, detaching cancellation for best-effort dispatch; per-topic failures are logged and do not abort the fan-out

func EncodeLookupKey

func EncodeLookupKey(alternative LookupAlternative, keys LookupValues) string

EncodeLookupKey renders a lookup alternative's key values into the lookup cache key

func FieldValue

func FieldValue(row json.RawMessage, field string) string

FieldValue returns the trimmed string value of one field from a marshaled entity row

func ForSchemas

func ForSchemas(schemas []*Schema, base MutationListener) []gala.Registration

ForSchemas stamps one listener declaration across schemas

func GroupMemberUserIDs

func GroupMemberUserIDs(ctx context.Context, client *generated.Client, groupID string) ([]string, error)

GroupMemberUserIDs returns the user ids of all members of the given group

func InjectCreateLinks(ctx context.Context, client *generated.Client, ownerID string, schema *Schema, payload json.RawMessage, links []LinkSpec) (json.RawMessage, error)

InjectCreateLinks resolves each link's target entities via selectTargets and writes the matched ids into the create-input payload under the edge's create-input key, so the source object is created with its edges already set in the same mutation rather than linked in a post-create step. A unique edge sets the scalar <edge>ID create field; a to-many edge sets the <edge>IDs list. Links resolving to no targets are skipped, leaving the create input unchanged for that edge. The target schema is taken authoritatively from the edge, so callers only supply the edge name and match criteria. Both the integration ingest engine and the workflow CREATE_OBJECT action use this, so a workflow definition can set edges identically to an ingest mapping

func InterestedInMutation

func InterestedInMutation(runtimes []*gala.Gala, schemaType, operation string) bool

InterestedInMutation reports whether any runtime has an interested listener on any of the schema's concern topics

func LoadEntity

func LoadEntity[T any](ctx context.Context, entityID string, load func(context.Context, string) (T, error)) (T, bool, error)

LoadEntity loads a listener's target row via the provided getter, treating a missing row as a skipped event: the entity was deleted between mutation and delivery, so there is nothing left to process. Any other load error is returned for the queue to retry

func MentionListeners

func MentionListeners(concern MutationConcern, caller func(*auth.Caller, MutationPayload) *auth.Caller, content NotificationContent, skip ...*Schema) []gala.Registration

MentionListeners returns one declarative mention listener per mention-annotated schema, excluding the skip schemas; the caller owns the notification content and capability hook

func MentionTexts

func MentionTexts(payload MutationPayload, spec MentionSpec) (string, string)

MentionTexts resolves the new and pre-mutation rich text scanned for mentions, preferring each JSON candidate over its plain-text fallback only when it is valid slate text

func MentionedUsers

func MentionedUsers(ctx context.Context, client *generated.Client, oldText, newText, objectType, objectID, objectName string) ([]string, error)

MentionedUsers resolves the user ids newly mentioned between the old and new rich text

func MutationConcernTopics

func MutationConcernTopics(schemaType string) [3]gala.TopicName

MutationConcernTopics returns the concern topic names a schema mutation fans out to

func MutationTopic

func MutationTopic(concern MutationConcern, schemaType string) gala.Topic[MutationPayload]

MutationTopic returns the typed mutation topic for a concern + schema type pair

func MutationTopicName

func MutationTopicName(concern MutationConcern, schemaType string) gala.TopicName

MutationTopicName returns the mutation topic name for a concern + schema type pair

func NormalizeStrings

func NormalizeStrings(values []string) []string

NormalizeStrings trims, deduplicates, and drops empty string values

func ParseEnum

func ParseEnum[T ~string](raw any, parser EnumParser[T], invalid ...T) (T, bool)

ParseEnum parses enum-like values through the provided enum parser. Optional invalid values can be provided to force known sentinel values to be treated as parse failures

func PrefetchLinkTargets

func PrefetchLinkTargets(ctx context.Context, client *generated.Client, ownerID string, schema *Schema, payloads []json.RawMessage, links []LinkSpec) (context.Context, error)

PrefetchLinkTargets caches key-matched link target rows for a batch of payloads on the returned context

func RecipientsFromField

func RecipientsFromField(fieldName string) func(Invocation, MutationPayload, json.RawMessage) ([]string, error)

RecipientsFromField resolves a single recipient from the payload's proposed value for the field, falling back to the loaded row; an empty value skips emission

func RegisterIngestListeners

func RegisterIngestListeners(runtime *gala.Gala, resolveIntegration IngestIntegrationResolver) error

RegisterIngestListeners attaches every generated schema-ingest consumer.

func RequireDep

func RequireDep[D any](handle func(Invocation, MutationPayload, D) error) func(Invocation, MutationPayload) error

RequireDep resolves one listener dependency before invoking handle, gating the event when the dependency is not wired

func StampProvenance

func StampProvenance(payload json.RawMessage, schema *Schema, integration *generated.Integration, runID string) json.RawMessage

StampProvenance writes the schema's trusted integration-derived provenance columns and ownership edges onto an ingest payload from the writing installation, overriding anything the mapping emitted for them; it is the sole writer of provenance columns for both the synchronous and the durable ingest paths, so a queued record persists with the same provenance a batched one does

func ValueAsString

func ValueAsString(raw any) (string, bool)

ValueAsString converts arbitrary values into non-empty strings

func VetoEmission

func VetoEmission(ctx context.Context)

VetoEmission suppresses mutation event emission for the current mutation

func WithActiveIntegrations

func WithActiveIntegrations(ctx context.Context, ids []string) context.Context

WithActiveIntegrations installs a ctx-carried set of integration ids known to be active

func WithEmissionVeto

func WithEmissionVeto(ctx context.Context) context.Context

WithEmissionVeto installs a shared emission veto holder when none is present, so every emission hook on the chain reads the same suppression decision

func WithEmissionVetoed

func WithEmissionVetoed(ctx context.Context) context.Context

WithEmissionVetoed suppresses mutation event emission for every mutation under ctx; the fresh holder shadows any outer one so the veto never leaks to sibling contexts

func WithLookupMatches

func WithLookupMatches(ctx context.Context, schema *Schema, matches map[int]map[string][]json.RawMessage) context.Context

WithLookupMatches installs a ctx-carried cache of one schema's ingest lookup matches by alternative and key

Types

type ActionPlanProjection

type ActionPlanProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                              string                       `json:"id,omitempty"`
	ActionPlanKindID                string                       `json:"action_plan_kind_id,omitempty"`
	ActionPlanKindName              string                       `json:"action_plan_kind_name,omitempty"`
	ApprovalRequired                bool                         `json:"approval_required,omitempty"`
	ApproverID                      string                       `json:"approver_id,omitempty"`
	Blocked                         bool                         `json:"blocked,omitempty"`
	BlockerReason                   string                       `json:"blocker_reason,omitempty"`
	CompletedAt                     time.Time                    `json:"completed_at,omitempty"`
	ControlSuggestions              []string                     `json:"control_suggestions,omitempty"`
	CreatedAt                       time.Time                    `json:"created_at,omitempty"`
	CreatedBy                       string                       `json:"created_by,omitempty"`
	DelegateID                      string                       `json:"delegate_id,omitempty"`
	Description                     string                       `json:"description,omitempty"`
	Details                         string                       `json:"details,omitempty"`
	DetailsJSON                     []interface{}                `json:"details_json,omitempty"`
	DismissedControlSuggestions     []string                     `json:"dismissed_control_suggestions,omitempty"`
	DismissedImprovementSuggestions []string                     `json:"dismissed_improvement_suggestions,omitempty"`
	DismissedTagSuggestions         []string                     `json:"dismissed_tag_suggestions,omitempty"`
	DueDate                         time.Time                    `json:"due_date,omitempty"`
	ExternalContents                string                       `json:"external_contents,omitempty"`
	ExternalFileID                  string                       `json:"external_file_id,omitempty"`
	FileID                          string                       `json:"file_id,omitempty"`
	ImprovementSuggestions          []string                     `json:"improvement_suggestions,omitempty"`
	IntegrationRunID                string                       `json:"integration_run_id,omitempty"`
	InternalNotes                   string                       `json:"internal_notes,omitempty"`
	ManagedBy                       string                       `json:"managed_by,omitempty"`
	ManagementMode                  enums.DocumentManagementMode `json:"management_mode,omitempty"`
	Metadata                        map[string]interface{}       `json:"metadata,omitempty"`
	Name                            string                       `json:"name,omitempty"`
	OwnerID                         string                       `json:"owner_id,omitempty"`
	Priority                        enums.Priority               `json:"priority,omitempty"`
	RawPayload                      map[string]interface{}       `json:"raw_payload,omitempty"`
	RequiresApproval                bool                         `json:"requires_approval,omitempty"`
	ReviewDue                       time.Time                    `json:"review_due,omitempty"`
	ReviewFrequency                 enums.Frequency              `json:"review_frequency,omitempty"`
	Revision                        string                       `json:"revision,omitempty"`
	Source                          string                       `json:"source,omitempty"`
	SourceDefinitionID              string                       `json:"source_definition_id,omitempty"`
	SourceDefinitionVersion         string                       `json:"source_definition_version,omitempty"`
	SourceInstanceID                string                       `json:"source_instance_id,omitempty"`
	Status                          enums.DocumentStatus         `json:"status,omitempty"`
	Summary                         string                       `json:"summary,omitempty"`
	SystemInternalID                string                       `json:"system_internal_id,omitempty"`
	SystemOwned                     bool                         `json:"system_owned,omitempty"`
	TagSuggestions                  []string                     `json:"tag_suggestions,omitempty"`
	Tags                            []string                     `json:"tags,omitempty"`
	Title                           string                       `json:"title,omitempty"`
	UpdatedAt                       time.Time                    `json:"updated_at,omitempty"`
	UpdatedBy                       string                       `json:"updated_by,omitempty"`
	UpdatedByImpersonator           string                       `json:"updated_by_impersonator,omitempty"`
	URL                             string                       `json:"url,omitempty"`
	WorkflowEligibleMarker          bool                         `json:"workflow_eligible_marker,omitempty"`
}

ActionPlanProjection is the flat, CEL- and jsonschema-facing view of a ActionPlan: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.ActionPlan whose edge graph cannot be reflected

type ApprovalSpec

type ApprovalSpec struct {
	Schema        string `json:"schema"`
	StatusField   string `json:"statusField"`
	ApproverField string `json:"approverField"`
}

ApprovalSpec describes the approval-flow fields on a schema.

func ApprovalSpecFor

func ApprovalSpecFor(schemaType string) (ApprovalSpec, bool)

ApprovalSpecFor returns the annotation-declared approval fields for a schema.

type AssessmentProjection

type AssessmentProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                     string                 `json:"id,omitempty"`
	AssessmentType         enums.AssessmentType   `json:"assessment_type,omitempty"`
	CreatedAt              time.Time              `json:"created_at,omitempty"`
	CreatedBy              string                 `json:"created_by,omitempty"`
	InternalNotes          string                 `json:"internal_notes,omitempty"`
	Jsonconfig             map[string]interface{} `json:"jsonconfig,omitempty"`
	Name                   string                 `json:"name,omitempty"`
	OwnerID                string                 `json:"owner_id,omitempty"`
	ResponseDueDuration    int64                  `json:"response_due_duration,omitempty"`
	SystemInternalID       string                 `json:"system_internal_id,omitempty"`
	SystemOwned            bool                   `json:"system_owned,omitempty"`
	Tags                   []string               `json:"tags,omitempty"`
	TemplateID             string                 `json:"template_id,omitempty"`
	Uischema               map[string]interface{} `json:"uischema,omitempty"`
	UpdatedAt              time.Time              `json:"updated_at,omitempty"`
	UpdatedBy              string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator  string                 `json:"updated_by_impersonator,omitempty"`
	WorkflowEligibleMarker bool                   `json:"workflow_eligible_marker,omitempty"`
}

AssessmentProjection is the flat, CEL- and jsonschema-facing view of a Assessment: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Assessment whose edge graph cannot be reflected

type AssessmentResponseProjection

type AssessmentResponseProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                     string                         `json:"id,omitempty"`
	AssessmentID           string                         `json:"assessment_id,omitempty"`
	AssignedAt             time.Time                      `json:"assigned_at,omitempty"`
	CampaignID             string                         `json:"campaign_id,omitempty"`
	CompletedAt            time.Time                      `json:"completed_at,omitempty"`
	CreatedAt              time.Time                      `json:"created_at,omitempty"`
	CreatedBy              string                         `json:"created_by,omitempty"`
	DisplayName            string                         `json:"display_name,omitempty"`
	DocumentDataID         string                         `json:"document_data_id,omitempty"`
	DueDate                time.Time                      `json:"due_date,omitempty"`
	Email                  string                         `json:"email,omitempty"`
	EmailClickCount        int                            `json:"email_click_count,omitempty"`
	EmailClickedAt         time.Time                      `json:"email_clicked_at,omitempty"`
	EmailDeliveredAt       time.Time                      `json:"email_delivered_at,omitempty"`
	EmailMetadata          map[string]interface{}         `json:"email_metadata,omitempty"`
	EmailOpenCount         int                            `json:"email_open_count,omitempty"`
	EmailOpenedAt          time.Time                      `json:"email_opened_at,omitempty"`
	EntityID               string                         `json:"entity_id,omitempty"`
	IdentityHolderID       string                         `json:"identity_holder_id,omitempty"`
	IsDraft                bool                           `json:"is_draft,omitempty"`
	IsTest                 bool                           `json:"is_test,omitempty"`
	LastEmailEventAt       time.Time                      `json:"last_email_event_at,omitempty"`
	OwnerID                string                         `json:"owner_id,omitempty"`
	SendAttempts           int                            `json:"send_attempts,omitempty"`
	StartedAt              time.Time                      `json:"started_at,omitempty"`
	Status                 enums.AssessmentResponseStatus `json:"status,omitempty"`
	UpdatedAt              time.Time                      `json:"updated_at,omitempty"`
	UpdatedBy              string                         `json:"updated_by,omitempty"`
	UpdatedByImpersonator  string                         `json:"updated_by_impersonator,omitempty"`
	WorkflowEligibleMarker bool                           `json:"workflow_eligible_marker,omitempty"`
}

AssessmentResponseProjection is the flat, CEL- and jsonschema-facing view of a AssessmentResponse: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.AssessmentResponse whose edge graph cannot be reflected

type AssetProjection

type AssetProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                            string           `json:"id,omitempty"`
	AccessModelID                 string           `json:"access_model_id,omitempty"`
	AccessModelName               string           `json:"access_model_name,omitempty"`
	AssetDataClassificationID     string           `json:"asset_data_classification_id,omitempty"`
	AssetDataClassificationName   string           `json:"asset_data_classification_name,omitempty"`
	AssetSubtypeID                string           `json:"asset_subtype_id,omitempty"`
	AssetSubtypeName              string           `json:"asset_subtype_name,omitempty"`
	AssetType                     enums.AssetType  `json:"asset_type,omitempty"`
	Categories                    []string         `json:"categories,omitempty"`
	ContainsPii                   bool             `json:"contains_pii,omitempty"`
	CostCenter                    string           `json:"cost_center,omitempty"`
	Cpe                           string           `json:"cpe,omitempty"`
	CreatedAt                     time.Time        `json:"created_at,omitempty"`
	CreatedBy                     string           `json:"created_by,omitempty"`
	CriticalityID                 string           `json:"criticality_id,omitempty"`
	CriticalityName               string           `json:"criticality_name,omitempty"`
	Description                   string           `json:"description,omitempty"`
	DisplayName                   string           `json:"display_name,omitempty"`
	EncryptionStatusID            string           `json:"encryption_status_id,omitempty"`
	EncryptionStatusName          string           `json:"encryption_status_name,omitempty"`
	EnvironmentID                 string           `json:"environment_id,omitempty"`
	EnvironmentName               string           `json:"environment_name,omitempty"`
	EstimatedMonthlyCost          float64          `json:"estimated_monthly_cost,omitempty"`
	Identifier                    string           `json:"identifier,omitempty"`
	IntegrationID                 string           `json:"integration_id,omitempty"`
	IntegrationRunID              string           `json:"integration_run_id,omitempty"`
	InternalNotes                 string           `json:"internal_notes,omitempty"`
	InternalOwner                 string           `json:"internal_owner,omitempty"`
	InternalOwnerGroupID          string           `json:"internal_owner_group_id,omitempty"`
	InternalOwnerIdentityHolderID string           `json:"internal_owner_identity_holder_id,omitempty"`
	InternalOwnerUserID           string           `json:"internal_owner_user_id,omitempty"`
	ManagedBy                     string           `json:"managed_by,omitempty"`
	Name                          string           `json:"name,omitempty"`
	ObservedAt                    models.DateTime  `json:"observed_at,omitempty"`
	OwnerID                       string           `json:"owner_id,omitempty"`
	PhysicalLocation              string           `json:"physical_location,omitempty"`
	PurchaseDate                  models.DateTime  `json:"purchase_date,omitempty"`
	Region                        string           `json:"region,omitempty"`
	ScopeID                       string           `json:"scope_id,omitempty"`
	ScopeName                     string           `json:"scope_name,omitempty"`
	SecurityTierID                string           `json:"security_tier_id,omitempty"`
	SecurityTierName              string           `json:"security_tier_name,omitempty"`
	SourceDefinitionID            string           `json:"source_definition_id,omitempty"`
	SourceDefinitionVersion       string           `json:"source_definition_version,omitempty"`
	SourceIdentifier              string           `json:"source_identifier,omitempty"`
	SourceInstanceID              string           `json:"source_instance_id,omitempty"`
	SourcePlatformID              string           `json:"source_platform_id,omitempty"`
	SourceType                    enums.SourceType `json:"source_type,omitempty"`
	SystemInternalID              string           `json:"system_internal_id,omitempty"`
	SystemOwned                   bool             `json:"system_owned,omitempty"`
	Tags                          []string         `json:"tags,omitempty"`
	UpdatedAt                     time.Time        `json:"updated_at,omitempty"`
	UpdatedBy                     string           `json:"updated_by,omitempty"`
	UpdatedByImpersonator         string           `json:"updated_by_impersonator,omitempty"`
	Website                       string           `json:"website,omitempty"`
}

AssetProjection is the flat, CEL- and jsonschema-facing view of a Asset: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Asset whose edge graph cannot be reflected

type CampaignProjection

type CampaignProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                            string                 `json:"id,omitempty"`
	AssessmentID                  string                 `json:"assessment_id,omitempty"`
	CampaignType                  enums.CampaignType     `json:"campaign_type,omitempty"`
	CompletedAt                   models.DateTime        `json:"completed_at,omitempty"`
	CreatedAt                     time.Time              `json:"created_at,omitempty"`
	CreatedBy                     string                 `json:"created_by,omitempty"`
	Description                   string                 `json:"description,omitempty"`
	DisplayID                     string                 `json:"display_id,omitempty"`
	DueDate                       models.DateTime        `json:"due_date,omitempty"`
	EmailBrandingID               string                 `json:"email_branding_id,omitempty"`
	EmailTemplateID               string                 `json:"email_template_id,omitempty"`
	EntityID                      string                 `json:"entity_id,omitempty"`
	IntegrationID                 string                 `json:"integration_id,omitempty"`
	InternalOwner                 string                 `json:"internal_owner,omitempty"`
	InternalOwnerGroupID          string                 `json:"internal_owner_group_id,omitempty"`
	InternalOwnerIdentityHolderID string                 `json:"internal_owner_identity_holder_id,omitempty"`
	InternalOwnerUserID           string                 `json:"internal_owner_user_id,omitempty"`
	IsActive                      bool                   `json:"is_active,omitempty"`
	IsRecurring                   bool                   `json:"is_recurring,omitempty"`
	LastResentAt                  models.DateTime        `json:"last_resent_at,omitempty"`
	LastRunAt                     models.DateTime        `json:"last_run_at,omitempty"`
	LaunchedAt                    models.DateTime        `json:"launched_at,omitempty"`
	Metadata                      map[string]interface{} `json:"metadata,omitempty"`
	Name                          string                 `json:"name,omitempty"`
	NextRunAt                     models.DateTime        `json:"next_run_at,omitempty"`
	OwnerID                       string                 `json:"owner_id,omitempty"`
	RecipientCount                int                    `json:"recipient_count,omitempty"`
	RecurrenceCron                models.Cron            `json:"recurrence_cron,omitempty"`
	RecurrenceEndAt               models.DateTime        `json:"recurrence_end_at,omitempty"`
	RecurrenceFrequency           enums.Frequency        `json:"recurrence_frequency,omitempty"`
	RecurrenceInterval            int                    `json:"recurrence_interval,omitempty"`
	RecurrenceTimezone            string                 `json:"recurrence_timezone,omitempty"`
	ResendCount                   int                    `json:"resend_count,omitempty"`
	ScheduledAt                   models.DateTime        `json:"scheduled_at,omitempty"`
	Status                        enums.CampaignStatus   `json:"status,omitempty"`
	Tags                          []string               `json:"tags,omitempty"`
	TemplateID                    string                 `json:"template_id,omitempty"`
	TrustCenterID                 string                 `json:"trust_center_id,omitempty"`
	UpdatedAt                     time.Time              `json:"updated_at,omitempty"`
	UpdatedBy                     string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator         string                 `json:"updated_by_impersonator,omitempty"`
	WorkflowEligibleMarker        bool                   `json:"workflow_eligible_marker,omitempty"`
}

CampaignProjection is the flat, CEL- and jsonschema-facing view of a Campaign: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Campaign whose edge graph cannot be reflected

type CampaignTargetProjection

type CampaignTargetProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                     string                         `json:"id,omitempty"`
	CampaignID             string                         `json:"campaign_id,omitempty"`
	CompletedAt            models.DateTime                `json:"completed_at,omitempty"`
	ContactID              string                         `json:"contact_id,omitempty"`
	CreatedAt              time.Time                      `json:"created_at,omitempty"`
	CreatedBy              string                         `json:"created_by,omitempty"`
	Email                  string                         `json:"email,omitempty"`
	FullName               string                         `json:"full_name,omitempty"`
	GroupID                string                         `json:"group_id,omitempty"`
	Metadata               map[string]interface{}         `json:"metadata,omitempty"`
	OwnerID                string                         `json:"owner_id,omitempty"`
	SentAt                 models.DateTime                `json:"sent_at,omitempty"`
	Status                 enums.AssessmentResponseStatus `json:"status,omitempty"`
	SubscriberID           string                         `json:"subscriber_id,omitempty"`
	UpdatedAt              time.Time                      `json:"updated_at,omitempty"`
	UpdatedBy              string                         `json:"updated_by,omitempty"`
	UpdatedByImpersonator  string                         `json:"updated_by_impersonator,omitempty"`
	UserID                 string                         `json:"user_id,omitempty"`
	WorkflowEligibleMarker bool                           `json:"workflow_eligible_marker,omitempty"`
}

CampaignTargetProjection is the flat, CEL- and jsonschema-facing view of a CampaignTarget: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.CampaignTarget whose edge graph cannot be reflected

type ChangeSet

type ChangeSet struct {
	// ChangedFields captures updated and cleared fields for the mutation
	ChangedFields []string `json:"changed_fields,omitempty"`
	// ClearedFields captures fields explicitly cleared by the mutation
	ClearedFields []string `json:"cleared_fields,omitempty"`
	// ChangedEdges captures changed edge names for catalog-known edges
	ChangedEdges []string `json:"changed_edges,omitempty"`
	// AddedIDs captures edge IDs added by edge name
	AddedIDs map[string][]string `json:"added_ids,omitempty"`
	// RemovedIDs captures edge IDs removed by edge name
	RemovedIDs map[string][]string `json:"removed_ids,omitempty"`
	// ProposedChanges captures field-level proposed values. Its JSON shape is unchanged, while the
	// decoded map avoids repeated full-document decoding by every listener gate and handler.
	ProposedChanges map[string]any `json:"proposed_changes,omitempty"`
	// OldValues captures pre-mutation values for changed fields on single-row updates
	OldValues map[string]any `json:"old_values,omitempty"`
}

ChangeSet is the single mutation-delta contract shared by event payloads, workflow trigger context, and approval routing. Field json tags are durable wire format for queued mutation events and must not change

func ChangeSetFromMutation

func ChangeSetFromMutation(mutation ent.Mutation) ChangeSet

ChangeSetFromMutation builds the mutation's change set: normalized changed and cleared field lists, proposed field values including explicit clears, and the catalog-known edge deltas flattened to name-keyed ID maps. Consumers filter this canonical set rather than rebuilding mutation state independently

func (ChangeSet) Clone

func (set ChangeSet) Clone() ChangeSet

Clone returns a copy of the change set and its map-backed values

func (ChangeSet) Empty

func (set ChangeSet) Empty() bool

Empty reports whether the change set carries no field, clear, or catalog edge change

func (ChangeSet) FieldChanged

func (set ChangeSet) FieldChanged(field string) bool

FieldChanged reports whether the change set indicates the field changed

func (ChangeSet) Filter

func (set ChangeSet) Filter(keepField, keepEdge func(string) bool) ChangeSet

Filter returns a capability-specific view without changing the durable ChangeSet shape.

func (ChangeSet) OldStringValue

func (set ChangeSet) OldStringValue(field string) (string, bool)

OldStringValue returns the pre-mutation string value for a field on single-row updates

func (ChangeSet) OldValue

func (set ChangeSet) OldValue(field string) (any, bool)

OldValue returns the pre-mutation value for a field on single-row updates

func (ChangeSet) StringSliceValue

func (set ChangeSet) StringSliceValue(field string) []string

StringSliceValue returns a proposed string-slice mutation value for a field

func (ChangeSet) StringValue

func (set ChangeSet) StringValue(field string) (string, bool)

StringValue returns the proposed string mutation value for a field

func (ChangeSet) Value

func (set ChangeSet) Value(field string) (any, bool)

Value returns the proposed mutation value for a field

type CheckResultProjection

type CheckResultProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                      string            `json:"id,omitempty"`
	CreatedAt               time.Time         `json:"created_at,omitempty"`
	CreatedBy               string            `json:"created_by,omitempty"`
	Details                 string            `json:"details,omitempty"`
	ExternalURI             string            `json:"external_uri,omitempty"`
	IntegrationID           string            `json:"integration_id,omitempty"`
	IntegrationRunID        string            `json:"integration_run_id,omitempty"`
	LastObservedAt          models.DateTime   `json:"last_observed_at,omitempty"`
	ManagedBy               string            `json:"managed_by,omitempty"`
	ParentExternalID        string            `json:"parent_external_id,omitempty"`
	Source                  string            `json:"source,omitempty"`
	SourceDefinitionID      string            `json:"source_definition_id,omitempty"`
	SourceDefinitionVersion string            `json:"source_definition_version,omitempty"`
	SourceInstanceID        string            `json:"source_instance_id,omitempty"`
	Status                  enums.CheckStatus `json:"status,omitempty"`
	Tags                    []string          `json:"tags,omitempty"`
	UpdatedAt               time.Time         `json:"updated_at,omitempty"`
	UpdatedBy               string            `json:"updated_by,omitempty"`
	UpdatedByImpersonator   string            `json:"updated_by_impersonator,omitempty"`
}

CheckResultProjection is the flat, CEL- and jsonschema-facing view of a CheckResult: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.CheckResult whose edge graph cannot be reflected

type ConsoleRoute

type ConsoleRoute struct {
	Base    string `json:"base"`
	IDParam string `json:"idParam,omitempty"`
	Suffix  string `json:"suffix,omitempty"`
}

ConsoleRoute describes how console URLs are built for a schema's objects.

type ContactProjection

type ContactProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                      string           `json:"id,omitempty"`
	Address                 string           `json:"address,omitempty"`
	Company                 string           `json:"company,omitempty"`
	CreatedAt               time.Time        `json:"created_at,omitempty"`
	CreatedBy               string           `json:"created_by,omitempty"`
	Email                   string           `json:"email,omitempty"`
	ExternalID              string           `json:"external_id,omitempty"`
	FullName                string           `json:"full_name,omitempty"`
	IntegrationID           string           `json:"integration_id,omitempty"`
	IntegrationRunID        string           `json:"integration_run_id,omitempty"`
	ManagedBy               string           `json:"managed_by,omitempty"`
	ObservedAt              models.DateTime  `json:"observed_at,omitempty"`
	OwnerID                 string           `json:"owner_id,omitempty"`
	PhoneNumber             string           `json:"phone_number,omitempty"`
	SourceDefinitionID      string           `json:"source_definition_id,omitempty"`
	SourceDefinitionVersion string           `json:"source_definition_version,omitempty"`
	SourceInstanceID        string           `json:"source_instance_id,omitempty"`
	Status                  enums.UserStatus `json:"status,omitempty"`
	Tags                    []string         `json:"tags,omitempty"`
	Title                   string           `json:"title,omitempty"`
	UpdatedAt               time.Time        `json:"updated_at,omitempty"`
	UpdatedBy               string           `json:"updated_by,omitempty"`
	UpdatedByImpersonator   string           `json:"updated_by_impersonator,omitempty"`
}

ContactProjection is the flat, CEL- and jsonschema-facing view of a Contact: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Contact whose edge graph cannot be reflected

type ControlImplementationProjection

type ControlImplementationProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string               `json:"id,omitempty"`
	CreatedAt             time.Time            `json:"created_at,omitempty"`
	CreatedBy             string               `json:"created_by,omitempty"`
	Details               string               `json:"details,omitempty"`
	DetailsJSON           []interface{}        `json:"details_json,omitempty"`
	ImplementationDate    time.Time            `json:"implementation_date,omitempty"`
	InternalNotes         string               `json:"internal_notes,omitempty"`
	OwnerID               string               `json:"owner_id,omitempty"`
	Status                enums.DocumentStatus `json:"status,omitempty"`
	SystemInternalID      string               `json:"system_internal_id,omitempty"`
	SystemOwned           bool                 `json:"system_owned,omitempty"`
	Tags                  []string             `json:"tags,omitempty"`
	UpdatedAt             time.Time            `json:"updated_at,omitempty"`
	UpdatedBy             string               `json:"updated_by,omitempty"`
	UpdatedByImpersonator string               `json:"updated_by_impersonator,omitempty"`
	VerificationDate      time.Time            `json:"verification_date,omitempty"`
	Verified              bool                 `json:"verified,omitempty"`
}

ControlImplementationProjection is the flat, CEL- and jsonschema-facing view of a ControlImplementation: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.ControlImplementation whose edge graph cannot be reflected

type ControlObjectiveProjection

type ControlObjectiveProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string                `json:"id,omitempty"`
	Category              string                `json:"category,omitempty"`
	ControlObjectiveType  string                `json:"control_objective_type,omitempty"`
	CreatedAt             time.Time             `json:"created_at,omitempty"`
	CreatedBy             string                `json:"created_by,omitempty"`
	DesiredOutcome        string                `json:"desired_outcome,omitempty"`
	DesiredOutcomeJSON    []interface{}         `json:"desired_outcome_json,omitempty"`
	DisplayID             string                `json:"display_id,omitempty"`
	InternalNotes         string                `json:"internal_notes,omitempty"`
	Name                  string                `json:"name,omitempty"`
	OwnerID               string                `json:"owner_id,omitempty"`
	Revision              string                `json:"revision,omitempty"`
	Source                enums.ControlSource   `json:"source,omitempty"`
	Status                enums.ObjectiveStatus `json:"status,omitempty"`
	Subcategory           string                `json:"subcategory,omitempty"`
	SystemInternalID      string                `json:"system_internal_id,omitempty"`
	SystemOwned           bool                  `json:"system_owned,omitempty"`
	Tags                  []string              `json:"tags,omitempty"`
	UpdatedAt             time.Time             `json:"updated_at,omitempty"`
	UpdatedBy             string                `json:"updated_by,omitempty"`
	UpdatedByImpersonator string                `json:"updated_by_impersonator,omitempty"`
}

ControlObjectiveProjection is the flat, CEL- and jsonschema-facing view of a ControlObjective: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.ControlObjective whose edge graph cannot be reflected

type ControlProjection

type ControlProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                         string                             `json:"id,omitempty"`
	Aliases                    []string                           `json:"aliases,omitempty"`
	AssessmentMethods          []models.AssessmentMethod          `json:"assessment_methods,omitempty"`
	AssessmentObjectives       []models.AssessmentObjective       `json:"assessment_objectives,omitempty"`
	AuditorReferenceID         string                             `json:"auditor_reference_id,omitempty"`
	Category                   string                             `json:"category,omitempty"`
	CategoryID                 string                             `json:"category_id,omitempty"`
	ControlKindID              string                             `json:"control_kind_id,omitempty"`
	ControlKindName            string                             `json:"control_kind_name,omitempty"`
	ControlOwnerID             string                             `json:"control_owner_id,omitempty"`
	ControlQuestions           []string                           `json:"control_questions,omitempty"`
	CreatedAt                  time.Time                          `json:"created_at,omitempty"`
	CreatedBy                  string                             `json:"created_by,omitempty"`
	DelegateID                 string                             `json:"delegate_id,omitempty"`
	Description                string                             `json:"description,omitempty"`
	DescriptionJSON            []interface{}                      `json:"description_json,omitempty"`
	DisplayID                  string                             `json:"display_id,omitempty"`
	EnvironmentID              string                             `json:"environment_id,omitempty"`
	EnvironmentName            string                             `json:"environment_name,omitempty"`
	EvidenceRequests           []models.EvidenceRequests          `json:"evidence_requests,omitempty"`
	ExampleEvidence            []models.ExampleEvidence           `json:"example_evidence,omitempty"`
	ExternalUUID               string                             `json:"external_uuid,omitempty"`
	ImplementationDescription  string                             `json:"implementation_description,omitempty"`
	ImplementationGuidance     []models.ImplementationGuidance    `json:"implementation_guidance,omitempty"`
	ImplementationStatus       enums.ControlImplementationStatus  `json:"implementation_status,omitempty"`
	InternalNotes              string                             `json:"internal_notes,omitempty"`
	IsTrustCenterControl       bool                               `json:"is_trust_center_control,omitempty"`
	MappedCategories           []string                           `json:"mapped_categories,omitempty"`
	OwnerID                    string                             `json:"owner_id,omitempty"`
	PublicRepresentation       string                             `json:"public_representation,omitempty"`
	RefCode                    string                             `json:"ref_code,omitempty"`
	ReferenceFramework         string                             `json:"reference_framework,omitempty"`
	ReferenceFrameworkRevision string                             `json:"reference_framework_revision,omitempty"`
	ReferenceID                string                             `json:"reference_id,omitempty"`
	References                 []models.Reference                 `json:"references,omitempty"`
	ResponsiblePartyID         string                             `json:"responsible_party_id,omitempty"`
	ScopeID                    string                             `json:"scope_id,omitempty"`
	ScopeName                  string                             `json:"scope_name,omitempty"`
	Source                     enums.ControlSource                `json:"source,omitempty"`
	SourceName                 string                             `json:"source_name,omitempty"`
	StandardID                 string                             `json:"standard_id,omitempty"`
	Status                     enums.ControlStatus                `json:"status,omitempty"`
	Subcategory                string                             `json:"subcategory,omitempty"`
	SystemInternalID           string                             `json:"system_internal_id,omitempty"`
	SystemOwned                bool                               `json:"system_owned,omitempty"`
	Tags                       []string                           `json:"tags,omitempty"`
	TestingProcedures          []models.TestingProcedures         `json:"testing_procedures,omitempty"`
	Title                      string                             `json:"title,omitempty"`
	TrustCenterVisibility      enums.TrustCenterControlVisibility `json:"trust_center_visibility,omitempty"`
	UpdatedAt                  time.Time                          `json:"updated_at,omitempty"`
	UpdatedBy                  string                             `json:"updated_by,omitempty"`
	UpdatedByImpersonator      string                             `json:"updated_by_impersonator,omitempty"`
	WorkflowEligibleMarker     bool                               `json:"workflow_eligible_marker,omitempty"`
}

ControlProjection is the flat, CEL- and jsonschema-facing view of a Control: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Control whose edge graph cannot be reflected

type CustomTypeEnumProjection

type CustomTypeEnumProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string    `json:"id,omitempty"`
	Color                 string    `json:"color,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	CreatedBy             string    `json:"created_by,omitempty"`
	Description           string    `json:"description,omitempty"`
	Field                 string    `json:"field,omitempty"`
	Icon                  string    `json:"icon,omitempty"`
	InternalNotes         string    `json:"internal_notes,omitempty"`
	Name                  string    `json:"name,omitempty"`
	ObjectType            string    `json:"object_type,omitempty"`
	OwnerID               string    `json:"owner_id,omitempty"`
	SystemInternalID      string    `json:"system_internal_id,omitempty"`
	SystemOwned           bool      `json:"system_owned,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
	UpdatedBy             string    `json:"updated_by,omitempty"`
	UpdatedByImpersonator string    `json:"updated_by_impersonator,omitempty"`
}

CustomTypeEnumProjection is the flat, CEL- and jsonschema-facing view of a CustomTypeEnum: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.CustomTypeEnum whose edge graph cannot be reflected

type DirectoryAccountProjection

type DirectoryAccountProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                      string                         `json:"id,omitempty"`
	AccountType             enums.DirectoryAccountType     `json:"account_type,omitempty"`
	AddedAt                 time.Time                      `json:"added_at,omitempty"`
	AvatarLocalFileID       string                         `json:"avatar_local_file_id,omitempty"`
	AvatarRemoteURL         string                         `json:"avatar_remote_url,omitempty"`
	AvatarUpdatedAt         time.Time                      `json:"avatar_updated_at,omitempty"`
	CanonicalEmail          string                         `json:"canonical_email,omitempty"`
	CreatedAt               time.Time                      `json:"created_at,omitempty"`
	CreatedBy               string                         `json:"created_by,omitempty"`
	Department              string                         `json:"department,omitempty"`
	DirectoryName           string                         `json:"directory_name,omitempty"`
	DisplayID               string                         `json:"display_id,omitempty"`
	DisplayName             string                         `json:"display_name,omitempty"`
	EmailAliases            []string                       `json:"email_aliases,omitempty"`
	EnvironmentID           string                         `json:"environment_id,omitempty"`
	EnvironmentName         string                         `json:"environment_name,omitempty"`
	ExternalID              string                         `json:"external_id,omitempty"`
	FamilyName              string                         `json:"family_name,omitempty"`
	GivenName               string                         `json:"given_name,omitempty"`
	IdentityHolderID        string                         `json:"identity_holder_id,omitempty"`
	IntegrationID           string                         `json:"integration_id,omitempty"`
	IntegrationRunID        string                         `json:"integration_run_id,omitempty"`
	JobTitle                string                         `json:"job_title,omitempty"`
	LastSeenIP              string                         `json:"last_seen_ip,omitempty"`
	ManagedBy               string                         `json:"managed_by,omitempty"`
	Metadata                map[string]interface{}         `json:"metadata,omitempty"`
	MfaState                enums.DirectoryAccountMFAState `json:"mfa_state,omitempty"`
	ObservedAt              time.Time                      `json:"observed_at,omitempty"`
	OrganizationUnit        string                         `json:"organization_unit,omitempty"`
	OwnerID                 string                         `json:"owner_id,omitempty"`
	PhoneNumber             string                         `json:"phone_number,omitempty"`
	PlatformID              string                         `json:"platform_id,omitempty"`
	PrimarySource           bool                           `json:"primary_source,omitempty"`
	Profile                 map[string]interface{}         `json:"profile,omitempty"`
	RawProfileFileID        string                         `json:"raw_profile_file_id,omitempty"`
	RemovedAt               time.Time                      `json:"removed_at,omitempty"`
	ScopeID                 string                         `json:"scope_id,omitempty"`
	ScopeName               string                         `json:"scope_name,omitempty"`
	SecondaryKey            string                         `json:"secondary_key,omitempty"`
	SourceDefinitionID      string                         `json:"source_definition_id,omitempty"`
	SourceDefinitionVersion string                         `json:"source_definition_version,omitempty"`
	SourceInstanceID        string                         `json:"source_instance_id,omitempty"`
	SourceVersion           string                         `json:"source_version,omitempty"`
	Status                  enums.DirectoryAccountStatus   `json:"status,omitempty"`
	Tags                    []string                       `json:"tags,omitempty"`
	UpdatedAt               time.Time                      `json:"updated_at,omitempty"`
	UpdatedBy               string                         `json:"updated_by,omitempty"`
	UpdatedByImpersonator   string                         `json:"updated_by_impersonator,omitempty"`
}

DirectoryAccountProjection is the flat, CEL- and jsonschema-facing view of a DirectoryAccount: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.DirectoryAccount whose edge graph cannot be reflected

type DirectoryGroupProjection

type DirectoryGroupProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                      string                             `json:"id,omitempty"`
	AddedAt                 time.Time                          `json:"added_at,omitempty"`
	Classification          enums.DirectoryGroupClassification `json:"classification,omitempty"`
	CreatedAt               time.Time                          `json:"created_at,omitempty"`
	CreatedBy               string                             `json:"created_by,omitempty"`
	Description             string                             `json:"description,omitempty"`
	DirectoryName           string                             `json:"directory_name,omitempty"`
	DisplayID               string                             `json:"display_id,omitempty"`
	DisplayName             string                             `json:"display_name,omitempty"`
	Email                   string                             `json:"email,omitempty"`
	EnvironmentID           string                             `json:"environment_id,omitempty"`
	EnvironmentName         string                             `json:"environment_name,omitempty"`
	ExternalID              string                             `json:"external_id,omitempty"`
	ExternalSharingAllowed  bool                               `json:"external_sharing_allowed,omitempty"`
	IntegrationID           string                             `json:"integration_id,omitempty"`
	IntegrationRunID        string                             `json:"integration_run_id,omitempty"`
	ManagedBy               string                             `json:"managed_by,omitempty"`
	MemberCount             int                                `json:"member_count,omitempty"`
	Metadata                map[string]interface{}             `json:"metadata,omitempty"`
	ObservedAt              time.Time                          `json:"observed_at,omitempty"`
	OwnerID                 string                             `json:"owner_id,omitempty"`
	PlatformID              string                             `json:"platform_id,omitempty"`
	Profile                 map[string]interface{}             `json:"profile,omitempty"`
	RawProfileFileID        string                             `json:"raw_profile_file_id,omitempty"`
	RemovedAt               time.Time                          `json:"removed_at,omitempty"`
	ScopeID                 string                             `json:"scope_id,omitempty"`
	ScopeName               string                             `json:"scope_name,omitempty"`
	SourceDefinitionID      string                             `json:"source_definition_id,omitempty"`
	SourceDefinitionVersion string                             `json:"source_definition_version,omitempty"`
	SourceInstanceID        string                             `json:"source_instance_id,omitempty"`
	SourceVersion           string                             `json:"source_version,omitempty"`
	Status                  enums.DirectoryGroupStatus         `json:"status,omitempty"`
	Tags                    []string                           `json:"tags,omitempty"`
	UpdatedAt               time.Time                          `json:"updated_at,omitempty"`
	UpdatedBy               string                             `json:"updated_by,omitempty"`
	UpdatedByImpersonator   string                             `json:"updated_by_impersonator,omitempty"`
}

DirectoryGroupProjection is the flat, CEL- and jsonschema-facing view of a DirectoryGroup: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.DirectoryGroup whose edge graph cannot be reflected

type DirectoryMembershipProjection

type DirectoryMembershipProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                      string                        `json:"id,omitempty"`
	AddedAt                 time.Time                     `json:"added_at,omitempty"`
	CreatedAt               time.Time                     `json:"created_at,omitempty"`
	CreatedBy               string                        `json:"created_by,omitempty"`
	DirectoryAccountID      string                        `json:"directory_account_id,omitempty"`
	DirectoryGroupID        string                        `json:"directory_group_id,omitempty"`
	DirectoryName           string                        `json:"directory_name,omitempty"`
	DisplayID               string                        `json:"display_id,omitempty"`
	EnvironmentID           string                        `json:"environment_id,omitempty"`
	EnvironmentName         string                        `json:"environment_name,omitempty"`
	IntegrationID           string                        `json:"integration_id,omitempty"`
	IntegrationRunID        string                        `json:"integration_run_id,omitempty"`
	ManagedBy               string                        `json:"managed_by,omitempty"`
	Metadata                map[string]interface{}        `json:"metadata,omitempty"`
	ObservedAt              time.Time                     `json:"observed_at,omitempty"`
	OwnerID                 string                        `json:"owner_id,omitempty"`
	PlatformID              string                        `json:"platform_id,omitempty"`
	RemovedAt               time.Time                     `json:"removed_at,omitempty"`
	Role                    enums.DirectoryMembershipRole `json:"role,omitempty"`
	ScopeID                 string                        `json:"scope_id,omitempty"`
	ScopeName               string                        `json:"scope_name,omitempty"`
	Source                  string                        `json:"source,omitempty"`
	SourceDefinitionID      string                        `json:"source_definition_id,omitempty"`
	SourceDefinitionVersion string                        `json:"source_definition_version,omitempty"`
	SourceInstanceID        string                        `json:"source_instance_id,omitempty"`
	UpdatedAt               time.Time                     `json:"updated_at,omitempty"`
	UpdatedBy               string                        `json:"updated_by,omitempty"`
	UpdatedByImpersonator   string                        `json:"updated_by_impersonator,omitempty"`
}

DirectoryMembershipProjection is the flat, CEL- and jsonschema-facing view of a DirectoryMembership: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.DirectoryMembership whose edge graph cannot be reflected

type DiscussionProjection

type DiscussionProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string    `json:"id,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	CreatedBy             string    `json:"created_by,omitempty"`
	ExternalID            string    `json:"external_id,omitempty"`
	IsResolved            bool      `json:"is_resolved,omitempty"`
	OwnerID               string    `json:"owner_id,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
	UpdatedBy             string    `json:"updated_by,omitempty"`
	UpdatedByImpersonator string    `json:"updated_by_impersonator,omitempty"`
}

DiscussionProjection is the flat, CEL- and jsonschema-facing view of a Discussion: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Discussion whose edge graph cannot be reflected

type DocumentDataProjection

type DocumentDataProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string                 `json:"id,omitempty"`
	CreatedAt             time.Time              `json:"created_at,omitempty"`
	CreatedBy             string                 `json:"created_by,omitempty"`
	Data                  map[string]interface{} `json:"data,omitempty"`
	EnvironmentID         string                 `json:"environment_id,omitempty"`
	EnvironmentName       string                 `json:"environment_name,omitempty"`
	OwnerID               string                 `json:"owner_id,omitempty"`
	ScopeID               string                 `json:"scope_id,omitempty"`
	ScopeName             string                 `json:"scope_name,omitempty"`
	Tags                  []string               `json:"tags,omitempty"`
	TemplateID            string                 `json:"template_id,omitempty"`
	UpdatedAt             time.Time              `json:"updated_at,omitempty"`
	UpdatedBy             string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator string                 `json:"updated_by_impersonator,omitempty"`
}

DocumentDataProjection is the flat, CEL- and jsonschema-facing view of a DocumentData: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.DocumentData whose edge graph cannot be reflected

type EdgeDescriptor

type EdgeDescriptor struct {
	// Name is the edge name (e.g., "controls")
	Name string `json:"name"`
	// Target is the target schema's registry entry
	Target *Schema `json:"-"`
	// TargetType is the PascalCase target schema name, surfaced for the cross-link target dropdown
	TargetType string `json:"target,omitempty"`
	// Label is the human-readable label (PascalCase of the edge name)
	Label string `json:"label,omitempty"`
	// Unique reports whether this side references a single target (sets <edge>ID rather than <edge>IDs)
	Unique bool `json:"unique,omitempty"`
	// Field is the foreign-key storage column on this schema's table for unique owning edges
	// (e.g. "control_id"); empty when the foreign key lives on the target table
	Field string `json:"field,omitempty"`
	// CreateField is the create-input JSON key used to set this edge at create time, matching the
	// input's snake_case json tag (e.g. "control_ids")
	CreateField string `json:"createField,omitempty"`
	// AddField is the update-input key that adds targets to a to-many edge (e.g. "add_control_ids");
	// empty for unique or immutable edges
	AddField string `json:"addField,omitempty"`
	// Through reports whether the edge goes through a join entity (edge schema). Through edges
	// are linked by creating join entity rows — one per target, each with its own generated id —
	// because batch edge adds cannot produce per-row entity ids
	Through bool `json:"through,omitempty"`
	// LinkThrough creates the join entity rows binding the source to each target, skipping pairs
	// that already exist; nil for plain edges
	LinkThrough func(ctx context.Context, client *generated.Client, sourceID string, targetIDs []string) error `json:"-"`
	// WorkflowEligible reports whether the edge may drive workflow conditions and triggers
	WorkflowEligible bool `json:"workflowEligible,omitempty"`
}

EdgeDescriptor describes an edge on a schema. It is the single edge-capability record shared by create-time link injection, the workflow object-ref catalog, and the integration cross-link inventory

type EntityProjection

type EntityProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                                    string                 `json:"id,omitempty"`
	Aliases                               []string               `json:"aliases,omitempty"`
	AnnualSpend                           float64                `json:"annual_spend,omitempty"`
	ApprovedForUse                        bool                   `json:"approved_for_use,omitempty"`
	AutoRenews                            bool                   `json:"auto_renews,omitempty"`
	BillingModel                          string                 `json:"billing_model,omitempty"`
	ContractEndDate                       models.DateTime        `json:"contract_end_date,omitempty"`
	ContractRenewalAt                     models.DateTime        `json:"contract_renewal_at,omitempty"`
	ContractStartDate                     models.DateTime        `json:"contract_start_date,omitempty"`
	CreatedAt                             time.Time              `json:"created_at,omitempty"`
	CreatedBy                             string                 `json:"created_by,omitempty"`
	Description                           string                 `json:"description,omitempty"`
	DisplayName                           string                 `json:"display_name,omitempty"`
	Domains                               []string               `json:"domains,omitempty"`
	EntityRelationshipStateID             string                 `json:"entity_relationship_state_id,omitempty"`
	EntityRelationshipStateName           string                 `json:"entity_relationship_state_name,omitempty"`
	EntitySecurityQuestionnaireStatusID   string                 `json:"entity_security_questionnaire_status_id,omitempty"`
	EntitySecurityQuestionnaireStatusName string                 `json:"entity_security_questionnaire_status_name,omitempty"`
	EntitySourceTypeID                    string                 `json:"entity_source_type_id,omitempty"`
	EntitySourceTypeName                  string                 `json:"entity_source_type_name,omitempty"`
	EntityTypeID                          string                 `json:"entity_type_id,omitempty"`
	EnvironmentID                         string                 `json:"environment_id,omitempty"`
	EnvironmentName                       string                 `json:"environment_name,omitempty"`
	ExternalID                            string                 `json:"external_id,omitempty"`
	HasSoc2                               bool                   `json:"has_soc2,omitempty"`
	IntegrationRunID                      string                 `json:"integration_run_id,omitempty"`
	InternalNotes                         string                 `json:"internal_notes,omitempty"`
	InternalOwner                         string                 `json:"internal_owner,omitempty"`
	InternalOwnerGroupID                  string                 `json:"internal_owner_group_id,omitempty"`
	InternalOwnerIdentityHolderID         string                 `json:"internal_owner_identity_holder_id,omitempty"`
	InternalOwnerUserID                   string                 `json:"internal_owner_user_id,omitempty"`
	LastReviewedAt                        models.DateTime        `json:"last_reviewed_at,omitempty"`
	LinkedAssetIds                        []string               `json:"linked_asset_ids,omitempty"`
	Links                                 []string               `json:"links,omitempty"`
	LogoFileID                            string                 `json:"logo_file_id,omitempty"`
	LogoRemoteURL                         string                 `json:"logo_remote_url,omitempty"`
	ManagedBy                             string                 `json:"managed_by,omitempty"`
	MfaEnforced                           bool                   `json:"mfa_enforced,omitempty"`
	MfaSupported                          bool                   `json:"mfa_supported,omitempty"`
	Name                                  string                 `json:"name,omitempty"`
	NextReviewAt                          models.DateTime        `json:"next_review_at,omitempty"`
	ObservedAt                            models.DateTime        `json:"observed_at,omitempty"`
	OwnerID                               string                 `json:"owner_id,omitempty"`
	ProvidedServices                      []string               `json:"provided_services,omitempty"`
	RenewalRisk                           string                 `json:"renewal_risk,omitempty"`
	ReviewFrequency                       enums.Frequency        `json:"review_frequency,omitempty"`
	ReviewedBy                            string                 `json:"reviewed_by,omitempty"`
	ReviewedByGroupID                     string                 `json:"reviewed_by_group_id,omitempty"`
	ReviewedByIdentityHolderID            string                 `json:"reviewed_by_identity_holder_id,omitempty"`
	ReviewedByUserID                      string                 `json:"reviewed_by_user_id,omitempty"`
	RiskRating                            string                 `json:"risk_rating,omitempty"`
	RiskScore                             int                    `json:"risk_score,omitempty"`
	RiskScoreCoverage                     int                    `json:"risk_score_coverage,omitempty"`
	ScopeID                               string                 `json:"scope_id,omitempty"`
	ScopeName                             string                 `json:"scope_name,omitempty"`
	Soc2PeriodEnd                         models.DateTime        `json:"soc2_period_end,omitempty"`
	SourceDefinitionID                    string                 `json:"source_definition_id,omitempty"`
	SourceDefinitionVersion               string                 `json:"source_definition_version,omitempty"`
	SourceInstanceID                      string                 `json:"source_instance_id,omitempty"`
	SpendCurrency                         string                 `json:"spend_currency,omitempty"`
	SSOEnforced                           bool                   `json:"sso_enforced,omitempty"`
	Status                                enums.EntityStatus     `json:"status,omitempty"`
	StatusPageURL                         string                 `json:"status_page_url,omitempty"`
	SystemInternalID                      string                 `json:"system_internal_id,omitempty"`
	SystemOwned                           bool                   `json:"system_owned,omitempty"`
	Tags                                  []string               `json:"tags,omitempty"`
	TerminationNoticeDays                 int                    `json:"termination_notice_days,omitempty"`
	Tier                                  enums.VendorTier       `json:"tier,omitempty"`
	UpdatedAt                             time.Time              `json:"updated_at,omitempty"`
	UpdatedBy                             string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator                 string                 `json:"updated_by_impersonator,omitempty"`
	VendorMetadata                        map[string]interface{} `json:"vendor_metadata,omitempty"`
}

EntityProjection is the flat, CEL- and jsonschema-facing view of a Entity: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Entity whose edge graph cannot be reflected

type EntityTypeProjection

type EntityTypeProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string    `json:"id,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	CreatedBy             string    `json:"created_by,omitempty"`
	InternalNotes         string    `json:"internal_notes,omitempty"`
	Name                  string    `json:"name,omitempty"`
	OwnerID               string    `json:"owner_id,omitempty"`
	SystemInternalID      string    `json:"system_internal_id,omitempty"`
	SystemOwned           bool      `json:"system_owned,omitempty"`
	Tags                  []string  `json:"tags,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
	UpdatedBy             string    `json:"updated_by,omitempty"`
	UpdatedByImpersonator string    `json:"updated_by_impersonator,omitempty"`
}

EntityTypeProjection is the flat, CEL- and jsonschema-facing view of a EntityType: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.EntityType whose edge graph cannot be reflected

type EnumParser

type EnumParser[T ~string] func(string) *T

EnumParser converts a normalized string into an enum pointer value

type EventProjection

type EventProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID            string                 `json:"id,omitempty"`
	CorrelationID string                 `json:"correlation_id,omitempty"`
	CreatedAt     time.Time              `json:"created_at,omitempty"`
	CreatedBy     string                 `json:"created_by,omitempty"`
	EventID       string                 `json:"event_id,omitempty"`
	EventType     string                 `json:"event_type,omitempty"`
	Metadata      map[string]interface{} `json:"metadata,omitempty"`
	Tags          []string               `json:"tags,omitempty"`
	UpdatedAt     time.Time              `json:"updated_at,omitempty"`
	UpdatedBy     string                 `json:"updated_by,omitempty"`
}

EventProjection is the flat, CEL- and jsonschema-facing view of a Event: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Event whose edge graph cannot be reflected

type EvidenceProjection

type EvidenceProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                     string               `json:"id,omitempty"`
	AuditorReferenceID     string               `json:"auditor_reference_id,omitempty"`
	CollectionProcedure    string               `json:"collection_procedure,omitempty"`
	CreatedAt              time.Time            `json:"created_at,omitempty"`
	CreatedBy              string               `json:"created_by,omitempty"`
	CreationDate           models.DateTime      `json:"creation_date,omitempty"`
	Description            string               `json:"description,omitempty"`
	DisplayID              string               `json:"display_id,omitempty"`
	EnvironmentID          string               `json:"environment_id,omitempty"`
	EnvironmentName        string               `json:"environment_name,omitempty"`
	ExternalUUID           string               `json:"external_uuid,omitempty"`
	IsAutomated            bool                 `json:"is_automated,omitempty"`
	Name                   string               `json:"name,omitempty"`
	OwnerID                string               `json:"owner_id,omitempty"`
	RenewalDate            models.DateTime      `json:"renewal_date,omitempty"`
	ReviewFrequency        enums.Frequency      `json:"review_frequency,omitempty"`
	ScopeID                string               `json:"scope_id,omitempty"`
	ScopeName              string               `json:"scope_name,omitempty"`
	Source                 string               `json:"source,omitempty"`
	Status                 enums.EvidenceStatus `json:"status,omitempty"`
	Tags                   []string             `json:"tags,omitempty"`
	UpdatedAt              time.Time            `json:"updated_at,omitempty"`
	UpdatedBy              string               `json:"updated_by,omitempty"`
	UpdatedByImpersonator  string               `json:"updated_by_impersonator,omitempty"`
	URL                    string               `json:"url,omitempty"`
	WorkflowEligibleMarker bool                 `json:"workflow_eligible_marker,omitempty"`
}

EvidenceProjection is the flat, CEL- and jsonschema-facing view of a Evidence: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Evidence whose edge graph cannot be reflected

type FieldDescriptor

type FieldDescriptor struct {
	// Name is the schema field name (snake_case)
	Name string `json:"name"`
	// Label is the human-readable label (PascalCase of the field name)
	Label string `json:"label"`
	// Type is the ent field type string (e.g. "string", "bool", "time.Time")
	Type string `json:"type"`
	// WorkflowEligible reports whether the field may drive workflow conditions and triggers
	WorkflowEligible bool `json:"workflowEligible,omitempty"`
	// MatchKey reports whether the field is a plain-string indexed column usable as a cross-link match key
	MatchKey bool `json:"matchKey,omitempty"`
	// InputKey is the integration mapping create-input key (lowerCamel); empty for non-mapped fields
	InputKey string `json:"inputKey,omitempty"`
	// LookupKey reports whether the field is the ingest upsert lookup column for its schema
	LookupKey bool `json:"lookupKey,omitempty"`
	// DisplayKey reports whether the field is the schema's display-name source
	DisplayKey bool `json:"displayKey,omitempty"`
	// Clearable reports whether update inputs support explicitly clearing this field
	Clearable bool `json:"clearable,omitempty"`
	// WebhookPayload reports whether workflow webhook enrichment includes this field
	WebhookPayload bool `json:"webhookPayload,omitempty"`
	// SystemControlled excludes the field from provider mappings
	SystemControlled bool `json:"systemControlled,omitempty"`
	// Volatile excludes the field from triggering an ingest change
	Volatile bool `json:"volatile,omitempty"`
	// CaseInsensitive compares the field case-insensitively in ingest change detection
	CaseInsensitive bool `json:"caseInsensitive,omitempty"`
	// TaskRules are suggested-task rules declared on this field via entx.FieldTaskRule
	TaskRules []TaskRuleDescriptor `json:"taskRules,omitempty"`
}

FieldDescriptor describes one field on a schema. It is the single field-capability record shared by the workflow builder (condition/trigger fields) and the integration cross-link config (match fields), replacing the separate workflow-field and key-field lists

func (FieldDescriptor) Equal

func (d FieldDescriptor) Equal(old, proposed any) bool

Equal compares typed mutation values using the field's existing type information

func (FieldDescriptor) Expr

func (d FieldDescriptor) Expr(expr string) MappingEntry

Expr binds a CEL expression to the field for integration mapping registration

type FieldMatch

type FieldMatch struct {
	// Field is the snake_case mutation field the predicate reads
	Field string
	// In is the set of accepted stringified values
	In []string
	// Negate inverts the membership test
	Negate bool
}

FieldMatch is one declarative proposed-value predicate on a mutation listener: the mutation's proposed value for Field must stringify to a member of In (or a non-member when Negate is set) for the listener to run

type FieldTaskRule

type FieldTaskRule struct {
	// Field is the snake_case field name the rule was declared on; empty for schema-level rules
	Field string
	// Rule is the task rule descriptor itself
	Rule TaskRuleDescriptor
}

FieldTaskRule pairs one task rule with the field it was declared on. Field is empty for schema-level rules (entx.SchemaTaskRule), which have no field to evaluate and always fire

type FileProjection

type FileProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string                 `json:"id,omitempty"`
	CategoryID            string                 `json:"category_id,omitempty"`
	CategoryName          string                 `json:"category_name,omitempty"`
	CreatedAt             time.Time              `json:"created_at,omitempty"`
	CreatedBy             string                 `json:"created_by,omitempty"`
	DetectedContentType   string                 `json:"detected_content_type,omitempty"`
	DetectedMimeType      string                 `json:"detected_mime_type,omitempty"`
	EnvironmentID         string                 `json:"environment_id,omitempty"`
	EnvironmentName       string                 `json:"environment_name,omitempty"`
	InternalNotes         string                 `json:"internal_notes,omitempty"`
	LastAccessedAt        time.Time              `json:"last_accessed_at,omitempty"`
	Md5Hash               string                 `json:"md5_hash,omitempty"`
	Metadata              map[string]interface{} `json:"metadata,omitempty"`
	Name                  string                 `json:"name,omitempty"`
	PersistedFileSize     int64                  `json:"persisted_file_size,omitempty"`
	ProvidedFileExtension string                 `json:"provided_file_extension,omitempty"`
	ProvidedFileName      string                 `json:"provided_file_name,omitempty"`
	ProvidedFileSize      int64                  `json:"provided_file_size,omitempty"`
	ScopeID               string                 `json:"scope_id,omitempty"`
	ScopeName             string                 `json:"scope_name,omitempty"`
	StoragePath           string                 `json:"storage_path,omitempty"`
	StorageProvider       string                 `json:"storage_provider,omitempty"`
	StorageRegion         string                 `json:"storage_region,omitempty"`
	StorageScheme         string                 `json:"storage_scheme,omitempty"`
	StorageVolume         string                 `json:"storage_volume,omitempty"`
	StoreKey              string                 `json:"store_key,omitempty"`
	SystemInternalID      string                 `json:"system_internal_id,omitempty"`
	SystemOwned           bool                   `json:"system_owned,omitempty"`
	Tags                  []string               `json:"tags,omitempty"`
	UpdatedAt             time.Time              `json:"updated_at,omitempty"`
	UpdatedBy             string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator string                 `json:"updated_by_impersonator,omitempty"`
	URI                   string                 `json:"uri,omitempty"`
}

FileProjection is the flat, CEL- and jsonschema-facing view of a File: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.File whose edge graph cannot be reflected

type FindingControlProjection

type FindingControlProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                      string                 `json:"id,omitempty"`
	ControlID               string                 `json:"control_id,omitempty"`
	CreatedAt               time.Time              `json:"created_at,omitempty"`
	CreatedBy               string                 `json:"created_by,omitempty"`
	DiscoveredAt            models.DateTime        `json:"discovered_at,omitempty"`
	ExternalControlID       string                 `json:"external_control_id,omitempty"`
	ExternalStandard        string                 `json:"external_standard,omitempty"`
	ExternalStandardVersion string                 `json:"external_standard_version,omitempty"`
	FindingID               string                 `json:"finding_id,omitempty"`
	Metadata                map[string]interface{} `json:"metadata,omitempty"`
	OwnerID                 string                 `json:"owner_id,omitempty"`
	Source                  string                 `json:"source,omitempty"`
	StandardID              string                 `json:"standard_id,omitempty"`
	UpdatedAt               time.Time              `json:"updated_at,omitempty"`
	UpdatedBy               string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator   string                 `json:"updated_by_impersonator,omitempty"`
}

FindingControlProjection is the flat, CEL- and jsonschema-facing view of a FindingControl: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.FindingControl whose edge graph cannot be reflected

type FindingProjection

type FindingProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                            string                 `json:"id,omitempty"`
	AssessmentID                  string                 `json:"assessment_id,omitempty"`
	AssignedTo                    string                 `json:"assigned_to,omitempty"`
	AssignedToGroupID             string                 `json:"assigned_to_group_id,omitempty"`
	AssignedToIdentityHolderID    string                 `json:"assigned_to_identity_holder_id,omitempty"`
	AssignedToUserID              string                 `json:"assigned_to_user_id,omitempty"`
	BlocksProduction              bool                   `json:"blocks_production,omitempty"`
	Categories                    []string               `json:"categories,omitempty"`
	Category                      string                 `json:"category,omitempty"`
	CreatedAt                     time.Time              `json:"created_at,omitempty"`
	CreatedBy                     string                 `json:"created_by,omitempty"`
	Description                   string                 `json:"description,omitempty"`
	DisplayID                     string                 `json:"display_id,omitempty"`
	DisplayName                   string                 `json:"display_name,omitempty"`
	EnvironmentID                 string                 `json:"environment_id,omitempty"`
	EnvironmentName               string                 `json:"environment_name,omitempty"`
	EventTime                     models.DateTime        `json:"event_time,omitempty"`
	Exploitability                float64                `json:"exploitability,omitempty"`
	ExternalID                    string                 `json:"external_id,omitempty"`
	ExternalOwnerID               string                 `json:"external_owner_id,omitempty"`
	ExternalURI                   string                 `json:"external_uri,omitempty"`
	FindingClass                  string                 `json:"finding_class,omitempty"`
	FindingStatusID               string                 `json:"finding_status_id,omitempty"`
	FindingStatusName             string                 `json:"finding_status_name,omitempty"`
	Impact                        float64                `json:"impact,omitempty"`
	IntegrationRunID              string                 `json:"integration_run_id,omitempty"`
	InternalNotes                 string                 `json:"internal_notes,omitempty"`
	InternalOwner                 string                 `json:"internal_owner,omitempty"`
	InternalOwnerGroupID          string                 `json:"internal_owner_group_id,omitempty"`
	InternalOwnerIdentityHolderID string                 `json:"internal_owner_identity_holder_id,omitempty"`
	InternalOwnerUserID           string                 `json:"internal_owner_user_id,omitempty"`
	ManagedBy                     string                 `json:"managed_by,omitempty"`
	Metadata                      map[string]interface{} `json:"metadata,omitempty"`
	NumericSeverity               float64                `json:"numeric_severity,omitempty"`
	Open                          bool                   `json:"open,omitempty"`
	OwnerID                       string                 `json:"owner_id,omitempty"`
	Priority                      string                 `json:"priority,omitempty"`
	Production                    bool                   `json:"production,omitempty"`
	Public                        bool                   `json:"public,omitempty"`
	RawPayload                    map[string]interface{} `json:"raw_payload,omitempty"`
	Recommendation                string                 `json:"recommendation,omitempty"`
	RecommendedActions            string                 `json:"recommended_actions,omitempty"`
	References                    []string               `json:"references,omitempty"`
	RemediationSLA                int                    `json:"remediation_sla,omitempty"`
	ReportedAt                    models.DateTime        `json:"reported_at,omitempty"`
	ResourceName                  string                 `json:"resource_name,omitempty"`
	ReviewedBy                    string                 `json:"reviewed_by,omitempty"`
	ReviewedByGroupID             string                 `json:"reviewed_by_group_id,omitempty"`
	ReviewedByIdentityHolderID    string                 `json:"reviewed_by_identity_holder_id,omitempty"`
	ReviewedByUserID              string                 `json:"reviewed_by_user_id,omitempty"`
	ScopeID                       string                 `json:"scope_id,omitempty"`
	ScopeName                     string                 `json:"scope_name,omitempty"`
	Score                         float64                `json:"score,omitempty"`
	SecurityLevel                 enums.SecurityLevel    `json:"security_level,omitempty"`
	Severity                      string                 `json:"severity,omitempty"`
	Source                        string                 `json:"source,omitempty"`
	SourceDefinitionID            string                 `json:"source_definition_id,omitempty"`
	SourceDefinitionVersion       string                 `json:"source_definition_version,omitempty"`
	SourceInstanceID              string                 `json:"source_instance_id,omitempty"`
	SourceUpdatedAt               models.DateTime        `json:"source_updated_at,omitempty"`
	State                         string                 `json:"state,omitempty"`
	StepsToReproduce              []string               `json:"steps_to_reproduce,omitempty"`
	SystemInternalID              string                 `json:"system_internal_id,omitempty"`
	SystemOwned                   bool                   `json:"system_owned,omitempty"`
	Tags                          []string               `json:"tags,omitempty"`
	TargetDetails                 map[string]interface{} `json:"target_details,omitempty"`
	Targets                       []string               `json:"targets,omitempty"`
	UpdatedAt                     time.Time              `json:"updated_at,omitempty"`
	UpdatedBy                     string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator         string                 `json:"updated_by_impersonator,omitempty"`
	Validated                     bool                   `json:"validated,omitempty"`
	Vector                        string                 `json:"vector,omitempty"`
	WorkflowEligibleMarker        bool                   `json:"workflow_eligible_marker,omitempty"`
}

FindingProjection is the flat, CEL- and jsonschema-facing view of a Finding: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Finding whose edge graph cannot be reflected

type GroupProjection

type GroupProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string    `json:"id,omitempty"`
	AvatarLocalFileID     string    `json:"avatar_local_file_id,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	CreatedBy             string    `json:"created_by,omitempty"`
	Description           string    `json:"description,omitempty"`
	DisplayID             string    `json:"display_id,omitempty"`
	DisplayName           string    `json:"display_name,omitempty"`
	GravatarLogoURL       string    `json:"gravatar_logo_url,omitempty"`
	IsManaged             bool      `json:"is_managed,omitempty"`
	LogoURL               string    `json:"logo_url,omitempty"`
	Name                  string    `json:"name,omitempty"`
	OscalContactUuids     []string  `json:"oscal_contact_uuids,omitempty"`
	OscalPartyUUID        string    `json:"oscal_party_uuid,omitempty"`
	OscalRole             string    `json:"oscal_role,omitempty"`
	OwnerID               string    `json:"owner_id,omitempty"`
	ScimActive            bool      `json:"scim_active,omitempty"`
	ScimDisplayName       string    `json:"scim_display_name,omitempty"`
	ScimExternalID        string    `json:"scim_external_id,omitempty"`
	ScimGroupMailing      string    `json:"scim_group_mailing,omitempty"`
	Tags                  []string  `json:"tags,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
	UpdatedBy             string    `json:"updated_by,omitempty"`
	UpdatedByImpersonator string    `json:"updated_by_impersonator,omitempty"`
}

GroupProjection is the flat, CEL- and jsonschema-facing view of a Group: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Group whose edge graph cannot be reflected

type IdentityHolderProjection

type IdentityHolderProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                            string                   `json:"id,omitempty"`
	AlternateEmail                string                   `json:"alternate_email,omitempty"`
	AvatarRemoteURL               string                   `json:"avatar_remote_url,omitempty"`
	CreatedAt                     time.Time                `json:"created_at,omitempty"`
	CreatedBy                     string                   `json:"created_by,omitempty"`
	Department                    string                   `json:"department,omitempty"`
	DisplayID                     string                   `json:"display_id,omitempty"`
	Email                         string                   `json:"email,omitempty"`
	EmailAliases                  []string                 `json:"email_aliases,omitempty"`
	EmployerEntityID              string                   `json:"employer_entity_id,omitempty"`
	EndDate                       models.DateTime          `json:"end_date,omitempty"`
	EnvironmentID                 string                   `json:"environment_id,omitempty"`
	EnvironmentName               string                   `json:"environment_name,omitempty"`
	ExternalReferenceID           string                   `json:"external_reference_id,omitempty"`
	ExternalUserID                string                   `json:"external_user_id,omitempty"`
	FullName                      string                   `json:"full_name,omitempty"`
	IdentityHolderType            enums.IdentityHolderType `json:"identity_holder_type,omitempty"`
	InternalOwner                 string                   `json:"internal_owner,omitempty"`
	InternalOwnerGroupID          string                   `json:"internal_owner_group_id,omitempty"`
	InternalOwnerIdentityHolderID string                   `json:"internal_owner_identity_holder_id,omitempty"`
	InternalOwnerUserID           string                   `json:"internal_owner_user_id,omitempty"`
	IsActive                      bool                     `json:"is_active,omitempty"`
	IsOpenlaneUser                bool                     `json:"is_openlane_user,omitempty"`
	Location                      string                   `json:"location,omitempty"`
	Metadata                      map[string]interface{}   `json:"metadata,omitempty"`
	OwnerID                       string                   `json:"owner_id,omitempty"`
	PhoneNumber                   string                   `json:"phone_number,omitempty"`
	ScopeID                       string                   `json:"scope_id,omitempty"`
	ScopeName                     string                   `json:"scope_name,omitempty"`
	StartDate                     models.DateTime          `json:"start_date,omitempty"`
	Status                        enums.UserStatus         `json:"status,omitempty"`
	Tags                          []string                 `json:"tags,omitempty"`
	Team                          string                   `json:"team,omitempty"`
	Title                         string                   `json:"title,omitempty"`
	UpdatedAt                     time.Time                `json:"updated_at,omitempty"`
	UpdatedBy                     string                   `json:"updated_by,omitempty"`
	UpdatedByImpersonator         string                   `json:"updated_by_impersonator,omitempty"`
	UserID                        string                   `json:"user_id,omitempty"`
	WorkflowEligibleMarker        bool                     `json:"workflow_eligible_marker,omitempty"`
}

IdentityHolderProjection is the flat, CEL- and jsonschema-facing view of a IdentityHolder: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.IdentityHolder whose edge graph cannot be reflected

type IngestCapability

type IngestCapability struct {
	Topic gala.Topic[IngestRequest]
	// contains filtered or unexported fields
}

IngestCapability is the schema's single asynchronous ingest control surface.

type IngestIntegrationResolver

type IngestIntegrationResolver func(context.Context, *generated.Client, gala.OperationContext) (*generated.Integration, error)

IngestIntegrationResolver loads the integration referenced by the durable operation context. The application owns terminal-error classification for integrations removed while work is queued.

type IngestPersist

type IngestPersist func(context.Context, *generated.Client, *generated.Integration, json.RawMessage) (id string, changed bool, managed bool, err error)

IngestPersist is the type-erased persistence operation bound to a schema at startup.

type IngestRequest

type IngestRequest struct {
	OperationContext gala.OperationContext `json:"operationContext"`
	Input            json.RawMessage       `json:"input"`
	ThroughEdgeIDs   map[string][]string   `json:"throughEdgeIds,omitempty"`
	Defaults         map[string]any        `json:"defaults,omitempty"`
	Links            []LinkSpec            `json:"links,omitempty"`
	// RunID is the integration run the record belongs to
	RunID string `json:"runId,omitempty"`
}

IngestRequest is the durable schema-ingest command. Defaults are resolved through the schema field catalog, so operation-specific values do not become fields on the ingest machinery.

type IntegrationProjection

type IntegrationProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                       string                   `json:"id,omitempty"`
	CampaignEmail            bool                     `json:"campaign_email,omitempty"`
	CreatedAt                time.Time                `json:"created_at,omitempty"`
	CreatedBy                string                   `json:"created_by,omitempty"`
	DefinitionID             string                   `json:"definition_id,omitempty"`
	DefinitionSlug           string                   `json:"definition_slug,omitempty"`
	DefinitionVersion        string                   `json:"definition_version,omitempty"`
	Description              string                   `json:"description,omitempty"`
	EnvironmentID            string                   `json:"environment_id,omitempty"`
	EnvironmentName          string                   `json:"environment_name,omitempty"`
	ExpiresAt                time.Time                `json:"expires_at,omitempty"`
	Family                   string                   `json:"family,omitempty"`
	Health                   models.IntegrationHealth `json:"health,omitempty"`
	IntegrationType          string                   `json:"integration_type,omitempty"`
	InternalNotes            string                   `json:"internal_notes,omitempty"`
	Kind                     string                   `json:"kind,omitempty"`
	Metadata                 map[string]interface{}   `json:"metadata,omitempty"`
	Name                     string                   `json:"name,omitempty"`
	OwnerID                  string                   `json:"owner_id,omitempty"`
	PlatformID               string                   `json:"platform_id,omitempty"`
	PrimaryDirectory         bool                     `json:"primary_directory,omitempty"`
	ProviderMetadataSnapshot map[string]interface{}   `json:"provider_metadata_snapshot,omitempty"`
	ScopeID                  string                   `json:"scope_id,omitempty"`
	ScopeName                string                   `json:"scope_name,omitempty"`
	Status                   enums.IntegrationStatus  `json:"status,omitempty"`
	SystemInternalID         string                   `json:"system_internal_id,omitempty"`
	SystemOwned              bool                     `json:"system_owned,omitempty"`
	Tags                     []string                 `json:"tags,omitempty"`
	UpdatedAt                time.Time                `json:"updated_at,omitempty"`
	UpdatedBy                string                   `json:"updated_by,omitempty"`
	UpdatedByImpersonator    string                   `json:"updated_by_impersonator,omitempty"`
}

IntegrationProjection is the flat, CEL- and jsonschema-facing view of a Integration: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Integration whose edge graph cannot be reflected

type IntegrationRunProjection

type IntegrationRunProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string                         `json:"id,omitempty"`
	CreatedAt             time.Time                      `json:"created_at,omitempty"`
	CreatedBy             string                         `json:"created_by,omitempty"`
	DurationMs            int                            `json:"duration_ms,omitempty"`
	Error                 string                         `json:"error,omitempty"`
	FinishedAt            time.Time                      `json:"finished_at,omitempty"`
	IntegrationID         string                         `json:"integration_id,omitempty"`
	Metrics               map[string]interface{}         `json:"metrics,omitempty"`
	OperationConfig       map[string]interface{}         `json:"operation_config,omitempty"`
	OperationKind         enums.IntegrationOperationKind `json:"operation_kind,omitempty"`
	OperationName         string                         `json:"operation_name,omitempty"`
	OwnerID               string                         `json:"owner_id,omitempty"`
	RunType               enums.IntegrationRunType       `json:"run_type,omitempty"`
	StartedAt             time.Time                      `json:"started_at,omitempty"`
	Status                enums.IntegrationRunStatus     `json:"status,omitempty"`
	Summary               string                         `json:"summary,omitempty"`
	UpdatedAt             time.Time                      `json:"updated_at,omitempty"`
	UpdatedBy             string                         `json:"updated_by,omitempty"`
	UpdatedByImpersonator string                         `json:"updated_by_impersonator,omitempty"`
}

IntegrationRunProjection is the flat, CEL- and jsonschema-facing view of a IntegrationRun: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.IntegrationRun whose edge graph cannot be reflected

type InternalPolicyProjection

type InternalPolicyProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                              string                       `json:"id,omitempty"`
	ApprovalRequired                bool                         `json:"approval_required,omitempty"`
	ApproverID                      string                       `json:"approver_id,omitempty"`
	ControlSuggestions              []string                     `json:"control_suggestions,omitempty"`
	CreatedAt                       time.Time                    `json:"created_at,omitempty"`
	CreatedBy                       string                       `json:"created_by,omitempty"`
	DelegateID                      string                       `json:"delegate_id,omitempty"`
	Details                         string                       `json:"details,omitempty"`
	DetailsJSON                     []interface{}                `json:"details_json,omitempty"`
	DismissedControlSuggestions     []string                     `json:"dismissed_control_suggestions,omitempty"`
	DismissedImprovementSuggestions []string                     `json:"dismissed_improvement_suggestions,omitempty"`
	DismissedTagSuggestions         []string                     `json:"dismissed_tag_suggestions,omitempty"`
	DisplayID                       string                       `json:"display_id,omitempty"`
	EnvironmentID                   string                       `json:"environment_id,omitempty"`
	EnvironmentName                 string                       `json:"environment_name,omitempty"`
	ExternalContents                string                       `json:"external_contents,omitempty"`
	ExternalFileID                  string                       `json:"external_file_id,omitempty"`
	ExternalUUID                    string                       `json:"external_uuid,omitempty"`
	FileID                          string                       `json:"file_id,omitempty"`
	ImprovementSuggestions          []string                     `json:"improvement_suggestions,omitempty"`
	IntegrationRunID                string                       `json:"integration_run_id,omitempty"`
	InternalNotes                   string                       `json:"internal_notes,omitempty"`
	InternalPolicyKindID            string                       `json:"internal_policy_kind_id,omitempty"`
	InternalPolicyKindName          string                       `json:"internal_policy_kind_name,omitempty"`
	ManagedBy                       string                       `json:"managed_by,omitempty"`
	ManagementMode                  enums.DocumentManagementMode `json:"management_mode,omitempty"`
	Name                            string                       `json:"name,omitempty"`
	OwnerID                         string                       `json:"owner_id,omitempty"`
	ReviewDue                       time.Time                    `json:"review_due,omitempty"`
	ReviewFrequency                 enums.Frequency              `json:"review_frequency,omitempty"`
	Revision                        string                       `json:"revision,omitempty"`
	ScopeID                         string                       `json:"scope_id,omitempty"`
	ScopeName                       string                       `json:"scope_name,omitempty"`
	SourceDefinitionID              string                       `json:"source_definition_id,omitempty"`
	SourceDefinitionVersion         string                       `json:"source_definition_version,omitempty"`
	SourceInstanceID                string                       `json:"source_instance_id,omitempty"`
	Status                          enums.DocumentStatus         `json:"status,omitempty"`
	Summary                         string                       `json:"summary,omitempty"`
	SystemInternalID                string                       `json:"system_internal_id,omitempty"`
	SystemOwned                     bool                         `json:"system_owned,omitempty"`
	TagSuggestions                  []string                     `json:"tag_suggestions,omitempty"`
	Tags                            []string                     `json:"tags,omitempty"`
	UpdatedAt                       time.Time                    `json:"updated_at,omitempty"`
	UpdatedBy                       string                       `json:"updated_by,omitempty"`
	UpdatedByImpersonator           string                       `json:"updated_by_impersonator,omitempty"`
	URL                             string                       `json:"url,omitempty"`
	WorkflowEligibleMarker          bool                         `json:"workflow_eligible_marker,omitempty"`
}

InternalPolicyProjection is the flat, CEL- and jsonschema-facing view of a InternalPolicy: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.InternalPolicy whose edge graph cannot be reflected

type Invocation

type Invocation struct {
	// Context is the restored event context seeded with the ent client
	Context context.Context
	// Client is the ent client resolved from the gala injector
	Client *generated.Client
	// Schema is the entityops schema handle for the mutated type
	Schema *Schema
	// EntityID is the mutated entity identifier
	EntityID string
	// Caller is the pre-resolved caller for this dispatch, never nil
	Caller *auth.Caller
	// Envelope is the envelope being processed
	Envelope gala.Envelope
	// Injector provides typed dependency lookup via samber/do for every subsystem
	// registered at wiring
	Injector do.Injector
}

Invocation bundles the standard dependencies handed to a mutation listener

type KeyMatch

type KeyMatch struct {
	// TargetField is the snake_case field on the target schema to match against
	TargetField string `json:"target_field"`
	// SourceField is the snake_case scalar field on the source entity whose value must match the target field
	SourceField string `json:"source_field,omitempty"`
	// SourceList is the snake_case list field on the source entity holding additional candidate values
	SourceList string `json:"source_list,omitempty"`
}

KeyMatch describes a structured key-equality match between a target schema field and values taken from the source entity. When set on a TargetSelector it is compiled into an indexed query predicate (target_field IN source values) instead of a row-by-row expression evaluation

type LinkSpec

type LinkSpec struct {
	// Edge is the edge name on the source schema to link over
	Edge string `json:"edge"`
	// Target specifies which entities to link via schema, key match, or expression
	Target TargetSelector `json:"target"`
}

LinkSpec describes one edge-linking operation: the named edge to link over and a target selector resolving which entities to link. Resolved through selectTargets and applied by InjectCreateLinks, which sets the edge in the create mutation itself; shared by the integration ingest engine and the workflow CREATE_OBJECT action so both set edges identically at create time

type LookupAlternative

type LookupAlternative struct {
	// Fields is the ordered snake_case field names forming this alternative's composite key
	Fields []string
}

LookupAlternative is one ordered composite ingest lookup key of snake_case field names

type LookupValues

type LookupValues map[string]string

LookupValues is one row's or payload's values for a lookup alternative keyed by snake_case field name

type MappingEntry

type MappingEntry struct {
	// Key is the field's ingest input key
	Key string
	// Expr is the CEL expression producing the field's value
	Expr string
}

MappingEntry is one field-to-expression binding declared by an integration mapping

type MentionSpec

type MentionSpec struct {
	Schema           string `json:"schema"`
	NameField        string `json:"nameField"`
	DetailsField     string `json:"detailsField"`
	DetailsJSONField string `json:"detailsJsonField"`
	OwnerField       string `json:"ownerField"`
}

MentionSpec describes the rich-text fields scanned for mentions on a schema.

func MentionSpecFor

func MentionSpecFor(schemaType string) (MentionSpec, bool)

MentionSpecFor returns the annotation-declared mention fields for a schema.

type MutationConcern

type MutationConcern string

MutationConcern identifies the eventing concern namespace for mutation topics

const (
	// MutationConcernDirect is the default concern for direct mutation listeners
	MutationConcernDirect MutationConcern = "direct"
	// MutationConcernWorkflow is the concern for workflow mutation listeners
	MutationConcernWorkflow MutationConcern = "workflow"
	// MutationConcernNotification is the concern for notification mutation listeners
	MutationConcernNotification MutationConcern = "notification"
)

type MutationListener

type MutationListener struct {
	// Concern selects the mutation topic namespace; empty means the direct concern
	Concern MutationConcern
	// Schema is the canonical entityops schema whose mutations the listener observes
	Schema *Schema
	// Operations optionally scopes listener interest to specific mutation operations;
	// empty expands to RegularMutationOps, so OpSoftDelete is explicit opt-in
	Operations []string
	// Fields optionally gates update operations on at least one of these fields having
	// changed; create and delete operations pass the gate
	Fields []string
	// Match optionally gates handling on every proposed-value predicate holding
	Match []FieldMatch
	// Caller optionally replaces or augments the restored caller; it receives the restored
	// caller (never nil) and its result is set on the context and Invocation.Caller
	Caller func(*auth.Caller, MutationPayload) *auth.Caller
	// ContextKeys are applied to the context in order before the handler runs
	ContextKeys []func(context.Context) context.Context
	// Notify declares a declarative notification emitted when the gates pass; exactly one of
	// Handle and Notify must be set
	Notify *NotifySpec
	// Handle is invoked with the standard invocation bundle and the mutation payload
	Handle func(Invocation, MutationPayload) error
}

MutationListener declares one mutation listener bound to a schema mutation topic and compiles to a standard gala definition via Definition, so registration is always gala.Register. The listener name composes from the topic and optional label; declarative gating, caller resolution, and context keys compile to their definition fields, and the handler runs behind the standard preamble: restored-client validation and entity-id resolution

func (MutationListener) Attach

func (listener MutationListener) Attach(g *gala.Gala) (gala.ListenerID, error)

Attach compiles the listener to its definition and registers it on the runtime

func (MutationListener) Definition

func (listener MutationListener) Definition() gala.Definition[MutationPayload]

Definition compiles the listener into the standard gala definition, so mutation listeners register through gala.Register like every other listener

func (MutationListener) Name

func (listener MutationListener) Name() string

Name returns the composed listener name: the mutation topic, suffixed with the label when one is set

type MutationPayload

type MutationPayload struct {
	// MutationType is the ent schema type that emitted the mutation
	MutationType string `json:"mutation_type"`
	// Operation is the mutation operation string
	Operation string `json:"operation"`
	// EntityID is the mutated entity identifier
	EntityID string `json:"entity_id"`

	ChangeSet
}

MutationPayload is the durable mutation event payload dispatched to gala listeners. Identity field json tags and the embedded ChangeSet tags are wire format for queued jobs

func (MutationPayload) PayloadOperation

func (payload MutationPayload) PayloadOperation() string

PayloadOperation returns the mutation operation for gala listener routing

type NarrativeProjection

type NarrativeProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string    `json:"id,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	CreatedBy             string    `json:"created_by,omitempty"`
	Description           string    `json:"description,omitempty"`
	Details               string    `json:"details,omitempty"`
	DisplayID             string    `json:"display_id,omitempty"`
	InternalNotes         string    `json:"internal_notes,omitempty"`
	Name                  string    `json:"name,omitempty"`
	OwnerID               string    `json:"owner_id,omitempty"`
	SystemInternalID      string    `json:"system_internal_id,omitempty"`
	SystemOwned           bool      `json:"system_owned,omitempty"`
	Tags                  []string  `json:"tags,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
	UpdatedBy             string    `json:"updated_by,omitempty"`
	UpdatedByImpersonator string    `json:"updated_by_impersonator,omitempty"`
}

NarrativeProjection is the flat, CEL- and jsonschema-facing view of a Narrative: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Narrative whose edge graph cannot be reflected

type NoteProjection

type NoteProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string        `json:"id,omitempty"`
	CreatedAt             time.Time     `json:"created_at,omitempty"`
	CreatedBy             string        `json:"created_by,omitempty"`
	DiscussionID          string        `json:"discussion_id,omitempty"`
	DisplayID             string        `json:"display_id,omitempty"`
	IsEdited              bool          `json:"is_edited,omitempty"`
	NoteRef               string        `json:"note_ref,omitempty"`
	NotifiedAt            time.Time     `json:"notified_at,omitempty"`
	NotifySubscribers     bool          `json:"notify_subscribers,omitempty"`
	OwnerID               string        `json:"owner_id,omitempty"`
	Text                  string        `json:"text,omitempty"`
	TextJSON              []interface{} `json:"text_json,omitempty"`
	Title                 string        `json:"title,omitempty"`
	TrustCenterID         string        `json:"trust_center_id,omitempty"`
	UpdatedAt             time.Time     `json:"updated_at,omitempty"`
	UpdatedBy             string        `json:"updated_by,omitempty"`
	UpdatedByImpersonator string        `json:"updated_by_impersonator,omitempty"`
}

NoteProjection is the flat, CEL- and jsonschema-facing view of a Note: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Note whose edge graph cannot be reflected

type NotificationContent

type NotificationContent struct {
	// Type is the notification audience type
	Type enums.NotificationType
	// Topic is the notification topic
	Topic enums.NotificationTopic
	// TitleTemplate is the Go text/template title, matching the ent title_template column
	TitleTemplate string
	// BodyTemplate is the Go text/template body, matching the ent body_template column
	BodyTemplate string
	// Data is static base data carried on the notification; string values render as templates
	// and empty rendered values are omitted, matching the ent defaults column semantics
	Data map[string]any
}

NotificationContent is the in-code notification content contract; its fields mirror the notification_template ent schema columns so specs can later hydrate from persisted rows

type NotifySpec

type NotifySpec struct {
	// Recipients resolves recipient user ids; an empty result skips emission
	Recipients func(Invocation, MutationPayload, json.RawMessage) ([]string, error)
	// Content is the notification content rendered per emission
	Content NotificationContent
}

NotifySpec declares a declarative notification on a mutation listener: recipients resolve from the invocation, payload, and loaded row, and content renders against the notification vars

type OrganizationProjection

type OrganizationProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string    `json:"id,omitempty"`
	AvatarLocalFileID     string    `json:"avatar_local_file_id,omitempty"`
	AvatarRemoteURL       string    `json:"avatar_remote_url,omitempty"`
	AvatarUpdatedAt       time.Time `json:"avatar_updated_at,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	CreatedBy             string    `json:"created_by,omitempty"`
	Description           string    `json:"description,omitempty"`
	DisplayName           string    `json:"display_name,omitempty"`
	Name                  string    `json:"name,omitempty"`
	PersonalOrg           bool      `json:"personal_org,omitempty"`
	SlugName              string    `json:"slug_name,omitempty"`
	StripeCustomerID      string    `json:"stripe_customer_id,omitempty"`
	Tags                  []string  `json:"tags,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
	UpdatedBy             string    `json:"updated_by,omitempty"`
	UpdatedByImpersonator string    `json:"updated_by_impersonator,omitempty"`
}

OrganizationProjection is the flat, CEL- and jsonschema-facing view of a Organization: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Organization whose edge graph cannot be reflected

type PlatformProjection

type PlatformProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                             string                 `json:"id,omitempty"`
	AccessModelID                  string                 `json:"access_model_id,omitempty"`
	AccessModelName                string                 `json:"access_model_name,omitempty"`
	BusinessOwner                  string                 `json:"business_owner,omitempty"`
	BusinessOwnerGroupID           string                 `json:"business_owner_group_id,omitempty"`
	BusinessOwnerIdentityHolderID  string                 `json:"business_owner_identity_holder_id,omitempty"`
	BusinessOwnerUserID            string                 `json:"business_owner_user_id,omitempty"`
	BusinessPurpose                string                 `json:"business_purpose,omitempty"`
	ContainsPii                    bool                   `json:"contains_pii,omitempty"`
	CostCenter                     string                 `json:"cost_center,omitempty"`
	CreatedAt                      time.Time              `json:"created_at,omitempty"`
	CreatedBy                      string                 `json:"created_by,omitempty"`
	CriticalityID                  string                 `json:"criticality_id,omitempty"`
	CriticalityName                string                 `json:"criticality_name,omitempty"`
	DataFlowSummary                string                 `json:"data_flow_summary,omitempty"`
	Description                    string                 `json:"description,omitempty"`
	DisplayID                      string                 `json:"display_id,omitempty"`
	EncryptionStatusID             string                 `json:"encryption_status_id,omitempty"`
	EncryptionStatusName           string                 `json:"encryption_status_name,omitempty"`
	EnvironmentID                  string                 `json:"environment_id,omitempty"`
	EnvironmentName                string                 `json:"environment_name,omitempty"`
	EstimatedMonthlyCost           float64                `json:"estimated_monthly_cost,omitempty"`
	ExternalReferenceID            string                 `json:"external_reference_id,omitempty"`
	ExternalUUID                   string                 `json:"external_uuid,omitempty"`
	InternalOwner                  string                 `json:"internal_owner,omitempty"`
	InternalOwnerGroupID           string                 `json:"internal_owner_group_id,omitempty"`
	InternalOwnerIdentityHolderID  string                 `json:"internal_owner_identity_holder_id,omitempty"`
	InternalOwnerUserID            string                 `json:"internal_owner_user_id,omitempty"`
	Metadata                       map[string]interface{} `json:"metadata,omitempty"`
	Name                           string                 `json:"name,omitempty"`
	OwnerID                        string                 `json:"owner_id,omitempty"`
	PhysicalLocation               string                 `json:"physical_location,omitempty"`
	PlatformDataClassificationID   string                 `json:"platform_data_classification_id,omitempty"`
	PlatformDataClassificationName string                 `json:"platform_data_classification_name,omitempty"`
	PlatformKindID                 string                 `json:"platform_kind_id,omitempty"`
	PlatformKindName               string                 `json:"platform_kind_name,omitempty"`
	PlatformOwnerID                string                 `json:"platform_owner_id,omitempty"`
	PurchaseDate                   models.DateTime        `json:"purchase_date,omitempty"`
	Region                         string                 `json:"region,omitempty"`
	ScopeID                        string                 `json:"scope_id,omitempty"`
	ScopeName                      string                 `json:"scope_name,omitempty"`
	ScopeStatement                 string                 `json:"scope_statement,omitempty"`
	SecurityOwner                  string                 `json:"security_owner,omitempty"`
	SecurityOwnerGroupID           string                 `json:"security_owner_group_id,omitempty"`
	SecurityOwnerIdentityHolderID  string                 `json:"security_owner_identity_holder_id,omitempty"`
	SecurityOwnerUserID            string                 `json:"security_owner_user_id,omitempty"`
	SecurityTierID                 string                 `json:"security_tier_id,omitempty"`
	SecurityTierName               string                 `json:"security_tier_name,omitempty"`
	SourceIdentifier               string                 `json:"source_identifier,omitempty"`
	SourceType                     enums.SourceType       `json:"source_type,omitempty"`
	Status                         enums.PlatformStatus   `json:"status,omitempty"`
	Tags                           []string               `json:"tags,omitempty"`
	TechnicalOwner                 string                 `json:"technical_owner,omitempty"`
	TechnicalOwnerGroupID          string                 `json:"technical_owner_group_id,omitempty"`
	TechnicalOwnerIdentityHolderID string                 `json:"technical_owner_identity_holder_id,omitempty"`
	TechnicalOwnerUserID           string                 `json:"technical_owner_user_id,omitempty"`
	TrustBoundaryDescription       string                 `json:"trust_boundary_description,omitempty"`
	UpdatedAt                      time.Time              `json:"updated_at,omitempty"`
	UpdatedBy                      string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator          string                 `json:"updated_by_impersonator,omitempty"`
	WorkflowEligibleMarker         bool                   `json:"workflow_eligible_marker,omitempty"`
}

PlatformProjection is the flat, CEL- and jsonschema-facing view of a Platform: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Platform whose edge graph cannot be reflected

type ProcedureProjection

type ProcedureProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                              string                       `json:"id,omitempty"`
	ApprovalRequired                bool                         `json:"approval_required,omitempty"`
	ApproverID                      string                       `json:"approver_id,omitempty"`
	ControlSuggestions              []string                     `json:"control_suggestions,omitempty"`
	CreatedAt                       time.Time                    `json:"created_at,omitempty"`
	CreatedBy                       string                       `json:"created_by,omitempty"`
	DelegateID                      string                       `json:"delegate_id,omitempty"`
	Details                         string                       `json:"details,omitempty"`
	DetailsJSON                     []interface{}                `json:"details_json,omitempty"`
	DismissedControlSuggestions     []string                     `json:"dismissed_control_suggestions,omitempty"`
	DismissedImprovementSuggestions []string                     `json:"dismissed_improvement_suggestions,omitempty"`
	DismissedTagSuggestions         []string                     `json:"dismissed_tag_suggestions,omitempty"`
	DisplayID                       string                       `json:"display_id,omitempty"`
	EnvironmentID                   string                       `json:"environment_id,omitempty"`
	EnvironmentName                 string                       `json:"environment_name,omitempty"`
	ExternalContents                string                       `json:"external_contents,omitempty"`
	ExternalFileID                  string                       `json:"external_file_id,omitempty"`
	FileID                          string                       `json:"file_id,omitempty"`
	ImprovementSuggestions          []string                     `json:"improvement_suggestions,omitempty"`
	IntegrationRunID                string                       `json:"integration_run_id,omitempty"`
	InternalNotes                   string                       `json:"internal_notes,omitempty"`
	ManagedBy                       string                       `json:"managed_by,omitempty"`
	ManagementMode                  enums.DocumentManagementMode `json:"management_mode,omitempty"`
	Name                            string                       `json:"name,omitempty"`
	OwnerID                         string                       `json:"owner_id,omitempty"`
	ProcedureKindID                 string                       `json:"procedure_kind_id,omitempty"`
	ProcedureKindName               string                       `json:"procedure_kind_name,omitempty"`
	ReviewDue                       time.Time                    `json:"review_due,omitempty"`
	ReviewFrequency                 enums.Frequency              `json:"review_frequency,omitempty"`
	Revision                        string                       `json:"revision,omitempty"`
	ScopeID                         string                       `json:"scope_id,omitempty"`
	ScopeName                       string                       `json:"scope_name,omitempty"`
	SourceDefinitionID              string                       `json:"source_definition_id,omitempty"`
	SourceDefinitionVersion         string                       `json:"source_definition_version,omitempty"`
	SourceInstanceID                string                       `json:"source_instance_id,omitempty"`
	Status                          enums.DocumentStatus         `json:"status,omitempty"`
	Summary                         string                       `json:"summary,omitempty"`
	SystemInternalID                string                       `json:"system_internal_id,omitempty"`
	SystemOwned                     bool                         `json:"system_owned,omitempty"`
	TagSuggestions                  []string                     `json:"tag_suggestions,omitempty"`
	Tags                            []string                     `json:"tags,omitempty"`
	UpdatedAt                       time.Time                    `json:"updated_at,omitempty"`
	UpdatedBy                       string                       `json:"updated_by,omitempty"`
	UpdatedByImpersonator           string                       `json:"updated_by_impersonator,omitempty"`
	URL                             string                       `json:"url,omitempty"`
	WorkflowEligibleMarker          bool                         `json:"workflow_eligible_marker,omitempty"`
}

ProcedureProjection is the flat, CEL- and jsonschema-facing view of a Procedure: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Procedure whose edge graph cannot be reflected

type ProgramProjection

type ProgramProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                         string              `json:"id,omitempty"`
	AuditFirm                  string              `json:"audit_firm,omitempty"`
	Auditor                    string              `json:"auditor,omitempty"`
	AuditorEmail               string              `json:"auditor_email,omitempty"`
	AuditorReadComments        bool                `json:"auditor_read_comments,omitempty"`
	AuditorReady               bool                `json:"auditor_ready,omitempty"`
	AuditorWriteComments       bool                `json:"auditor_write_comments,omitempty"`
	CreatedAt                  time.Time           `json:"created_at,omitempty"`
	CreatedBy                  string              `json:"created_by,omitempty"`
	Description                string              `json:"description,omitempty"`
	DisplayID                  string              `json:"display_id,omitempty"`
	EndDate                    time.Time           `json:"end_date,omitempty"`
	ExternalUUID               string              `json:"external_uuid,omitempty"`
	FieldworkEndDate           time.Time           `json:"fieldwork_end_date,omitempty"`
	FieldworkStartDate         time.Time           `json:"fieldwork_start_date,omitempty"`
	FrameworkName              string              `json:"framework_name,omitempty"`
	Name                       string              `json:"name,omitempty"`
	ObservationPeriodEndDate   time.Time           `json:"observation_period_end_date,omitempty"`
	ObservationPeriodStartDate time.Time           `json:"observation_period_start_date,omitempty"`
	OwnerID                    string              `json:"owner_id,omitempty"`
	ProgramKindID              string              `json:"program_kind_id,omitempty"`
	ProgramKindName            string              `json:"program_kind_name,omitempty"`
	ProgramOwnerID             string              `json:"program_owner_id,omitempty"`
	StartDate                  time.Time           `json:"start_date,omitempty"`
	Status                     enums.ProgramStatus `json:"status,omitempty"`
	Tags                       []string            `json:"tags,omitempty"`
	UpdatedAt                  time.Time           `json:"updated_at,omitempty"`
	UpdatedBy                  string              `json:"updated_by,omitempty"`
	UpdatedByImpersonator      string              `json:"updated_by_impersonator,omitempty"`
}

ProgramProjection is the flat, CEL- and jsonschema-facing view of a Program: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Program whose edge graph cannot be reflected

type RemediationProjection

type RemediationProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                     string                  `json:"id,omitempty"`
	CompletedAt            models.DateTime         `json:"completed_at,omitempty"`
	CreatedAt              time.Time               `json:"created_at,omitempty"`
	CreatedBy              string                  `json:"created_by,omitempty"`
	DisplayID              string                  `json:"display_id,omitempty"`
	DueAt                  models.DateTime         `json:"due_at,omitempty"`
	EnvironmentID          string                  `json:"environment_id,omitempty"`
	EnvironmentName        string                  `json:"environment_name,omitempty"`
	Error                  string                  `json:"error,omitempty"`
	Explanation            string                  `json:"explanation,omitempty"`
	ExternalID             string                  `json:"external_id,omitempty"`
	ExternalOwnerID        string                  `json:"external_owner_id,omitempty"`
	ExternalURI            string                  `json:"external_uri,omitempty"`
	Instructions           string                  `json:"instructions,omitempty"`
	Intent                 string                  `json:"intent,omitempty"`
	InternalNotes          string                  `json:"internal_notes,omitempty"`
	Metadata               map[string]interface{}  `json:"metadata,omitempty"`
	OwnerID                string                  `json:"owner_id,omitempty"`
	OwnerReference         string                  `json:"owner_reference,omitempty"`
	PrGeneratedAt          models.DateTime         `json:"pr_generated_at,omitempty"`
	PullRequestURI         string                  `json:"pull_request_uri,omitempty"`
	RepositoryURI          string                  `json:"repository_uri,omitempty"`
	ScopeID                string                  `json:"scope_id,omitempty"`
	ScopeName              string                  `json:"scope_name,omitempty"`
	Source                 string                  `json:"source,omitempty"`
	State                  string                  `json:"state,omitempty"`
	Status                 enums.RemediationStatus `json:"status,omitempty"`
	Summary                string                  `json:"summary,omitempty"`
	SystemInternalID       string                  `json:"system_internal_id,omitempty"`
	SystemOwned            bool                    `json:"system_owned,omitempty"`
	Tags                   []string                `json:"tags,omitempty"`
	TicketReference        string                  `json:"ticket_reference,omitempty"`
	Title                  string                  `json:"title,omitempty"`
	UpdatedAt              time.Time               `json:"updated_at,omitempty"`
	UpdatedBy              string                  `json:"updated_by,omitempty"`
	UpdatedByImpersonator  string                  `json:"updated_by_impersonator,omitempty"`
	WorkflowEligibleMarker bool                    `json:"workflow_eligible_marker,omitempty"`
}

RemediationProjection is the flat, CEL- and jsonschema-facing view of a Remediation: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Remediation whose edge graph cannot be reflected

type ReviewProjection

type ReviewProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string                 `json:"id,omitempty"`
	Approved              bool                   `json:"approved,omitempty"`
	ApprovedAt            models.DateTime        `json:"approved_at,omitempty"`
	Category              string                 `json:"category,omitempty"`
	Classification        string                 `json:"classification,omitempty"`
	CreatedAt             time.Time              `json:"created_at,omitempty"`
	CreatedBy             string                 `json:"created_by,omitempty"`
	Details               string                 `json:"details,omitempty"`
	EnvironmentID         string                 `json:"environment_id,omitempty"`
	EnvironmentName       string                 `json:"environment_name,omitempty"`
	ExternalID            string                 `json:"external_id,omitempty"`
	ExternalOwnerID       string                 `json:"external_owner_id,omitempty"`
	ExternalURI           string                 `json:"external_uri,omitempty"`
	InternalNotes         string                 `json:"internal_notes,omitempty"`
	Metadata              map[string]interface{} `json:"metadata,omitempty"`
	OwnerID               string                 `json:"owner_id,omitempty"`
	RawPayload            map[string]interface{} `json:"raw_payload,omitempty"`
	ReportedAt            models.DateTime        `json:"reported_at,omitempty"`
	Reporter              string                 `json:"reporter,omitempty"`
	ReviewedAt            models.DateTime        `json:"reviewed_at,omitempty"`
	ReviewerID            string                 `json:"reviewer_id,omitempty"`
	ScopeID               string                 `json:"scope_id,omitempty"`
	ScopeName             string                 `json:"scope_name,omitempty"`
	Source                string                 `json:"source,omitempty"`
	State                 string                 `json:"state,omitempty"`
	Status                enums.ReviewStatus     `json:"status,omitempty"`
	Summary               string                 `json:"summary,omitempty"`
	SystemInternalID      string                 `json:"system_internal_id,omitempty"`
	SystemOwned           bool                   `json:"system_owned,omitempty"`
	Tags                  []string               `json:"tags,omitempty"`
	Title                 string                 `json:"title,omitempty"`
	UpdatedAt             time.Time              `json:"updated_at,omitempty"`
	UpdatedBy             string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator string                 `json:"updated_by_impersonator,omitempty"`
}

ReviewProjection is the flat, CEL- and jsonschema-facing view of a Review: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Review whose edge graph cannot be reflected

type RiskProjection

type RiskProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                          string               `json:"id,omitempty"`
	BusinessCosts               string               `json:"business_costs,omitempty"`
	BusinessCostsJSON           []interface{}        `json:"business_costs_json,omitempty"`
	CreatedAt                   time.Time            `json:"created_at,omitempty"`
	CreatedBy                   string               `json:"created_by,omitempty"`
	DelegateGroupID             string               `json:"delegate_group_id,omitempty"`
	DelegateID                  string               `json:"delegate_id,omitempty"`
	DelegateIdentityHolderID    string               `json:"delegate_identity_holder_id,omitempty"`
	DelegateName                string               `json:"delegate_name,omitempty"`
	DelegateUserID              string               `json:"delegate_user_id,omitempty"`
	Details                     string               `json:"details,omitempty"`
	DetailsJSON                 []interface{}        `json:"details_json,omitempty"`
	DisplayID                   string               `json:"display_id,omitempty"`
	DueDate                     models.DateTime      `json:"due_date,omitempty"`
	EnvironmentID               string               `json:"environment_id,omitempty"`
	EnvironmentName             string               `json:"environment_name,omitempty"`
	ExternalID                  string               `json:"external_id,omitempty"`
	ExternalUUID                string               `json:"external_uuid,omitempty"`
	Impact                      enums.RiskImpact     `json:"impact,omitempty"`
	IntegrationID               string               `json:"integration_id,omitempty"`
	IntegrationRunID            string               `json:"integration_run_id,omitempty"`
	LastReviewedAt              models.DateTime      `json:"last_reviewed_at,omitempty"`
	Likelihood                  enums.RiskLikelihood `json:"likelihood,omitempty"`
	ManagedBy                   string               `json:"managed_by,omitempty"`
	MitigatedAt                 models.DateTime      `json:"mitigated_at,omitempty"`
	Mitigation                  string               `json:"mitigation,omitempty"`
	MitigationJSON              []interface{}        `json:"mitigation_json,omitempty"`
	Name                        string               `json:"name,omitempty"`
	NextReviewDueAt             models.DateTime      `json:"next_review_due_at,omitempty"`
	ObservedAt                  models.DateTime      `json:"observed_at,omitempty"`
	OwnerID                     string               `json:"owner_id,omitempty"`
	ResidualScore               int                  `json:"residual_score,omitempty"`
	ReviewFrequency             enums.Frequency      `json:"review_frequency,omitempty"`
	ReviewRequired              bool                 `json:"review_required,omitempty"`
	RiskCategoryID              string               `json:"risk_category_id,omitempty"`
	RiskCategoryName            string               `json:"risk_category_name,omitempty"`
	RiskDecision                enums.RiskDecision   `json:"risk_decision,omitempty"`
	RiskKindID                  string               `json:"risk_kind_id,omitempty"`
	RiskKindName                string               `json:"risk_kind_name,omitempty"`
	ScopeID                     string               `json:"scope_id,omitempty"`
	ScopeName                   string               `json:"scope_name,omitempty"`
	Score                       int                  `json:"score,omitempty"`
	SourceDefinitionID          string               `json:"source_definition_id,omitempty"`
	SourceDefinitionVersion     string               `json:"source_definition_version,omitempty"`
	SourceInstanceID            string               `json:"source_instance_id,omitempty"`
	StakeholderGroupID          string               `json:"stakeholder_group_id,omitempty"`
	StakeholderID               string               `json:"stakeholder_id,omitempty"`
	StakeholderIdentityHolderID string               `json:"stakeholder_identity_holder_id,omitempty"`
	StakeholderName             string               `json:"stakeholder_name,omitempty"`
	StakeholderUserID           string               `json:"stakeholder_user_id,omitempty"`
	Status                      enums.RiskStatus     `json:"status,omitempty"`
	Tags                        []string             `json:"tags,omitempty"`
	UpdatedAt                   time.Time            `json:"updated_at,omitempty"`
	UpdatedBy                   string               `json:"updated_by,omitempty"`
	UpdatedByImpersonator       string               `json:"updated_by_impersonator,omitempty"`
	WorkflowEligibleMarker      bool                 `json:"workflow_eligible_marker,omitempty"`
}

RiskProjection is the flat, CEL- and jsonschema-facing view of a Risk: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Risk whose edge graph cannot be reflected

type ScanProjection

type ScanProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                         string                 `json:"id,omitempty"`
	AssignedTo                 string                 `json:"assigned_to,omitempty"`
	AssignedToGroupID          string                 `json:"assigned_to_group_id,omitempty"`
	AssignedToIdentityHolderID string                 `json:"assigned_to_identity_holder_id,omitempty"`
	AssignedToUserID           string                 `json:"assigned_to_user_id,omitempty"`
	CreatedAt                  time.Time              `json:"created_at,omitempty"`
	CreatedBy                  string                 `json:"created_by,omitempty"`
	DiscoveredVulnerabilityIds []string               `json:"discovered_vulnerability_ids,omitempty"`
	EnvironmentID              string                 `json:"environment_id,omitempty"`
	EnvironmentName            string                 `json:"environment_name,omitempty"`
	GeneratedByPlatformID      string                 `json:"generated_by_platform_id,omitempty"`
	InternalNotes              string                 `json:"internal_notes,omitempty"`
	Metadata                   map[string]interface{} `json:"metadata,omitempty"`
	NextScanRunAt              models.DateTime        `json:"next_scan_run_at,omitempty"`
	OwnerID                    string                 `json:"owner_id,omitempty"`
	PerformedBy                string                 `json:"performed_by,omitempty"`
	PerformedByGroupID         string                 `json:"performed_by_group_id,omitempty"`
	PerformedByUserID          string                 `json:"performed_by_user_id,omitempty"`
	ReviewedBy                 string                 `json:"reviewed_by,omitempty"`
	ReviewedByGroupID          string                 `json:"reviewed_by_group_id,omitempty"`
	ReviewedByIdentityHolderID string                 `json:"reviewed_by_identity_holder_id,omitempty"`
	ReviewedByUserID           string                 `json:"reviewed_by_user_id,omitempty"`
	ScanDate                   models.DateTime        `json:"scan_date,omitempty"`
	ScanSchedule               models.Cron            `json:"scan_schedule,omitempty"`
	ScanType                   enums.ScanType         `json:"scan_type,omitempty"`
	ScopeID                    string                 `json:"scope_id,omitempty"`
	ScopeName                  string                 `json:"scope_name,omitempty"`
	Status                     enums.ScanStatus       `json:"status,omitempty"`
	SystemInternalID           string                 `json:"system_internal_id,omitempty"`
	SystemOwned                bool                   `json:"system_owned,omitempty"`
	Tags                       []string               `json:"tags,omitempty"`
	Target                     string                 `json:"target,omitempty"`
	UpdatedAt                  time.Time              `json:"updated_at,omitempty"`
	UpdatedBy                  string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator      string                 `json:"updated_by_impersonator,omitempty"`
}

ScanProjection is the flat, CEL- and jsonschema-facing view of a Scan: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Scan whose edge graph cannot be reflected

type Schema

type Schema struct {
	SchemaDescriptor
	// Create creates a new entity from a JSON input and returns the entity ID; emitted only for
	// integration-mapped schemas, whose ingest upsert is the sole caller
	Create func(ctx context.Context, client *generated.Client, input json.RawMessage) (string, error)
	// Update applies a typed update input to an entity by ID; emitted only for integration-mapped
	// and workflow-eligible schemas
	Update func(ctx context.Context, client *generated.Client, entityID string, input json.RawMessage) error
	// Query returns all entities of this schema within an organization as JSON; emitted only for
	// integration-mapped schemas and link-rule targets, whose target selection is the sole caller
	Query func(ctx context.Context, client *generated.Client, orgID string) ([]json.RawMessage, error)
	// QueryByKey returns entities of this schema within an organization whose given snake_case
	// field matches any of the provided values, pushing the predicate into the database; emitted
	// only for integration-mapped schemas and link-rule targets with match-key columns
	QueryByKey func(ctx context.Context, client *generated.Client, orgID string, field string, values []string) ([]json.RawMessage, error)
	// IntegrationFKField is the schema's mutable FK column to Integration, if any
	IntegrationFKField string
	// IntegrationM2MEdge is the name of the schema's to-many edge to Integration, if any
	IntegrationM2MEdge string
	// IntegrationRunM2MEdge is the name of the schema's to-many edge to IntegrationRun, if any
	IntegrationRunM2MEdge string
	// RemovedAtField is the snake_case name of the schema's SnapshotRemoval-annotated field, if any
	RemovedAtField string
	// RemovedAtEpisodic reports whether removal is a recurring observation rather than a permanent tombstone
	RemovedAtEpisodic bool
	// Lookup lists the schema's composite ingest lookup alternatives in order
	Lookup []LookupAlternative
	// InstanceScoped reports whether same-key records from different source instances are distinct rows
	InstanceScoped bool
	// QueryByLookup returns rows matching one of the given key tuples for a declared lookup alternative
	QueryByLookup func(ctx context.Context, client *generated.Client, ownerID string, alternative int, keys []LookupValues) ([]json.RawMessage, error)
	// SnapshotScope returns the non-removed rows one installation manages for a definition and instance
	SnapshotScope func(ctx context.Context, client *generated.Client, ownerID, definitionID, instanceID, managedBy string) ([]json.RawMessage, error)
	// MarkRemoved bulk-marks the given ids removed at the given time under the given integration run
	MarkRemoved func(ctx context.Context, client *generated.Client, ids []string, at time.Time, runID string) error
	// FillProvenance fills missing provenance on rows linked to the installation and reports rows written
	FillProvenance func(ctx context.Context, client *generated.Client, installation *generated.Integration) (int, error)
	// Load loads a single entity by ID and returns its JSON representation
	Load func(ctx context.Context, client *generated.Client, entityID string) (json.RawMessage, error)
	// LoadObject loads the native generated Ent object for consumers that require its interfaces;
	// emitted only for workflow-eligible schemas, whose workflow object loading is the sole caller
	LoadObject func(ctx context.Context, client *generated.Client, entityID string) (any, error)
	// Fields is the unified field catalog for this schema, consumed by the workflow builder and the
	// integration cross-link config; workflow-eligible and match-key views are filtered from it
	Fields []FieldDescriptor
	// Edges lists every edge to an entityops schema (and workflow group edges) for this schema
	Edges []EdgeDescriptor
	// TaskRules are schema-level (unconditional) suggested-task rules declared via entx.SchemaTaskRule
	TaskRules []TaskRuleDescriptor
	// ProjectionType is the reflect.Type of this schema's flat CEL/jsonschema projection struct
	// ({Name}Projection); the registerable native-type view of the entity used for typed expressions.
	// Projections are emitted only for integration-mapped, workflow-eligible, and link-target
	// schemas, the schemas typed expression evaluation can reach; nil otherwise
	ProjectionType reflect.Type
	// Ingest is present when this schema supports mapped integration ingestion
	Ingest *IngestCapability
	// ConsoleRoute is present only when the schema explicitly declares a console route
	ConsoleRoute *ConsoleRoute
	// MentionSpec is present only when the schema explicitly declares mention scanning
	MentionSpec *MentionSpec
	// ApprovalSpec is present only when the schema explicitly declares approval fields
	ApprovalSpec *ApprovalSpec
}

Schema is the runtime representation of a registered entity schema. It carries the schema identity and its operation closures. Load, Fields, and Edges are universal; the remaining closures are emitted only for schemas whose capabilities can reach them and are nil otherwise

func AllSchemas

func AllSchemas() []*Schema

AllSchemas returns a copy of all registered schemas

func LookupSchema

func LookupSchema(name string) (*Schema, bool)

LookupSchema resolves a schema by any known name variation (PascalCase, snake_case, camelCase, or lowercase). Returns the schema and whether a match was found.

func TaskRuleEligibleSchemas

func TaskRuleEligibleSchemas() []*Schema

TaskRuleEligibleSchemas returns every registered schema carrying at least one task rule

func WorkflowObjectFromRef

func WorkflowObjectFromRef(ref *generated.WorkflowObjectRef) (*Schema, string, error)

WorkflowObjectFromRef resolves an object-reference row through the canonical edge catalog.

func (*Schema) AllTaskRules

func (s *Schema) AllTaskRules() []FieldTaskRule

AllTaskRules returns every task rule registered on this schema, both schema-level and field-level, as a flat list pairing each rule with its source field

func (*Schema) ApplyWorkflowFields

func (s *Schema) ApplyWorkflowFields(ctx context.Context, client *generated.Client, objectID string, updates map[string]any) error

ApplyWorkflowFields validates and applies workflow updates through the schema's existing updater.

func (*Schema) CoerceValue

func (s *Schema) CoerceValue(name string, value any) (any, error)

CoerceValue coerces a raw document value into the Go shape of the named field per its catalog type. Unknown and custom field types pass through unchanged so JSON unmarshalling into the typed create input remains the final arbiter

func (*Schema) DisplayField

func (s *Schema) DisplayField() (FieldDescriptor, bool)

DisplayField returns the schema's display-name field; generation enforces at most one

func (*Schema) DisplayValue

func (s *Schema) DisplayValue(row json.RawMessage) string

DisplayValue returns the display-name value from a loaded row, or empty when the schema declares no display field or the row lacks a value

func (*Schema) EdgeByName

func (s *Schema) EdgeByName(name string) (EdgeDescriptor, bool)

EdgeByName returns the edge with the given name

func (*Schema) EmitIngest

func (s *Schema) EmitIngest(ctx context.Context, runtime *gala.Gala, headers gala.Headers, request IngestRequest) error

EmitIngest queues one durable schema-ingest command.

func (*Schema) EnrichWorkflowPayload

func (s *Schema) EnrichWorkflowPayload(ctx context.Context, client *generated.Client, objectID string, payload map[string]any) error

EnrichWorkflowPayload copies designated object fields into a webhook payload. Schemas without designated payload fields contribute only their object ID, preserving the existing contract.

func (*Schema) FieldByName

func (s *Schema) FieldByName(name string) (FieldDescriptor, bool)

FieldByName returns the field descriptor addressed by a caller-supplied field or input name.

func (*Schema) FilterWorkflowInstances

func (s *Schema) FilterWorkflowInstances(query *generated.WorkflowInstanceQuery, objectID string) (*generated.WorkflowInstanceQuery, error)

FilterWorkflowInstances restricts a workflow instance query to one object.

func (*Schema) FilterWorkflowObjectRefs

func (s *Schema) FilterWorkflowObjectRefs(query *generated.WorkflowObjectRefQuery, objectID string) (*generated.WorkflowObjectRefQuery, error)

FilterWorkflowObjectRefs restricts an object-reference query to one object.

func (*Schema) LoadWorkflowObject

func (s *Schema) LoadWorkflowObject(ctx context.Context, client *generated.Client, objectID string) (generated.Noder, error)

LoadWorkflowObject loads the native Ent node for a workflow-designated schema.

func (*Schema) MatchKeyField

func (s *Schema) MatchKeyField(field string) bool

MatchKeyField reports whether field is a declared match-key column for this schema

func (*Schema) PersistIngest

func (s *Schema) PersistIngest(ctx context.Context, client *generated.Client, integration *generated.Integration, payload json.RawMessage) (id string, changed bool, managed bool, err error)

PersistIngest prepares and persists one mapped record synchronously through the schema's bound persistence, sharing the preparation the durable ingest consumer applies

func (*Schema) ResolveInputKey

func (s *Schema) ResolveInputKey(name string) (string, bool)

ResolveInputKey resolves a caller-supplied field name to this schema's canonical create-input key. It accepts the mapping input key, the snake_case field name, or case variants of either; annotation-declared input keys win over raw field names. The returned key matches the create input's snake_case json tags so mapped payloads unmarshal without re-keying

func (*Schema) SetWorkflowInstanceObjectID

func (s *Schema) SetWorkflowInstanceObjectID(builder *generated.WorkflowInstanceCreate, objectID string) error

SetWorkflowInstanceObjectID binds a workflow instance builder to an object using the canonical edge.

func (*Schema) SetWorkflowObjectRefObjectID

func (s *Schema) SetWorkflowObjectRefObjectID(builder *generated.WorkflowObjectRefCreate, objectID string) error

SetWorkflowObjectRefObjectID binds an object-reference builder using the canonical edge.

func (*Schema) SoftDeletes

func (s *Schema) SoftDeletes() bool

SoftDeletes reports whether this schema soft-deletes rows via the deleted_at column

func (*Schema) SystemControlledOnly

func (s *Schema) SystemControlledOnly(set ChangeSet) bool

SystemControlledOnly reports whether the change set touches only system-controlled columns and edges

func (*Schema) TaskRuleEligible

func (s *Schema) TaskRuleEligible() bool

TaskRuleEligible reports whether the schema has any field-level or schema-level task rules

func (*Schema) Upsert

func (s *Schema) Upsert(ctx context.Context, client *generated.Client, ownerID string, payload json.RawMessage) (id string, changed bool, managed bool, err error)

Upsert creates or updates the row matching the payload's lookup key through the ingest capability

func (*Schema) WorkflowChangeSet

func (s *Schema) WorkflowChangeSet(changes ChangeSet) ChangeSet

WorkflowChangeSet filters the canonical mutation delta to workflow-designated fields and edges.

func (*Schema) WorkflowEdges

func (s *Schema) WorkflowEdges() []EdgeDescriptor

WorkflowEdges returns the workflow-eligible members of the schema's canonical edge catalog.

func (*Schema) WorkflowFields

func (s *Schema) WorkflowFields() []FieldDescriptor

WorkflowFields returns the workflow-eligible members of the schema's canonical field catalog.

func (*Schema) WorkflowOwnerID

func (s *Schema) WorkflowOwnerID(ctx context.Context, client *generated.Client, objectID string) (string, error)

WorkflowOwnerID returns the owner_id of a workflow object through the schema's existing loader.

type SchemaDescriptor

type SchemaDescriptor struct {
	// Name is the PascalCase canonical form
	Name string `json:"-"`
	// Snake is the snake_case form
	Snake string `json:"-"`
	// Lower is the lowercase no-separator form used for fuzzy lookup
	Lower string `json:"-"`
	// WorkflowEligible reports whether this schema participates in workflow operations
	WorkflowEligible bool `json:"-"`
}

SchemaDescriptor is the canonical identity for an entity schema

func (SchemaDescriptor) IsZero

func (d SchemaDescriptor) IsZero() bool

IsZero reports whether the descriptor is unset

func (SchemaDescriptor) Label

func (d SchemaDescriptor) Label() string

Label derives the human-readable schema label from the PascalCase name by inserting spaces at word boundaries, keeping acronym runs intact (TrustCenterNDARequest -> "Trust Center NDA Request")

func (SchemaDescriptor) MarshalJSON

func (d SchemaDescriptor) MarshalJSON() ([]byte, error)

MarshalJSON serializes the descriptor as its snake_case form

func (SchemaDescriptor) String

func (d SchemaDescriptor) String() string

String returns the PascalCase canonical name

func (*SchemaDescriptor) UnmarshalJSON

func (d *SchemaDescriptor) UnmarshalJSON(data []byte) error

UnmarshalJSON deserializes a descriptor from any known name variation. An empty string deserializes to the zero descriptor so optional/omitted descriptor fields round-trip cleanly

type SchemaRef

type SchemaRef struct {
	// Schema is the schema name
	Schema string
	// Operation is the operation being performed
	Operation string
	// EntityID is the entity identifier when available
	EntityID string
	// Edge is the edge name when available
	Edge string
}

SchemaRef carries schema and operation identity for structured log embedding

func (SchemaRef) MarshalZerologObject

func (r SchemaRef) MarshalZerologObject(e *zerolog.Event)

MarshalZerologObject implements zerolog.LogObjectMarshaler

type SubcontrolProjection

type SubcontrolProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                         string                            `json:"id,omitempty"`
	Aliases                    []string                          `json:"aliases,omitempty"`
	AssessmentMethods          []models.AssessmentMethod         `json:"assessment_methods,omitempty"`
	AssessmentObjectives       []models.AssessmentObjective      `json:"assessment_objectives,omitempty"`
	AuditorReferenceID         string                            `json:"auditor_reference_id,omitempty"`
	Category                   string                            `json:"category,omitempty"`
	CategoryID                 string                            `json:"category_id,omitempty"`
	ControlID                  string                            `json:"control_id,omitempty"`
	ControlOwnerID             string                            `json:"control_owner_id,omitempty"`
	ControlQuestions           []string                          `json:"control_questions,omitempty"`
	CreatedAt                  time.Time                         `json:"created_at,omitempty"`
	CreatedBy                  string                            `json:"created_by,omitempty"`
	DelegateID                 string                            `json:"delegate_id,omitempty"`
	Description                string                            `json:"description,omitempty"`
	DescriptionJSON            []interface{}                     `json:"description_json,omitempty"`
	DisplayID                  string                            `json:"display_id,omitempty"`
	EvidenceRequests           []models.EvidenceRequests         `json:"evidence_requests,omitempty"`
	ExampleEvidence            []models.ExampleEvidence          `json:"example_evidence,omitempty"`
	ExternalUUID               string                            `json:"external_uuid,omitempty"`
	ImplementationDescription  string                            `json:"implementation_description,omitempty"`
	ImplementationGuidance     []models.ImplementationGuidance   `json:"implementation_guidance,omitempty"`
	ImplementationStatus       enums.ControlImplementationStatus `json:"implementation_status,omitempty"`
	InternalNotes              string                            `json:"internal_notes,omitempty"`
	MappedCategories           []string                          `json:"mapped_categories,omitempty"`
	OwnerID                    string                            `json:"owner_id,omitempty"`
	PublicRepresentation       string                            `json:"public_representation,omitempty"`
	RefCode                    string                            `json:"ref_code,omitempty"`
	ReferenceFramework         string                            `json:"reference_framework,omitempty"`
	ReferenceFrameworkRevision string                            `json:"reference_framework_revision,omitempty"`
	ReferenceID                string                            `json:"reference_id,omitempty"`
	References                 []models.Reference                `json:"references,omitempty"`
	ResponsiblePartyID         string                            `json:"responsible_party_id,omitempty"`
	Source                     enums.ControlSource               `json:"source,omitempty"`
	SourceName                 string                            `json:"source_name,omitempty"`
	Status                     enums.ControlStatus               `json:"status,omitempty"`
	Subcategory                string                            `json:"subcategory,omitempty"`
	SubcontrolKindID           string                            `json:"subcontrol_kind_id,omitempty"`
	SubcontrolKindName         string                            `json:"subcontrol_kind_name,omitempty"`
	SystemInternalID           string                            `json:"system_internal_id,omitempty"`
	SystemOwned                bool                              `json:"system_owned,omitempty"`
	Tags                       []string                          `json:"tags,omitempty"`
	TestingProcedures          []models.TestingProcedures        `json:"testing_procedures,omitempty"`
	Title                      string                            `json:"title,omitempty"`
	UpdatedAt                  time.Time                         `json:"updated_at,omitempty"`
	UpdatedBy                  string                            `json:"updated_by,omitempty"`
	UpdatedByImpersonator      string                            `json:"updated_by_impersonator,omitempty"`
	WorkflowEligibleMarker     bool                              `json:"workflow_eligible_marker,omitempty"`
}

SubcontrolProjection is the flat, CEL- and jsonschema-facing view of a Subcontrol: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Subcontrol whose edge graph cannot be reflected

type SubprocessorProjection

type SubprocessorProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string    `json:"id,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	CreatedBy             string    `json:"created_by,omitempty"`
	Description           string    `json:"description,omitempty"`
	InternalNotes         string    `json:"internal_notes,omitempty"`
	LogoFileID            string    `json:"logo_file_id,omitempty"`
	LogoRemoteURL         string    `json:"logo_remote_url,omitempty"`
	Name                  string    `json:"name,omitempty"`
	OwnerID               string    `json:"owner_id,omitempty"`
	SystemInternalID      string    `json:"system_internal_id,omitempty"`
	SystemOwned           bool      `json:"system_owned,omitempty"`
	Tags                  []string  `json:"tags,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
	UpdatedBy             string    `json:"updated_by,omitempty"`
	UpdatedByImpersonator string    `json:"updated_by_impersonator,omitempty"`
}

SubprocessorProjection is the flat, CEL- and jsonschema-facing view of a Subprocessor: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Subprocessor whose edge graph cannot be reflected

type SubscriberProjection

type SubscriberProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string    `json:"id,omitempty"`
	Active                bool      `json:"active,omitempty"`
	ContactID             string    `json:"contact_id,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	CreatedBy             string    `json:"created_by,omitempty"`
	Email                 string    `json:"email,omitempty"`
	OwnerID               string    `json:"owner_id,omitempty"`
	PhoneNumber           string    `json:"phone_number,omitempty"`
	SendAttempts          int       `json:"send_attempts,omitempty"`
	Tags                  []string  `json:"tags,omitempty"`
	TrustCenterID         string    `json:"trust_center_id,omitempty"`
	Unsubscribed          bool      `json:"unsubscribed,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
	UpdatedBy             string    `json:"updated_by,omitempty"`
	UpdatedByImpersonator string    `json:"updated_by_impersonator,omitempty"`
	UserID                string    `json:"user_id,omitempty"`
	VerifiedEmail         bool      `json:"verified_email,omitempty"`
	VerifiedPhone         bool      `json:"verified_phone,omitempty"`
}

SubscriberProjection is the flat, CEL- and jsonschema-facing view of a Subscriber: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Subscriber whose edge graph cannot be reflected

type SystemDetailProjection

type SystemDetailProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string                       `json:"id,omitempty"`
	AuthorizationBoundary string                       `json:"authorization_boundary,omitempty"`
	CreatedAt             time.Time                    `json:"created_at,omitempty"`
	CreatedBy             string                       `json:"created_by,omitempty"`
	Description           string                       `json:"description,omitempty"`
	DisplayID             string                       `json:"display_id,omitempty"`
	LastReviewed          models.DateTime              `json:"last_reviewed,omitempty"`
	OscalMetadataJSON     map[string]interface{}       `json:"oscal_metadata_json,omitempty"`
	OwnerID               string                       `json:"owner_id,omitempty"`
	RevisionHistory       []interface{}                `json:"revision_history,omitempty"`
	SensitivityLevel      enums.SystemSensitivityLevel `json:"sensitivity_level,omitempty"`
	SystemName            string                       `json:"system_name,omitempty"`
	Tags                  []string                     `json:"tags,omitempty"`
	UpdatedAt             time.Time                    `json:"updated_at,omitempty"`
	UpdatedBy             string                       `json:"updated_by,omitempty"`
	UpdatedByImpersonator string                       `json:"updated_by_impersonator,omitempty"`
	Version               string                       `json:"version,omitempty"`
}

SystemDetailProjection is the flat, CEL- and jsonschema-facing view of a SystemDetail: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.SystemDetail whose edge graph cannot be reflected

type TargetSelector

type TargetSelector struct {
	// Schema is the target entity schema
	Schema SchemaDescriptor `json:"schema"`
	// SourceSchema is the schema of the source entity in SourceContext; when set, selectTargets binds
	// "source" as that schema's native projection type so source-aware expressions resolve typed fields
	SourceSchema SchemaDescriptor `json:"source_schema,omitempty"`
	// KeyMatch, when set, resolves candidates with an indexed key query before any Expression filtering
	KeyMatch *KeyMatch `json:"key_match,omitempty"`
	// Unique reports whether the edge this selector resolves for sets a single target
	Unique bool `json:"unique,omitempty"`
	// Expression is a CEL expression evaluated against each candidate entity
	Expression string `json:"expression"`
	// ExcludeIDs is a list of entity IDs to exclude from the result set
	ExcludeIDs []string `json:"exclude_ids,omitempty"`
	// SourceContext is optional JSON data for the source entity, exposed as "source" in CEL expressions
	SourceContext json.RawMessage `json:"source_context,omitempty"`
}

TargetSelector specifies a set of entities to target via schema and expression

type TaskProjection

type TaskProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                     string                 `json:"id,omitempty"`
	AssigneeID             string                 `json:"assignee_id,omitempty"`
	AssignerID             string                 `json:"assigner_id,omitempty"`
	Completed              models.DateTime        `json:"completed,omitempty"`
	CreatedAt              time.Time              `json:"created_at,omitempty"`
	CreatedBy              string                 `json:"created_by,omitempty"`
	Details                string                 `json:"details,omitempty"`
	DetailsJSON            []interface{}          `json:"details_json,omitempty"`
	DisplayID              string                 `json:"display_id,omitempty"`
	Due                    models.DateTime        `json:"due,omitempty"`
	EnvironmentID          string                 `json:"environment_id,omitempty"`
	EnvironmentName        string                 `json:"environment_name,omitempty"`
	ExternalReferenceURL   []string               `json:"external_reference_url,omitempty"`
	ExternalUUID           string                 `json:"external_uuid,omitempty"`
	IdempotencyKey         string                 `json:"idempotency_key,omitempty"`
	IsSuggested            bool                   `json:"is_suggested,omitempty"`
	IsTemplate             bool                   `json:"is_template,omitempty"`
	Metadata               map[string]interface{} `json:"metadata,omitempty"`
	OwnerID                string                 `json:"owner_id,omitempty"`
	ParentTaskID           string                 `json:"parent_task_id,omitempty"`
	Priority               int                    `json:"priority,omitempty"`
	ScopeID                string                 `json:"scope_id,omitempty"`
	ScopeName              string                 `json:"scope_name,omitempty"`
	Source                 string                 `json:"source,omitempty"`
	SourceKey              string                 `json:"source_key,omitempty"`
	Status                 enums.TaskStatus       `json:"status,omitempty"`
	SystemGenerated        bool                   `json:"system_generated,omitempty"`
	Tags                   []string               `json:"tags,omitempty"`
	TaskKindID             string                 `json:"task_kind_id,omitempty"`
	TaskKindName           string                 `json:"task_kind_name,omitempty"`
	Title                  string                 `json:"title,omitempty"`
	UpdatedAt              time.Time              `json:"updated_at,omitempty"`
	UpdatedBy              string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator  string                 `json:"updated_by_impersonator,omitempty"`
	WorkflowEligibleMarker bool                   `json:"workflow_eligible_marker,omitempty"`
}

TaskProjection is the flat, CEL- and jsonschema-facing view of a Task: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Task whose edge graph cannot be reflected

type TaskRuleDescriptor

type TaskRuleDescriptor struct {
	// RuleID identifies which task template to render at rule evaluation time
	RuleID string `json:"ruleId"`
	// Expression is a CEL boolean expression evaluated with the owning field's decoded JSON value
	// bound as "value" (e.g. "value.policies.has_existing == true"); empty always fires. Ignored
	// when EachElement is set
	Expression string `json:"expression,omitempty"`
	// EachElement, when set, is a CEL expression resolving to a list within the field's value; the
	// rule expands to fire once per element instead of evaluating Expression as a single boolean
	EachElement string `json:"eachElement,omitempty"`
	// Trigger selects create-and-update (empty) or create-only evaluation; compare against
	// entx.TaskRuleOnCreateOnly / entx.TaskRuleOnCreateOrUpdate
	Trigger entx.TaskRuleTrigger `json:"trigger,omitempty"`
}

TaskRuleDescriptor describes one suggested-task trigger: a CEL condition plus the RuleID a runtime engine uses to look up the task's template content

type UserProjection

type UserProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string             `json:"id,omitempty"`
	AuthProvider          enums.AuthProvider `json:"auth_provider,omitempty"`
	AvatarLocalFileID     string             `json:"avatar_local_file_id,omitempty"`
	AvatarRemoteURL       string             `json:"avatar_remote_url,omitempty"`
	AvatarUpdatedAt       time.Time          `json:"avatar_updated_at,omitempty"`
	CreatedAt             time.Time          `json:"created_at,omitempty"`
	CreatedBy             string             `json:"created_by,omitempty"`
	DisplayID             string             `json:"display_id,omitempty"`
	DisplayName           string             `json:"display_name,omitempty"`
	Email                 string             `json:"email,omitempty"`
	FirstName             string             `json:"first_name,omitempty"`
	LastLoginProvider     enums.AuthProvider `json:"last_login_provider,omitempty"`
	LastName              string             `json:"last_name,omitempty"`
	LastSeen              time.Time          `json:"last_seen,omitempty"`
	Role                  enums.Role         `json:"role,omitempty"`
	ScimActive            bool               `json:"scim_active,omitempty"`
	ScimExternalID        string             `json:"scim_external_id,omitempty"`
	ScimLocale            string             `json:"scim_locale,omitempty"`
	ScimPreferredLanguage string             `json:"scim_preferred_language,omitempty"`
	ScimUsername          string             `json:"scim_username,omitempty"`
	Sub                   string             `json:"sub,omitempty"`
	Tags                  []string           `json:"tags,omitempty"`
	UpdatedAt             time.Time          `json:"updated_at,omitempty"`
	UpdatedBy             string             `json:"updated_by,omitempty"`
}

UserProjection is the flat, CEL- and jsonschema-facing view of a User: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.User whose edge graph cannot be reflected

type VendorRiskScoreProjection

type VendorRiskScoreProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string                        `json:"id,omitempty"`
	Answer                string                        `json:"answer,omitempty"`
	AnswerType            enums.VendorScoringAnswerType `json:"answer_type,omitempty"`
	AssessmentResponseID  string                        `json:"assessment_response_id,omitempty"`
	CreatedAt             time.Time                     `json:"created_at,omitempty"`
	CreatedBy             string                        `json:"created_by,omitempty"`
	EntityID              string                        `json:"entity_id,omitempty"`
	Impact                enums.VendorRiskImpact        `json:"impact,omitempty"`
	Likelihood            enums.VendorRiskLikelihood    `json:"likelihood,omitempty"`
	Notes                 string                        `json:"notes,omitempty"`
	OwnerID               string                        `json:"owner_id,omitempty"`
	QuestionCategory      enums.VendorScoringCategory   `json:"question_category,omitempty"`
	QuestionDescription   string                        `json:"question_description,omitempty"`
	QuestionKey           string                        `json:"question_key,omitempty"`
	QuestionName          string                        `json:"question_name,omitempty"`
	Score                 float64                       `json:"score,omitempty"`
	Tags                  []string                      `json:"tags,omitempty"`
	UpdatedAt             time.Time                     `json:"updated_at,omitempty"`
	UpdatedBy             string                        `json:"updated_by,omitempty"`
	UpdatedByImpersonator string                        `json:"updated_by_impersonator,omitempty"`
	VendorScoringConfigID string                        `json:"vendor_scoring_config_id,omitempty"`
}

VendorRiskScoreProjection is the flat, CEL- and jsonschema-facing view of a VendorRiskScore: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.VendorRiskScore whose edge graph cannot be reflected

type VulnerabilityProjection

type VulnerabilityProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                            string                 `json:"id,omitempty"`
	AssignedTo                    string                 `json:"assigned_to,omitempty"`
	AssignedToGroupID             string                 `json:"assigned_to_group_id,omitempty"`
	AssignedToIdentityHolderID    string                 `json:"assigned_to_identity_holder_id,omitempty"`
	AssignedToUserID              string                 `json:"assigned_to_user_id,omitempty"`
	AutoDismissedAt               models.DateTime        `json:"auto_dismissed_at,omitempty"`
	Blocking                      bool                   `json:"blocking,omitempty"`
	Category                      string                 `json:"category,omitempty"`
	CreatedAt                     time.Time              `json:"created_at,omitempty"`
	CreatedBy                     string                 `json:"created_by,omitempty"`
	CveID                         string                 `json:"cve_id,omitempty"`
	CweIds                        []string               `json:"cwe_ids,omitempty"`
	DependencyScope               string                 `json:"dependency_scope,omitempty"`
	Description                   string                 `json:"description,omitempty"`
	DiscoveredAt                  models.DateTime        `json:"discovered_at,omitempty"`
	DismissedAt                   models.DateTime        `json:"dismissed_at,omitempty"`
	DismissedComment              string                 `json:"dismissed_comment,omitempty"`
	DismissedReason               string                 `json:"dismissed_reason,omitempty"`
	DisplayID                     string                 `json:"display_id,omitempty"`
	DisplayName                   string                 `json:"display_name,omitempty"`
	EnvironmentID                 string                 `json:"environment_id,omitempty"`
	EnvironmentName               string                 `json:"environment_name,omitempty"`
	Exploitability                float64                `json:"exploitability,omitempty"`
	ExternalID                    string                 `json:"external_id,omitempty"`
	ExternalOwnerID               string                 `json:"external_owner_id,omitempty"`
	ExternalURI                   string                 `json:"external_uri,omitempty"`
	FirstPatchedVersion           string                 `json:"first_patched_version,omitempty"`
	FixAvailable                  bool                   `json:"fix_available,omitempty"`
	FixedAt                       models.DateTime        `json:"fixed_at,omitempty"`
	Impact                        float64                `json:"impact,omitempty"`
	Impacts                       []string               `json:"impacts,omitempty"`
	IntegrationRunID              string                 `json:"integration_run_id,omitempty"`
	InternalNotes                 string                 `json:"internal_notes,omitempty"`
	InternalOwner                 string                 `json:"internal_owner,omitempty"`
	InternalOwnerGroupID          string                 `json:"internal_owner_group_id,omitempty"`
	InternalOwnerIdentityHolderID string                 `json:"internal_owner_identity_holder_id,omitempty"`
	InternalOwnerUserID           string                 `json:"internal_owner_user_id,omitempty"`
	ManagedBy                     string                 `json:"managed_by,omitempty"`
	ManifestPath                  string                 `json:"manifest_path,omitempty"`
	Metadata                      map[string]interface{} `json:"metadata,omitempty"`
	Open                          bool                   `json:"open,omitempty"`
	OwnerID                       string                 `json:"owner_id,omitempty"`
	PackageEcosystem              string                 `json:"package_ecosystem,omitempty"`
	PackageName                   string                 `json:"package_name,omitempty"`
	Priority                      string                 `json:"priority,omitempty"`
	Production                    bool                   `json:"production,omitempty"`
	Public                        bool                   `json:"public,omitempty"`
	PublishedAt                   models.DateTime        `json:"published_at,omitempty"`
	RawPayload                    map[string]interface{} `json:"raw_payload,omitempty"`
	References                    []string               `json:"references,omitempty"`
	RemediationSLA                int                    `json:"remediation_sla,omitempty"`
	ReviewedBy                    string                 `json:"reviewed_by,omitempty"`
	ReviewedByGroupID             string                 `json:"reviewed_by_group_id,omitempty"`
	ReviewedByIdentityHolderID    string                 `json:"reviewed_by_identity_holder_id,omitempty"`
	ReviewedByUserID              string                 `json:"reviewed_by_user_id,omitempty"`
	ScopeID                       string                 `json:"scope_id,omitempty"`
	ScopeName                     string                 `json:"scope_name,omitempty"`
	Score                         float64                `json:"score,omitempty"`
	SecurityLevel                 enums.SecurityLevel    `json:"security_level,omitempty"`
	Severity                      string                 `json:"severity,omitempty"`
	Source                        string                 `json:"source,omitempty"`
	SourceDefinitionID            string                 `json:"source_definition_id,omitempty"`
	SourceDefinitionVersion       string                 `json:"source_definition_version,omitempty"`
	SourceInstanceID              string                 `json:"source_instance_id,omitempty"`
	SourceUpdatedAt               models.DateTime        `json:"source_updated_at,omitempty"`
	Summary                       string                 `json:"summary,omitempty"`
	SystemInternalID              string                 `json:"system_internal_id,omitempty"`
	SystemOwned                   bool                   `json:"system_owned,omitempty"`
	Tags                          []string               `json:"tags,omitempty"`
	UpdatedAt                     time.Time              `json:"updated_at,omitempty"`
	UpdatedBy                     string                 `json:"updated_by,omitempty"`
	UpdatedByImpersonator         string                 `json:"updated_by_impersonator,omitempty"`
	Validated                     bool                   `json:"validated,omitempty"`
	Vector                        string                 `json:"vector,omitempty"`
	VulnerabilityStatusID         string                 `json:"vulnerability_status_id,omitempty"`
	VulnerabilityStatusName       string                 `json:"vulnerability_status_name,omitempty"`
	VulnerableVersionRange        string                 `json:"vulnerable_version_range,omitempty"`
	WorkflowEligibleMarker        bool                   `json:"workflow_eligible_marker,omitempty"`
}

VulnerabilityProjection is the flat, CEL- and jsonschema-facing view of a Vulnerability: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.Vulnerability whose edge graph cannot be reflected

type WorkflowObjectRefProjection

type WorkflowObjectRefProjection struct {
	// ID is the entity identifier, exposed to expressions as "id"
	ID                    string    `json:"id,omitempty"`
	ActionPlanID          string    `json:"action_plan_id,omitempty"`
	AssessmentID          string    `json:"assessment_id,omitempty"`
	AssessmentResponseID  string    `json:"assessment_response_id,omitempty"`
	CampaignID            string    `json:"campaign_id,omitempty"`
	CampaignTargetID      string    `json:"campaign_target_id,omitempty"`
	ControlID             string    `json:"control_id,omitempty"`
	CreatedAt             time.Time `json:"created_at,omitempty"`
	CreatedBy             string    `json:"created_by,omitempty"`
	DirectoryAccountID    string    `json:"directory_account_id,omitempty"`
	DirectoryGroupID      string    `json:"directory_group_id,omitempty"`
	DirectoryMembershipID string    `json:"directory_membership_id,omitempty"`
	DisplayID             string    `json:"display_id,omitempty"`
	EvidenceID            string    `json:"evidence_id,omitempty"`
	FindingID             string    `json:"finding_id,omitempty"`
	IdentityHolderID      string    `json:"identity_holder_id,omitempty"`
	InternalPolicyID      string    `json:"internal_policy_id,omitempty"`
	OwnerID               string    `json:"owner_id,omitempty"`
	PlatformID            string    `json:"platform_id,omitempty"`
	ProcedureID           string    `json:"procedure_id,omitempty"`
	RemediationID         string    `json:"remediation_id,omitempty"`
	RiskID                string    `json:"risk_id,omitempty"`
	SubcontrolID          string    `json:"subcontrol_id,omitempty"`
	TaskID                string    `json:"task_id,omitempty"`
	UpdatedAt             time.Time `json:"updated_at,omitempty"`
	UpdatedBy             string    `json:"updated_by,omitempty"`
	UpdatedByImpersonator string    `json:"updated_by_impersonator,omitempty"`
	VulnerabilityID       string    `json:"vulnerability_id,omitempty"`
	WorkflowInstanceID    string    `json:"workflow_instance_id,omitempty"`
}

WorkflowObjectRefProjection is the flat, CEL- and jsonschema-facing view of a WorkflowObjectRef: its readable scalar fields (id, columns, foreign-key ids) with snake_case json tags matching the field names used in expressions. It deliberately omits edges so it registers as a CEL native type, unlike the full generated.WorkflowObjectRef whose edge graph cannot be reflected

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL